| @@ -152,6 +152,8 @@ MeshViewer::~MeshViewer() | |||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| void MeshViewer::Start() | void MeshViewer::Start() | ||||
| { | { | ||||
| if (m_init) return; | |||||
| /** OLD STUFF **/ | /** OLD STUFF **/ | ||||
| //Prepare(); | //Prepare(); | ||||
| @@ -185,17 +187,24 @@ void MeshViewer::Start() | |||||
| m_controller->Init(m_profile); | m_controller->Init(m_profile); | ||||
| #endif //HAS_INPUT | #endif //HAS_INPUT | ||||
| /** ----- Init is done ----- **/ | |||||
| m_init = true; | |||||
| //Ref all entities | |||||
| for (Entity* entity : m_entities) Ticker::Ref(entity); | |||||
| /** ----- Start threads ----- **/ | /** ----- Start threads ----- **/ | ||||
| m_file_check->Start(); | m_file_check->Start(); | ||||
| /** ----- Init is done ----- **/ | |||||
| m_init = true; | |||||
| } | } | ||||
| //----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
| void MeshViewer::Stop() | void MeshViewer::Stop() | ||||
| { | { | ||||
| if (!m_init) return; | |||||
| /** OLD STUFF **/ | |||||
| //Unprepare(); | |||||
| //Destroy scene setup | //Destroy scene setup | ||||
| UpdateSceneSetup(true); | UpdateSceneSetup(true); | ||||
| @@ -272,7 +281,10 @@ void MeshViewer::TickGame(float seconds) | |||||
| { | { | ||||
| //Shutdown logic | //Shutdown logic | ||||
| if (m_controller->IsKeyPressed(MeshViewerKeyInput::Exit)) | if (m_controller->IsKeyPressed(MeshViewerKeyInput::Exit)) | ||||
| { | |||||
| Ticker::Shutdown(); | Ticker::Shutdown(); | ||||
| return; | |||||
| } | |||||
| } | } | ||||
| #endif //HAS_INPUT | #endif //HAS_INPUT | ||||
| @@ -106,7 +106,7 @@ liblolcore_sources = \ | |||||
| gpu/lolfx.cpp \ | gpu/lolfx.cpp \ | ||||
| \ | \ | ||||
| mesh/mesh.cpp mesh/mesh.h \ | mesh/mesh.cpp mesh/mesh.h \ | ||||
| mesh/primitive.cpp mesh/primitive.h \ | |||||
| mesh/primitivemesh.cpp mesh/primitivemesh.h \ | |||||
| \ | \ | ||||
| sys/init.cpp sys/timer.cpp sys/file.cpp sys/hacks.cpp \ | sys/init.cpp sys/timer.cpp sys/file.cpp sys/hacks.cpp \ | ||||
| sys/thread.cpp sys/threadbase.h \ | sys/thread.cpp sys/threadbase.h \ | ||||
| @@ -51,7 +51,7 @@ | |||||
| // Other objects | // Other objects | ||||
| #include <lol/../dict.h> | #include <lol/../dict.h> | ||||
| #include <lol/../mesh/mesh.h> | #include <lol/../mesh/mesh.h> | ||||
| #include <lol/../mesh/primitive.h> | |||||
| #include <lol/../mesh/primitivemesh.h> | |||||
| #include <lol/../application/application.h> | #include <lol/../application/application.h> | ||||
| #include <lol/../easymesh/csgbsp.h> | #include <lol/../easymesh/csgbsp.h> | ||||
| #include <lol/../easymesh/easymesh.h> | #include <lol/../easymesh/easymesh.h> | ||||
| @@ -166,7 +166,7 @@ | |||||
| <ClCompile Include="math\trig.cpp" /> | <ClCompile Include="math\trig.cpp" /> | ||||
| <ClCompile Include="math\vector.cpp" /> | <ClCompile Include="math\vector.cpp" /> | ||||
| <ClCompile Include="mesh\mesh.cpp" /> | <ClCompile Include="mesh\mesh.cpp" /> | ||||
| <ClCompile Include="mesh\primitive.cpp" /> | |||||
| <ClCompile Include="mesh\primitivemesh.cpp" /> | |||||
| <ClCompile Include="messageservice.cpp" /> | <ClCompile Include="messageservice.cpp" /> | ||||
| <ClCompile Include="platform.cpp" /> | <ClCompile Include="platform.cpp" /> | ||||
| <ClCompile Include="platform\d3d9\d3d9input.cpp" /> | <ClCompile Include="platform\d3d9\d3d9input.cpp" /> | ||||
| @@ -327,7 +327,7 @@ | |||||
| <ClInclude Include="lol\sys\timer.h" /> | <ClInclude Include="lol\sys\timer.h" /> | ||||
| <ClInclude Include="lol\unit.h" /> | <ClInclude Include="lol\unit.h" /> | ||||
| <ClInclude Include="mesh\mesh.h" /> | <ClInclude Include="mesh\mesh.h" /> | ||||
| <ClInclude Include="mesh\primitive.h" /> | |||||
| <ClInclude Include="mesh\primitivemesh.h" /> | |||||
| <ClInclude Include="messageservice.h" /> | <ClInclude Include="messageservice.h" /> | ||||
| <ClInclude Include="numeric.h" /> | <ClInclude Include="numeric.h" /> | ||||
| <ClInclude Include="platform.h" /> | <ClInclude Include="platform.h" /> | ||||
| @@ -427,4 +427,4 @@ | |||||
| <ImportGroup Label="ExtensionTargets"> | <ImportGroup Label="ExtensionTargets"> | ||||
| <Import Project="$(SolutionDir)\msbuild\lolfx.targets" /> | <Import Project="$(SolutionDir)\msbuild\lolfx.targets" /> | ||||
| </ImportGroup> | </ImportGroup> | ||||
| </Project> | |||||
| </Project> | |||||
| @@ -147,9 +147,6 @@ | |||||
| <ClCompile Include="mesh\mesh.cpp"> | <ClCompile Include="mesh\mesh.cpp"> | ||||
| <Filter>mesh</Filter> | <Filter>mesh</Filter> | ||||
| </ClCompile> | </ClCompile> | ||||
| <ClCompile Include="mesh\primitive.cpp"> | |||||
| <Filter>mesh</Filter> | |||||
| </ClCompile> | |||||
| <ClCompile Include="gpu\rendercontext.cpp"> | <ClCompile Include="gpu\rendercontext.cpp"> | ||||
| <Filter>gpu</Filter> | <Filter>gpu</Filter> | ||||
| </ClCompile> | </ClCompile> | ||||
| @@ -424,6 +421,10 @@ | |||||
| <ClCompile Include="textureimage.cpp"> | <ClCompile Include="textureimage.cpp"> | ||||
| <Filter>tileset</Filter> | <Filter>tileset</Filter> | ||||
| </ClCompile> | </ClCompile> | ||||
| <ClCompile Include="lolimgui.cpp" /> | |||||
| <ClCompile Include="mesh\primitivemesh.cpp"> | |||||
| <Filter>mesh</Filter> | |||||
| </ClCompile> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClInclude Include="debug\fps.h"> | <ClInclude Include="debug\fps.h"> | ||||
| @@ -510,9 +511,6 @@ | |||||
| <ClInclude Include="mesh\mesh.h"> | <ClInclude Include="mesh\mesh.h"> | ||||
| <Filter>mesh</Filter> | <Filter>mesh</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| <ClInclude Include="mesh\primitive.h"> | |||||
| <Filter>mesh</Filter> | |||||
| </ClInclude> | |||||
| <ClInclude Include="application\application.h"> | <ClInclude Include="application\application.h"> | ||||
| <Filter>application</Filter> | <Filter>application</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| @@ -790,6 +788,10 @@ | |||||
| <ClInclude Include="textureimage-private.h"> | <ClInclude Include="textureimage-private.h"> | ||||
| <Filter>tileset</Filter> | <Filter>tileset</Filter> | ||||
| </ClInclude> | </ClInclude> | ||||
| <ClInclude Include="lolimgui.h" /> | |||||
| <ClInclude Include="mesh\primitivemesh.h"> | |||||
| <Filter>mesh</Filter> | |||||
| </ClInclude> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <LolFxCompile Include="gpu\emptymaterial.lolfx"> | <LolFxCompile Include="gpu\emptymaterial.lolfx"> | ||||