From b4b64abc1ec6224ccf13bf7afcbf56a700be20ad Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Tue, 1 Dec 2015 09:51:15 +0100 Subject: [PATCH 1/5] Made Rendering/Util visible to CMake project --- src/Engine/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Engine/CMakeLists.txt b/src/Engine/CMakeLists.txt index 861573a3..7bc15041 100644 --- a/src/Engine/CMakeLists.txt +++ b/src/Engine/CMakeLists.txt @@ -48,7 +48,12 @@ file(GLOB SOURCE_FILES_Rendering "${INCLUDE_PATH}/Rendering/*.h" "Rendering/*.cpp" ) +file(GLOB SOURCE_FILES_Rendering_Util + "${INCLUDE_PATH}/Rendering/Util/*.h" + "Rendering/Util/*.cpp" +) source_group(Rendering FILES ${SOURCE_FILES_Rendering}) +source_group(Rendering\\Util FILES ${SOURCE_FILES_Rendering_Util}) file(GLOB SOURCE_FILES_GUI "${INCLUDE_PATH}/GUI/*.h" From cf349870dee05907d92c130463d9815558d93283 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Tue, 1 Dec 2015 10:40:33 +0100 Subject: [PATCH 2/5] Simplified CMake for Game --- src/Game/CMakeLists.txt | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Game/CMakeLists.txt b/src/Game/CMakeLists.txt index 2fceae1e..b513fa92 100644 --- a/src/Game/CMakeLists.txt +++ b/src/Game/CMakeLists.txt @@ -1,31 +1,13 @@ project(TacticalZ-Game) -find_package(OpenGL REQUIRED) -find_package(GLEW REQUIRED) -find_package(GLFW REQUIRED) find_package(Boost REQUIRED COMPONENTS system filesystem thread chrono) -find_package(assimp REQUIRED) -find_package(ZLIB REQUIRED) -find_package(PNG REQUIRED) -# Because FindOpenAL is retarded -#set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/deps/include/AL") -#find_package(OpenAL REQUIRED) -if(UNIX) - find_package(X11 REQUIRED) -endif() set(INCLUDE_PATH ${CMAKE_SOURCE_DIR}/include/Game) include_directories( ${CMAKE_SOURCE_DIR}/include/Engine + ${CMAKE_SOURCE_DIR}/deps/include ${INCLUDE_PATH} - ${OPENGL_INCLUDE_DIR} - ${GLEW_INCLUDE_DIRS} - ${GLFW_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${assimp_INCLUDE_DIRS} - ${PNG_INCLUDE_DIRS} - ${OPENAL_INCLUDE_DIR} - ${X11_INCLUDE_DIRS} ) file(GLOB SOURCE_FILES From ae759654c1cd1221d516018411dea70c7d5a26aa Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Tue, 1 Dec 2015 11:21:33 +0100 Subject: [PATCH 3/5] Made deploy create a bin folder so it doesn't fail if it's missing --- tools/deploy.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/deploy.bat b/tools/deploy.bat index b3f51c07..cdab1c20 100755 --- a/tools/deploy.bat +++ b/tools/deploy.bat @@ -1,6 +1,7 @@ @ECHO off SET DeployLocation=bin\ +MKDIR %DeployLocation% ECHO Deploying assets to %DeployLocation% :: Asset folders From 75dcea40f2399c6d91e2307dcde9252043eec36a Mon Sep 17 00:00:00 2001 From: William Moberg Date: Tue, 1 Dec 2015 17:29:26 +0100 Subject: [PATCH 4/5] Log warning when memory is exceeded in MemoryPool. --- include/Engine/Core/MemoryPool.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/include/Engine/Core/MemoryPool.h b/include/Engine/Core/MemoryPool.h index 8fba0845..246f7d0a 100644 --- a/include/Engine/Core/MemoryPool.h +++ b/include/Engine/Core/MemoryPool.h @@ -1,6 +1,6 @@ #ifndef MemoryPool_h__ #define MemoryPool_h__ -#include +#include "Common.h" template class MemoryPoolForwardIterator; @@ -57,18 +57,6 @@ public: , m_LowestAllocatedSlot(m_NumSlots) { } - MemoryPool(size_t numMaxElements, size_t stride, char* allocatedMemory) - : m_StartAddress(allocatedMemory) - , m_SlotIsAllocated(numMaxElements, false) - , m_NumSlots(numMaxElements) - , m_Stride(stride) - , m_NumAllocatedSlots(0) - , m_CurrentAllocSlot(0) - , m_LowestAllocatedSlot(m_NumSlots) - { } - - - //We may get problems with memory being released //prematurely, etc. if we allow copies. MemoryPool(const MemoryPool& other) = delete; @@ -98,11 +86,13 @@ public: //Mark the slot as allocated. m_SlotIsAllocated[m_CurrentAllocSlot] = true; ++m_NumAllocatedSlots; + //Also increment slot to allocate. return m_StartAddress + m_Stride*m_CurrentAllocSlot++; } else { m_ExtraMemory.push_back((char*)malloc(m_Stride)); - //TODO: Log this later, we should preferably never enter here, set more memory in constructor instead. + //We should preferably not enter here to avoid performance issues. Set more numMaxElements in constructor instead. + LOG_WARNING("Allocated slots exceed Pool size, extra memory allocated dynamically. Pool size: %u, dynamic size: %u.", m_NumSlots, m_ExtraMemory.size()); return m_ExtraMemory.back(); } } From f65b7d591cf39884cb558dd780f66a0bd22d0c7a Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Wed, 2 Dec 2015 15:02:18 +0100 Subject: [PATCH 5/5] Fixed Tests running the game when it really shouldn't. --- src/Game/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Game/CMakeLists.txt b/src/Game/CMakeLists.txt index b513fa92..41cc30eb 100644 --- a/src/Game/CMakeLists.txt +++ b/src/Game/CMakeLists.txt @@ -12,12 +12,13 @@ include_directories( file(GLOB SOURCE_FILES "${INCLUDE_PATH}/*.h" - "*.cpp" + #"*.cpp" ) #source_group(Core FILES ${SOURCE_FILES}) set(SOURCE_FILES ${SOURCE_FILES} + "Game.cpp" ) set(LIBRARIES