2016-04-07 02:13:46 +02:00
|
|
|
###########################################################
|
|
|
|
## RWLIB
|
|
|
|
###########################################################
|
2016-08-04 02:09:47 +02:00
|
|
|
|
|
|
|
find_package(Boost COMPONENTS filesystem system REQUIRED)
|
|
|
|
|
2016-04-07 02:13:46 +02:00
|
|
|
SET(RWLIB_SOURCES
|
|
|
|
|
|
|
|
# GL stuff is only here temporarily, hoping to move it back to rwengine
|
|
|
|
"source/gl/gl_core_3_3.c"
|
|
|
|
"source/gl/gl_core_3_3.h"
|
|
|
|
"source/gl/DrawBuffer.hpp"
|
|
|
|
"source/gl/DrawBuffer.cpp"
|
|
|
|
"source/gl/GeometryBuffer.hpp"
|
|
|
|
"source/gl/GeometryBuffer.cpp"
|
|
|
|
"source/gl/TextureData.hpp"
|
|
|
|
"source/gl/TextureData.cpp"
|
|
|
|
|
2017-09-12 18:00:07 +02:00
|
|
|
"source/rw/abort.cpp"
|
rwlib: Use ClumpPtr instead of Clump*
Should fix these memory leaks:
==22737== 14,598,040 (131,472 direct, 14,466,568 indirect) bytes in 2,739 blocks are definitely lost in loss record 3,124 of 3,126
==22737== at 0x4C2F1CA: operator new(unsigned long) (vg_replace_malloc.c:334)
==22737== by 0x90FE4B: LoaderDFF::loadFromMemory(std::shared_ptr<FileContentsInfo>) (LoaderDFF.cpp:443)
==22737== by 0x7BCC86: GameData::loadModel(unsigned short) (GameData.cpp:474)
==22737== by 0x7DF7BC: GameWorld::createInstance(unsigned short, glm::tvec3<float, (glm::precision)0> const&, glm::tquat<float, (glm::precision)0> const&) (GameWorld.cpp:144)
==22737== by 0x7DF44C: GameWorld::placeItems(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (GameWorld.cpp:120)
==22737== by 0x758D38: RWGame::newGame() (RWGame.cpp:116)
==22737== by 0x786389: LoadingState::enter() (LoadingState.cpp:9)
==22737== by 0x75DC59: void StateManager::enter<LoadingState, RWGame*, RWGame::RWGame(Logger&, int, char**)::{lambda()#1}>(RWGame*&&, RWGame::RWGame(Logger&, int, char**)::{lambda()#1}&&) (StateManager.hpp:40)
==22737== by 0x758484: RWGame::RWGame(Logger&, int, char**) (RWGame.cpp:81)
==22737== by 0x747815: main (main.cpp:13)
2017-09-13 00:47:22 +02:00
|
|
|
"source/rw/forward.hpp"
|
2016-04-07 02:13:46 +02:00
|
|
|
"source/rw/types.hpp"
|
2016-04-09 02:28:33 +02:00
|
|
|
"source/rw/defines.hpp"
|
2016-04-07 02:13:46 +02:00
|
|
|
|
|
|
|
"source/platform/FileHandle.hpp"
|
|
|
|
"source/platform/FileIndex.hpp"
|
|
|
|
"source/platform/FileIndex.cpp"
|
|
|
|
|
2017-01-03 15:18:06 +01:00
|
|
|
"source/data/Clump.hpp"
|
|
|
|
"source/data/Clump.cpp"
|
2016-04-07 02:13:46 +02:00
|
|
|
|
|
|
|
"source/loaders/LoaderIMG.hpp"
|
|
|
|
"source/loaders/LoaderIMG.cpp"
|
|
|
|
"source/loaders/RWBinaryStream.hpp"
|
|
|
|
"source/loaders/LoaderDFF.hpp"
|
|
|
|
"source/loaders/LoaderDFF.cpp"
|
2016-05-30 23:06:28 +02:00
|
|
|
"source/loaders/LoaderSDT.hpp"
|
|
|
|
"source/loaders/LoaderSDT.cpp"
|
2016-04-07 02:13:46 +02:00
|
|
|
"source/loaders/LoaderTXD.hpp"
|
|
|
|
"source/loaders/LoaderTXD.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(rwlib
|
|
|
|
|
|
|
|
${RWLIB_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(
|
2016-08-04 02:09:47 +02:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/source"
|
|
|
|
"${Boost_INCLUDE_DIRS}")
|
2016-04-07 02:13:46 +02:00
|
|
|
|
|
|
|
target_include_directories(rwlib
|
|
|
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/source")
|
|
|
|
|
|
|
|
target_link_libraries(rwlib
|
|
|
|
${OPENGL_LIBRARIES}
|
2016-08-04 02:09:47 +02:00
|
|
|
${OPENRW_PLATFORM_LIBS}
|
|
|
|
${Boost_LIBRARIES})
|