summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-03-30 15:43:39 +0100
committerkrzys-h <krzys_h@interia.pl>2013-03-30 15:43:39 +0100
commit845c8e9437e26cf3193d4e3dae2a02f03e17747d (patch)
treec85c5dcc825d8480d09f5eda86c0949e69d61656
parent040a7e8f249a190b0d66b10ccec075ad33772d7c (diff)
parente607fed265070be8c518d4302d8b76f738421fb3 (diff)
downloadcolobot-845c8e9437e26cf3193d4e3dae2a02f03e17747d.tar.gz
colobot-845c8e9437e26cf3193d4e3dae2a02f03e17747d.tar.bz2
colobot-845c8e9437e26cf3193d4e3dae2a02f03e17747d.zip
Merge branch 'dev' of github.com:colobot/colobot into dev
-rw-r--r--src/object/object.cpp13
-rw-r--r--test/unit/ui/CMakeLists.txt46
-rw-r--r--test/unit/ui/stubs/app_stub.cpp2
3 files changed, 34 insertions, 27 deletions
diff --git a/src/object/object.cpp b/src/object/object.cpp
index a0a3f09..23a757a 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -2658,7 +2658,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height,
if ( m_type == OBJECT_ENERGY )
{
- modelManager->AddModelReference("energy.mod", false, rank);
+ modelManager->AddModelCopy("energy.mod", false, rank);
SetPosition(0, pos);
SetAngleY(0, angle);
SetFloorHeight(0.0f);
@@ -2841,7 +2841,7 @@ bool CObject::CreateBuilding(Math::Vector pos, float angle, float height,
if ( m_type == OBJECT_STATION )
{
- modelManager->AddModelReference("station.mod", false, rank);
+ modelManager->AddModelCopy("station.mod", false, rank);
SetPosition(0, pos);
SetAngleY(0, angle);
SetFloorHeight(0.0f);
@@ -3207,7 +3207,14 @@ bool CObject::CreateResource(Math::Vector pos, float angle, ObjectType type,
if ( type == OBJECT_MARKKEYd ) name = "crossd.mod";
if ( type == OBJECT_EGG ) name = "egg.mod";
- modelManager->AddModelReference(name, false, rank);
+ if (type == OBJECT_POWER || type == OBJECT_ATOMIC)
+ {
+ modelManager->AddModelCopy(name, false, rank);
+ }
+ else
+ {
+ modelManager->AddModelReference(name, false, rank);
+ }
SetPosition(0, pos);
SetAngleY(0, angle);
diff --git a/test/unit/ui/CMakeLists.txt b/test/unit/ui/CMakeLists.txt
index 9505bd9..c899834 100644
--- a/test/unit/ui/CMakeLists.txt
+++ b/test/unit/ui/CMakeLists.txt
@@ -16,26 +16,26 @@ else()
set(SYSTEM_CPP_MODULE "system_other.cpp")
endif()
-#add_executable(edit_test
-#${SRC_DIR}/app/system.cpp
-#${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
-#${SRC_DIR}/common/event.cpp
-#${SRC_DIR}/common/logger.cpp
-#${SRC_DIR}/common/misc.cpp
-#${SRC_DIR}/common/profile.cpp
-#${SRC_DIR}/common/iman.cpp
-#${SRC_DIR}/common/stringutils.cpp
-#${SRC_DIR}/graphics/engine/text.cpp
-#${SRC_DIR}/ui/button.cpp
-#${SRC_DIR}/ui/control.cpp
-#${SRC_DIR}/ui/edit.cpp
-#${SRC_DIR}/ui/scroll.cpp
-#stubs/app_stub.cpp
-#stubs/engine_stub.cpp
-#stubs/particle_stub.cpp
-#stubs/restext_stub.cpp
-#stubs/robotmain_stub.cpp
-#edit_test.cpp)
-#target_link_libraries(edit_test gtest gmock ${SDL_LIBRARY} ${SDLTTF_LIBRARY} ${Boost_LIBRARIES})
-#
-#add_test(edit_test ./edit_test)
+add_executable(edit_test
+${SRC_DIR}/app/system.cpp
+${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
+${SRC_DIR}/common/event.cpp
+${SRC_DIR}/common/logger.cpp
+${SRC_DIR}/common/misc.cpp
+${SRC_DIR}/common/profile.cpp
+${SRC_DIR}/common/iman.cpp
+${SRC_DIR}/common/stringutils.cpp
+${SRC_DIR}/graphics/engine/text.cpp
+${SRC_DIR}/ui/button.cpp
+${SRC_DIR}/ui/control.cpp
+${SRC_DIR}/ui/edit.cpp
+${SRC_DIR}/ui/scroll.cpp
+stubs/app_stub.cpp
+stubs/engine_stub.cpp
+stubs/particle_stub.cpp
+stubs/restext_stub.cpp
+stubs/robotmain_stub.cpp
+edit_test.cpp)
+target_link_libraries(edit_test gtest gmock ${SDL_LIBRARY} ${SDLTTF_LIBRARY} ${Boost_LIBRARIES})
+
+add_test(edit_test ./edit_test)
diff --git a/test/unit/ui/stubs/app_stub.cpp b/test/unit/ui/stubs/app_stub.cpp
index 55263e6..9b33e5e 100644
--- a/test/unit/ui/stubs/app_stub.cpp
+++ b/test/unit/ui/stubs/app_stub.cpp
@@ -46,7 +46,7 @@ Event CApplication::CreateUpdateEvent()
return Event(EVENT_NULL);
}
-char GetLanguageChar()
+char CApplication::GetLanguageChar()
{
return 'E';
}