diff --git a/.gitignore b/.gitignore index 4b6c996ae..2ef5fff44 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ openmw Ogre.log ogre.cfg build +plugins.cfg diff --git a/CMakeLists.txt b/CMakeLists.txt index 902eee023..9ddeaeff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,14 +7,31 @@ cmake_minimum_required(VERSION 2.6) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) # Local files + set(BSA bsa/bsa_archive.cpp bsa/bsa_file.cpp) +set(BSA_HEADER bsa/bsa_archive.hpp bsa/bsa_file.hpp) + set(NIF nif/nif_file.cpp nifogre/ogre_nif_loader.cpp) +set(NIF_HEADER nif/controlled.hpp nif/effect.hpp nif/nif_types.hpp nif/record.hpp + nif/controller.hpp nif/extra.hpp nif/node.hpp nif/record_ptr.hpp + nif/data.hpp nif/nif_file.hpp nif/property.hpp) + set(TOOLS tools/stringops.cpp tools/fileops.cpp) +set(TOOLS_HEADER tools/fileops.hpp tools/slice_array.hpp tools/stringops.hpp) + set(MANGLE_VFS mangle/vfs/servers/ogre_vfs.cpp) + set(OGRE ogre/renderer.cpp) +set(OGRE_HEADER ogre/renderer.hpp) + set(INPUT input/oismanager.cpp) +set(INPUT_HEADER input/oismanager.hpp input/listener.hpp) + set(GAME game/main.cpp game/esm_store/store.cpp game/cell_store.cpp) +set(GAME_HEADER game/cell_store.hpp game/esm_store/reclists.hpp game/esm_store/store.hpp) + set(GAMEREND game/render/mwscene.cpp) +set(GAMEREND_HEADER game/render/cell.hpp game/render/mwscene.hpp) # Platform specific if (WIN32) @@ -24,14 +41,39 @@ set(PLATFORM_INCLUDE_DIR "") endif (WIN32) # Dependencies + find_package(OGRE REQUIRED) find_package(Boost REQUIRED COMPONENTS system filesystem) find_package(OIS REQUIRED) -include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR}) +include_directories("." + ${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} + ${PLATFORM_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR}) +# Specify build paths + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${OpenMW_BINARY_DIR}") + +# Other files + +if (WIN32) +configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.win32 + "${OpenMW_BINARY_DIR}/plugins.cfg" COPYONLY) +else (WIN32) +configure_file(${OpenMW_SOURCE_DIR}/files/plugins.cfg.linux + "${OpenMW_BINARY_DIR}/plugins.cfg" COPYONLY) +endif (WIN32) + # Main executable -add_executable(openmw ${BSA} ${TOOLS} ${OGRE} ${INPUT} ${GAME} ${GAMEREND}) -target_link_libraries(openmw ${OGRE_LIBRARIES}) -target_link_libraries(openmw ${OIS_LIBRARIES}) -target_link_libraries(openmw ${Boost_LIBRARIES}) +add_executable(openmw + ${BSA} ${BSA_HEADER} + ${TOOLS} ${TOOLS_HEADER} + ${OGRE} ${OGRE_HEADER} + ${INPUT} ${INPUT_HEADER} + ${GAME} ${GAME_HEADER} + ${GAMEREND} ${GAMEREND_HEADER}) + +target_link_libraries(openmw + ${OGRE_LIBRARIES} + ${OIS_LIBRARIES} + ${Boost_LIBRARIES}) diff --git a/cmake/FindPkgMacros.cmake b/cmake/FindPkgMacros.cmake index 0e83c4e28..da3303ac5 100644 --- a/cmake/FindPkgMacros.cmake +++ b/cmake/FindPkgMacros.cmake @@ -129,8 +129,8 @@ MACRO(findpkg_framework fwk) /System/Library/Frameworks /Network/Library/Frameworks /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/ - ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release - ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug + ${CMAKE_CURRENT_SOURCE_DIR}/../lib/Release + ${CMAKE_CURRENT_SOURCE_DIR}/../lib/Debug ) FOREACH(dir ${${fwk}_FRAMEWORK_PATH}) SET(fwkpath ${dir}/${fwk}.framework) diff --git a/plugins.cfg.linux b/files/plugins.cfg.linux similarity index 100% rename from plugins.cfg.linux rename to files/plugins.cfg.linux diff --git a/plugins.cfg.win32 b/files/plugins.cfg.win32 similarity index 100% rename from plugins.cfg.win32 rename to files/plugins.cfg.win32 diff --git a/game/main.cpp b/game/main.cpp index 13fe736a5..34b961503 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -16,11 +16,7 @@ void maintest() const char* esmFile = "data/Morrowind.esm"; const char* bsaFile = "data/Morrowind.bsa"; -#ifdef _WIN32 - const char* plugCfg = "plugins.cfg.win32"; -#else - const char* plugCfg = "plugins.cfg.linux"; -#endif + const char* plugCfg = "plugins.cfg"; cout << "Hello, fellow traveler!\n"; diff --git a/game/render/mwscene.cpp b/game/render/mwscene.cpp index 6f7c78a41..cf4c9ef43 100644 --- a/game/render/mwscene.cpp +++ b/game/render/mwscene.cpp @@ -2,6 +2,13 @@ #include +#include "OgreRoot.h" +#include "OgreRenderWindow.h" +#include "OgreSceneManager.h" +#include "OgreViewport.h" +#include "OgreCamera.h" +#include "OgreTextureManager.h" + using namespace Render; using namespace Ogre; diff --git a/game/render/mwscene.hpp b/game/render/mwscene.hpp index b2b2c2b4f..47d13e328 100644 --- a/game/render/mwscene.hpp +++ b/game/render/mwscene.hpp @@ -3,6 +3,14 @@ #include "ogre/renderer.hpp" +namespace Ogre +{ + class Camera; + class Viewport; + class SceneManager; + class SceneNode; +} + namespace Render { /** Class responsible for Morrowind-specific interfaces to OGRE. diff --git a/input/listener.hpp b/input/listener.hpp index f5412e701..896c2b56a 100644 --- a/input/listener.hpp +++ b/input/listener.hpp @@ -4,7 +4,10 @@ #include "oismanager.hpp" #include "ogre/renderer.hpp" -#include +#include +#include + +//#include namespace Input { diff --git a/input/oismanager.cpp b/input/oismanager.cpp index b39b63eb5..a0174e834 100644 --- a/input/oismanager.cpp +++ b/input/oismanager.cpp @@ -2,12 +2,14 @@ #include #include #include +#include + +#include "OgreRenderWindow.h" using namespace Input; using namespace Ogre; using namespace OIS; -#include using namespace std; OISManager::OISManager(Render::OgreRenderer &rend) diff --git a/ogre/renderer.cpp b/ogre/renderer.cpp index d43109ff2..a7998596d 100644 --- a/ogre/renderer.cpp +++ b/ogre/renderer.cpp @@ -1,5 +1,10 @@ #include "renderer.hpp" +#include "OgreRoot.h" +#include "OgreRenderWindow.h" +#include "OgreLogManager.h" +#include "OgreLog.h" + using namespace Ogre; using namespace Render; diff --git a/ogre/renderer.hpp b/ogre/renderer.hpp index 7a67fb1d1..0739aa05a 100644 --- a/ogre/renderer.hpp +++ b/ogre/renderer.hpp @@ -5,9 +5,15 @@ Ogre renderer class */ -#include +#include #include +namespace Ogre +{ + class Root; + class RenderWindow; +} + namespace Render { class OgreRenderer