From 448f9f37c2fce0dde66f3f24e5ce705d73ef673e Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 22 Jun 2010 09:02:24 +0200 Subject: [PATCH 001/100] bug-fix: D-key was assigned twice --- game/mwinput/inputmanager.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/mwinput/inputmanager.hpp b/game/mwinput/inputmanager.hpp index 763d1a487..4c46f4411 100644 --- a/game/mwinput/inputmanager.hpp +++ b/game/mwinput/inputmanager.hpp @@ -70,7 +70,7 @@ namespace MWInput poller.bind(A_MoveLeft, KC_A); poller.bind(A_MoveRight, KC_D); poller.bind(A_MoveForward, KC_W); - poller.bind(A_MoveBackward, KC_D); + poller.bind(A_MoveBackward, KC_S); // Use shift and ctrl for up and down poller.bind(A_MoveUp, KC_LSHIFT); From 261af208cd4448171d8d6eb12cf7b17af03be520 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 25 Jun 2010 14:41:49 +0200 Subject: [PATCH 002/100] increased warning level for gcc; fixed code to remove resulting warnings (except mangle) --- CMakeLists.txt | 5 +++++ bsa/bsa_file.cpp | 4 ++-- esm/esm_reader.hpp | 6 +++--- game/mwrender/playerpos.hpp | 2 +- input/listener.hpp | 2 +- nif/data.hpp | 10 +++++----- nif/extra.hpp | 2 +- nif/nif_file.cpp | 2 +- nif/nif_file.hpp | 4 ++-- nif/property.hpp | 6 +++--- nif/record_ptr.hpp | 4 ++-- nifogre/ogre_nif_loader.cpp | 2 +- 12 files changed, 27 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16380bc26..268449e14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,11 @@ if (APPLE) ) endif (APPLE) +# Compiler settings +if (CMAKE_COMPILER_IS_GNUCC) + add_definitions (-Wall) +endif (CMAKE_COMPILER_IS_GNUCC) + # Main executable add_executable(openmw MACOSX_BUNDLE diff --git a/bsa/bsa_file.cpp b/bsa/bsa_file.cpp index 7a7600ad1..a6bf47848 100644 --- a/bsa/bsa_file.cpp +++ b/bsa/bsa_file.cpp @@ -129,7 +129,7 @@ void BSAFile::readHeader() // Set up the the FileStruct table files.resize(filenum); - for(int i=0;isecond; - assert(res >= 0 && res < files.size()); + assert(res >= 0 && res < static_cast (files.size())); return res; } } diff --git a/esm/esm_reader.hpp b/esm/esm_reader.hpp index 52f67fea0..85d956689 100644 --- a/esm/esm_reader.hpp +++ b/esm/esm_reader.hpp @@ -394,7 +394,7 @@ public: void getHExact(void*p, int size) { getSubHeader(); - if(size != c.leftSub) + if(size !=static_cast (c.leftSub)) fail("getHExact() size mismatch"); getExact(p,size); } @@ -480,7 +480,7 @@ public: void skipHSubSize(int size) { skipHSub(); - if(c.leftSub != size) + if(static_cast (c.leftSub) != size) fail("skipHSubSize() mismatch"); } @@ -508,7 +508,7 @@ public: void getSubHeaderIs(int size) { getSubHeader(); - if(size != c.leftSub) + if(size != static_cast (c.leftSub)) fail("getSubHeaderIs(): Sub header mismatch"); } diff --git a/game/mwrender/playerpos.hpp b/game/mwrender/playerpos.hpp index cf1d02092..47175651c 100644 --- a/game/mwrender/playerpos.hpp +++ b/game/mwrender/playerpos.hpp @@ -15,7 +15,7 @@ namespace MWRender public: PlayerPos(Ogre::Camera *cam) : - camera(cam), x(0), y(0), z(0) {} + x(0), y(0), z(0), camera(cam) {} // Set the player position. Uses Morrowind coordinates. void setPos(float _x, float _y, float _z) diff --git a/input/listener.hpp b/input/listener.hpp index 5b9d4fb49..ef4cce57f 100644 --- a/input/listener.hpp +++ b/input/listener.hpp @@ -17,7 +17,7 @@ namespace Input InputListener(Render::OgreRenderer &rend, Input::OISManager &input, const Input::Dispatcher &_disp) - : doExit(false), disp(_disp) + : disp(_disp), doExit(false) { // Set up component pointers mWindow = rend.getWindow(); diff --git a/nif/data.hpp b/nif/data.hpp index d7d233dff..920c7cf45 100644 --- a/nif/data.hpp +++ b/nif/data.hpp @@ -198,7 +198,7 @@ struct NiPosData : Record // translation in NiKeyframeData. for(int i=0; igetFloat(); + /*float time =*/ nif->getFloat(); nif->getVector(); // This isn't really shared between type 1 // and type 2, most likely if(type == 2) @@ -267,14 +267,14 @@ struct NiPixelData : Record mips = nif->getInt(); // Bytes per pixel, should be bpp * 8 - int bytes = nif->getInt(); + /*int bytes =*/ nif->getInt(); for(int i=0; igetInt(); - int y = nif->getInt(); - int offset = nif->getInt(); + /*int x =*/ nif->getInt(); + /*int y =*/ nif->getInt(); + /*int offset =*/ nif->getInt(); } // Skip the data diff --git a/nif/extra.hpp b/nif/extra.hpp index 64c512509..788fe3113 100644 --- a/nif/extra.hpp +++ b/nif/extra.hpp @@ -50,7 +50,7 @@ struct NiVertWeightsExtraData : Extra // We should have s*4+2 == i, for some reason. Might simply be the // size of the rest of the record, unhelpful as that may be. - int i = nif->getInt(); + /*int i =*/ nif->getInt(); int s = nif->getShort(); // number of vertices nif->getFloatLen(s); // vertex weights I guess diff --git a/nif/nif_file.cpp b/nif/nif_file.cpp index 0decd77e1..dc7fc2ed8 100644 --- a/nif/nif_file.cpp +++ b/nif/nif_file.cpp @@ -178,7 +178,7 @@ void NIFFile::parse() void NiSkinInstance::post(NIFFile *nif) { int bnum = bones.length(); - if(bnum != data->bones.size()) + if(bnum != static_cast (data->bones.size())) nif->fail("Mismatch in NiSkinData bone count"); root->makeRootBone(data->trafo); diff --git a/nif/nif_file.hpp b/nif/nif_file.hpp index a827758d4..a1c34b3bb 100644 --- a/nif/nif_file.hpp +++ b/nif/nif_file.hpp @@ -95,7 +95,7 @@ class NIFFile ~NIFFile() { - for(int i=0; i= 0 && index < records.size()); + assert(index >= 0 && index < static_cast (records.size())); Record *res = records[index]; assert(res != NULL); return res; diff --git a/nif/property.hpp b/nif/property.hpp index c17bcfe62..3500a25b7 100644 --- a/nif/property.hpp +++ b/nif/property.hpp @@ -122,9 +122,9 @@ struct NiTexturingProperty : Property if(textures[5].inUse) { // Ignore these at the moment - float lumaScale = nif->getFloat(); - float lumaOffset = nif->getFloat(); - const Vector4 *lumaMatrix = nif->getVector4(); + /*float lumaScale =*/ nif->getFloat(); + /*float lumaOffset =*/ nif->getFloat(); + /*const Vector4 *lumaMatrix =*/ nif->getVector4(); } textures[6].read(nif); // Decal } diff --git a/nif/record_ptr.hpp b/nif/record_ptr.hpp index 3011aaa17..c5618941e 100644 --- a/nif/record_ptr.hpp +++ b/nif/record_ptr.hpp @@ -118,13 +118,13 @@ class RecordListT X& operator[](int index) { - assert(index >= 0 && index < list.size()); + assert(index >= 0 && index < static_cast (list.size())); return list[index].get(); } bool has(int index) { - assert(index >= 0 && index < list.size()); + assert(index >= 0 && index < static_cast (list.size())); return !list[index].empty(); } diff --git a/nifogre/ogre_nif_loader.cpp b/nifogre/ogre_nif_loader.cpp index de00b443f..ba88e86ae 100644 --- a/nifogre/ogre_nif_loader.cpp +++ b/nifogre/ogre_nif_loader.cpp @@ -193,7 +193,7 @@ static void createMaterial(const String &name, if(!texName.empty()) { Pass *pass = material->getTechnique(0)->getPass(0); - TextureUnitState *txt = pass->createTextureUnitState(texName); + /*TextureUnitState *txt =*/ pass->createTextureUnitState(texName); /* As of yet UNTESTED code from Chris: pass->setTextureFiltering(Ogre::TFO_ANISOTROPIC); From 1d84b10b3ec24263151d25bc66410d846ca6d9d5 Mon Sep 17 00:00:00 2001 From: Nicolay Korslund Date: Fri, 25 Jun 2010 15:23:21 +0200 Subject: [PATCH 003/100] fixed more warning messages, updated mangle --- mangle | 2 +- nifogre/ogre_nif_loader.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mangle b/mangle index 6b0b7c95f..19649bfea 160000 --- a/mangle +++ b/mangle @@ -1 +1 @@ -Subproject commit 6b0b7c95f8a40a53b4c26d551d4fb5118deb7e12 +Subproject commit 19649bfeaa5a204cc765c7b0a66789919d6681d9 diff --git a/nifogre/ogre_nif_loader.cpp b/nifogre/ogre_nif_loader.cpp index ba88e86ae..3c4ac19e0 100644 --- a/nifogre/ogre_nif_loader.cpp +++ b/nifogre/ogre_nif_loader.cpp @@ -134,7 +134,8 @@ public: float maxZ() { return Z.max; } }; -// Conversion of blend / test mode from NIF -> OGRE. Not in use yet. +// Conversion of blend / test mode from NIF -> OGRE. +/* Not in use yet, so let's comment it out. static SceneBlendFactor getBlendFactor(int mode) { switch(mode) @@ -149,14 +150,15 @@ static SceneBlendFactor getBlendFactor(int mode) case 7: return SBF_ONE_MINUS_SOURCE_ALPHA; case 8: return SBF_DEST_ALPHA; case 9: return SBF_ONE_MINUS_DEST_ALPHA; - /* [Comment from Chris Robinson:] Can't handle this mode? :/ - case 10: return SBF_SOURCE_ALPHA_SATURATE; - */ + // [Comment from Chris Robinson:] Can't handle this mode? :/ + // case 10: return SBF_SOURCE_ALPHA_SATURATE; default: return SBF_SOURCE_ALPHA; } } +*/ +/* This is also unused static CompareFunction getTestMode(int mode) { switch(mode) @@ -173,6 +175,7 @@ static CompareFunction getTestMode(int mode) return CMPF_ALWAYS_PASS; } } +*/ static void createMaterial(const String &name, const Vector &ambient, From e4f85cb3e680f539f269c068b7afe86bee752399 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 25 Jun 2010 22:28:59 +0200 Subject: [PATCH 004/100] directory structure reorganisation (still missing the mangle stuff) --- CMakeLists.txt | 109 ++++++++++-------- {game => apps/openmw}/engine.cpp | 40 +++---- {game => apps/openmw}/engine.hpp | 14 +-- {game => apps/openmw}/main.cpp | 0 .../openmw}/mwinput/inputmanager.hpp | 12 +- {game => apps/openmw}/mwrender/.gitignore | 0 {game => apps/openmw}/mwrender/cell.cpp | 20 ++-- {game => apps/openmw}/mwrender/cell.hpp | 0 {game => apps/openmw}/mwrender/interior.cpp | 40 +++---- {game => apps/openmw}/mwrender/interior.hpp | 38 +++--- {game => apps/openmw}/mwrender/mwscene.cpp | 0 {game => apps/openmw}/mwrender/mwscene.hpp | 2 +- {game => apps/openmw}/mwrender/playerpos.hpp | 0 {bsa => components/bsa}/bsa_archive.cpp | 4 +- {bsa => components/bsa}/bsa_archive.hpp | 0 {bsa => components/bsa}/bsa_file.cpp | 6 +- {bsa => components/bsa}/bsa_file.hpp | 2 +- {bsa => components/bsa}/tests/.gitignore | 0 {bsa => components/bsa}/tests/Makefile | 0 .../bsa}/tests/bsa_file_test.cpp | 0 {bsa => components/bsa}/tests/bsatool.cpp | 0 {bsa => components/bsa}/tests/bsatool.ggo | 0 {bsa => components/bsa}/tests/bsatool_cmd.c | 0 {bsa => components/bsa}/tests/bsatool_cmd.h | 0 .../bsa}/tests/ogre_archive_test.cpp | 0 .../bsa}/tests/output/bsa_file_test.out | 0 .../bsa}/tests/output/ogre_archive_test.out | 0 {bsa => components/bsa}/tests/test.sh | 0 .../engine/input}/dispatch_map.hpp | 0 .../engine/input}/dispatcher.hpp | 0 .../engine/input}/func_binder.hpp | 0 .../engine/input}/listener.hpp | 2 +- .../engine/input}/oismanager.cpp | 0 .../engine/input}/oismanager.hpp | 2 +- {input => components/engine/input}/poller.hpp | 0 .../engine/input}/tests/.gitignore | 0 .../engine/input}/tests/Makefile | 0 .../engine/input}/tests/dispatch_map_test.cpp | 0 .../engine/input}/tests/funcbind_test.cpp | 0 .../input}/tests/output/dispatch_map_test.out | 0 .../input}/tests/output/funcbind_test.out | 0 .../engine/input}/tests/test.sh | 0 {ogre => components/engine/ogre}/.gitignore | 0 {ogre => components/engine/ogre}/renderer.cpp | 0 {ogre => components/engine/ogre}/renderer.hpp | 0 {esm => components/esm}/.gitignore | 0 {esm => components/esm}/defs.hpp | 0 {esm => components/esm}/esm_reader.hpp | 8 +- {esm => components/esm}/loadacti.hpp | 0 {esm => components/esm}/loadalch.hpp | 0 {esm => components/esm}/loadappa.hpp | 0 {esm => components/esm}/loadarmo.hpp | 0 {esm => components/esm}/loadbody.hpp | 0 {esm => components/esm}/loadbook.hpp | 0 {esm => components/esm}/loadbsgn.hpp | 0 {esm => components/esm}/loadcell.hpp | 0 {esm => components/esm}/loadclas.hpp | 0 {esm => components/esm}/loadclot.hpp | 0 {esm => components/esm}/loadcont.hpp | 0 {esm => components/esm}/loadcrea.hpp | 0 {esm => components/esm}/loadcrec.hpp | 0 {esm => components/esm}/loaddial.hpp | 0 {esm => components/esm}/loaddoor.hpp | 0 {esm => components/esm}/loadench.hpp | 0 {esm => components/esm}/loadfact.hpp | 0 {esm => components/esm}/loadglob.hpp | 0 {esm => components/esm}/loadgmst.hpp | 0 {esm => components/esm}/loadinfo.hpp | 0 {esm => components/esm}/loadingr.hpp | 0 {esm => components/esm}/loadland.hpp | 0 {esm => components/esm}/loadlevlist.hpp | 0 {esm => components/esm}/loadligh.hpp | 0 {esm => components/esm}/loadlocks.hpp | 0 {esm => components/esm}/loadltex.hpp | 0 {esm => components/esm}/loadmgef.hpp | 0 {esm => components/esm}/loadmisc.hpp | 0 {esm => components/esm}/loadnpc.hpp | 0 {esm => components/esm}/loadnpcc.hpp | 0 {esm => components/esm}/loadpgrd.hpp | 0 {esm => components/esm}/loadrace.hpp | 0 {esm => components/esm}/loadregn.hpp | 0 {esm => components/esm}/loadscpt.hpp | 0 {esm => components/esm}/loadskil.hpp | 0 {esm => components/esm}/loadsndg.hpp | 0 {esm => components/esm}/loadsoun.hpp | 0 {esm => components/esm}/loadspel.hpp | 0 {esm => components/esm}/loadsscr.hpp | 0 {esm => components/esm}/loadstat.hpp | 0 {esm => components/esm}/loadweap.hpp | 0 {esm => components/esm}/records.hpp | 0 {esm => components/esm}/tests/.gitignore | 0 {esm => components/esm}/tests/Makefile | 0 {esm => components/esm}/tests/esmtool.cpp | 0 {esm => components/esm}/tests/esmtool.ggo | 0 {esm => components/esm}/tests/esmtool_cmd.c | 0 {esm => components/esm}/tests/esmtool_cmd.h | 0 .../esm_store}/cell_store.cpp | 4 +- .../esm_store}/cell_store.hpp | 10 +- .../esm_store}/reclists.hpp | 2 +- {esm_store => components/esm_store}/store.cpp | 0 {esm_store => components/esm_store}/store.hpp | 2 +- {tools => components/misc}/fileops.cpp | 0 {tools => components/misc}/fileops.hpp | 0 {tools => components/misc}/slice_array.hpp | 0 {tools => components/misc}/stringops.cpp | 0 {tools => components/misc}/stringops.hpp | 0 {tools => components/misc}/tests/.gitignore | 0 {tools => components/misc}/tests/Makefile | 0 .../misc}/tests/output/slice_test.out | 0 .../misc}/tests/output/strops_test.out | 0 .../misc}/tests/slice_test.cpp | 0 .../misc}/tests/strops_test.cpp | 0 {nif => components/misc}/tests/test.sh | 0 {nif => components/nif}/.gitignore | 0 {nif => components/nif}/controlled.hpp | 0 {nif => components/nif}/controller.hpp | 0 {nif => components/nif}/data.hpp | 0 {nif => components/nif}/effect.hpp | 0 {nif => components/nif}/extra.hpp | 0 {nif => components/nif}/nif_file.cpp | 2 +- {nif => components/nif}/nif_file.hpp | 8 +- {nif => components/nif}/nif_types.hpp | 0 {nif => components/nif}/node.hpp | 0 {nif => components/nif}/property.hpp | 0 {nif => components/nif}/record.hpp | 0 {nif => components/nif}/record_ptr.hpp | 0 {nif => components/nif}/tests/.gitignore | 0 {nif => components/nif}/tests/Makefile | 0 .../nif}/tests/nif_bsa_test.cpp | 0 {nif => components/nif}/tests/niftool.cpp | 0 .../nif}/tests/output/nif_bsa_test.out | 0 {nifogre => components/nif}/tests/test.sh | 0 .../nifogre}/ogre_nif_loader.cpp | 12 +- .../nifogre}/ogre_nif_loader.hpp | 0 .../nifogre}/tests/.gitignore | 0 .../nifogre}/tests/Makefile | 0 .../nifogre}/tests/ogre_common.cpp | 0 .../tests/ogre_manualresource_test.cpp | 0 .../nifogre}/tests/ogre_mesh_common.cpp | 0 .../nifogre}/tests/ogre_nif_test.cpp | 0 .../nifogre}/tests/ogre_skeleton_test.cpp | 0 .../tests/output/ogre_manualresource_test.out | 0 .../nifogre}/tests/output/ogre_nif_test.out | 0 .../tests/output/ogre_skeleton_test.out | 0 .../nifogre}/tests/plugins.cfg | 0 {tools => components/nifogre}/tests/test.sh | 0 {platform => libs/platform}/stdint.h | 0 {platform => libs/platform}/strings.h | 0 148 files changed, 174 insertions(+), 165 deletions(-) rename {game => apps/openmw}/engine.cpp (89%) rename {game => apps/openmw}/engine.hpp (94%) rename {game => apps/openmw}/main.cpp (100%) rename {game => apps/openmw}/mwinput/inputmanager.hpp (93%) rename {game => apps/openmw}/mwrender/.gitignore (100%) rename {game => apps/openmw}/mwrender/cell.cpp (95%) rename {game => apps/openmw}/mwrender/cell.hpp (100%) rename {game => apps/openmw}/mwrender/interior.cpp (97%) rename {game => apps/openmw}/mwrender/interior.hpp (90%) rename {game => apps/openmw}/mwrender/mwscene.cpp (100%) rename {game => apps/openmw}/mwrender/mwscene.hpp (95%) rename {game => apps/openmw}/mwrender/playerpos.hpp (100%) rename {bsa => components/bsa}/bsa_archive.cpp (97%) rename {bsa => components/bsa}/bsa_archive.hpp (100%) rename {bsa => components/bsa}/bsa_file.cpp (96%) rename {bsa => components/bsa}/bsa_file.hpp (98%) rename {bsa => components/bsa}/tests/.gitignore (100%) rename {bsa => components/bsa}/tests/Makefile (100%) rename {bsa => components/bsa}/tests/bsa_file_test.cpp (100%) rename {bsa => components/bsa}/tests/bsatool.cpp (100%) rename {bsa => components/bsa}/tests/bsatool.ggo (100%) rename {bsa => components/bsa}/tests/bsatool_cmd.c (100%) rename {bsa => components/bsa}/tests/bsatool_cmd.h (100%) rename {bsa => components/bsa}/tests/ogre_archive_test.cpp (100%) rename {bsa => components/bsa}/tests/output/bsa_file_test.out (100%) rename {bsa => components/bsa}/tests/output/ogre_archive_test.out (100%) rename {bsa => components/bsa}/tests/test.sh (100%) rename {input => components/engine/input}/dispatch_map.hpp (100%) rename {input => components/engine/input}/dispatcher.hpp (100%) rename {input => components/engine/input}/func_binder.hpp (100%) rename {input => components/engine/input}/listener.hpp (98%) rename {input => components/engine/input}/oismanager.cpp (100%) rename {input => components/engine/input}/oismanager.hpp (85%) rename {input => components/engine/input}/poller.hpp (100%) rename {input => components/engine/input}/tests/.gitignore (100%) rename {input => components/engine/input}/tests/Makefile (100%) rename {input => components/engine/input}/tests/dispatch_map_test.cpp (100%) rename {input => components/engine/input}/tests/funcbind_test.cpp (100%) rename {input => components/engine/input}/tests/output/dispatch_map_test.out (100%) rename {input => components/engine/input}/tests/output/funcbind_test.out (100%) rename {input => components/engine/input}/tests/test.sh (100%) rename {ogre => components/engine/ogre}/.gitignore (100%) rename {ogre => components/engine/ogre}/renderer.cpp (100%) rename {ogre => components/engine/ogre}/renderer.hpp (100%) rename {esm => components/esm}/.gitignore (100%) rename {esm => components/esm}/defs.hpp (100%) rename {esm => components/esm}/esm_reader.hpp (98%) rename {esm => components/esm}/loadacti.hpp (100%) rename {esm => components/esm}/loadalch.hpp (100%) rename {esm => components/esm}/loadappa.hpp (100%) rename {esm => components/esm}/loadarmo.hpp (100%) rename {esm => components/esm}/loadbody.hpp (100%) rename {esm => components/esm}/loadbook.hpp (100%) rename {esm => components/esm}/loadbsgn.hpp (100%) rename {esm => components/esm}/loadcell.hpp (100%) rename {esm => components/esm}/loadclas.hpp (100%) rename {esm => components/esm}/loadclot.hpp (100%) rename {esm => components/esm}/loadcont.hpp (100%) rename {esm => components/esm}/loadcrea.hpp (100%) rename {esm => components/esm}/loadcrec.hpp (100%) rename {esm => components/esm}/loaddial.hpp (100%) rename {esm => components/esm}/loaddoor.hpp (100%) rename {esm => components/esm}/loadench.hpp (100%) rename {esm => components/esm}/loadfact.hpp (100%) rename {esm => components/esm}/loadglob.hpp (100%) rename {esm => components/esm}/loadgmst.hpp (100%) rename {esm => components/esm}/loadinfo.hpp (100%) rename {esm => components/esm}/loadingr.hpp (100%) rename {esm => components/esm}/loadland.hpp (100%) rename {esm => components/esm}/loadlevlist.hpp (100%) rename {esm => components/esm}/loadligh.hpp (100%) rename {esm => components/esm}/loadlocks.hpp (100%) rename {esm => components/esm}/loadltex.hpp (100%) rename {esm => components/esm}/loadmgef.hpp (100%) rename {esm => components/esm}/loadmisc.hpp (100%) rename {esm => components/esm}/loadnpc.hpp (100%) rename {esm => components/esm}/loadnpcc.hpp (100%) rename {esm => components/esm}/loadpgrd.hpp (100%) rename {esm => components/esm}/loadrace.hpp (100%) rename {esm => components/esm}/loadregn.hpp (100%) rename {esm => components/esm}/loadscpt.hpp (100%) rename {esm => components/esm}/loadskil.hpp (100%) rename {esm => components/esm}/loadsndg.hpp (100%) rename {esm => components/esm}/loadsoun.hpp (100%) rename {esm => components/esm}/loadspel.hpp (100%) rename {esm => components/esm}/loadsscr.hpp (100%) rename {esm => components/esm}/loadstat.hpp (100%) rename {esm => components/esm}/loadweap.hpp (100%) rename {esm => components/esm}/records.hpp (100%) rename {esm => components/esm}/tests/.gitignore (100%) rename {esm => components/esm}/tests/Makefile (100%) rename {esm => components/esm}/tests/esmtool.cpp (100%) rename {esm => components/esm}/tests/esmtool.ggo (100%) rename {esm => components/esm}/tests/esmtool_cmd.c (100%) rename {esm => components/esm}/tests/esmtool_cmd.h (100%) rename {esm_store => components/esm_store}/cell_store.cpp (98%) rename {esm_store => components/esm_store}/cell_store.hpp (95%) rename {esm_store => components/esm_store}/reclists.hpp (98%) rename {esm_store => components/esm_store}/store.cpp (100%) rename {esm_store => components/esm_store}/store.hpp (99%) rename {tools => components/misc}/fileops.cpp (100%) rename {tools => components/misc}/fileops.hpp (100%) rename {tools => components/misc}/slice_array.hpp (100%) rename {tools => components/misc}/stringops.cpp (100%) rename {tools => components/misc}/stringops.hpp (100%) rename {tools => components/misc}/tests/.gitignore (100%) rename {tools => components/misc}/tests/Makefile (100%) rename {tools => components/misc}/tests/output/slice_test.out (100%) rename {tools => components/misc}/tests/output/strops_test.out (100%) rename {tools => components/misc}/tests/slice_test.cpp (100%) rename {tools => components/misc}/tests/strops_test.cpp (100%) rename {nif => components/misc}/tests/test.sh (100%) rename {nif => components/nif}/.gitignore (100%) rename {nif => components/nif}/controlled.hpp (100%) rename {nif => components/nif}/controller.hpp (100%) rename {nif => components/nif}/data.hpp (100%) rename {nif => components/nif}/effect.hpp (100%) rename {nif => components/nif}/extra.hpp (100%) rename {nif => components/nif}/nif_file.cpp (99%) rename {nif => components/nif}/nif_file.hpp (95%) rename {nif => components/nif}/nif_types.hpp (100%) rename {nif => components/nif}/node.hpp (100%) rename {nif => components/nif}/property.hpp (100%) rename {nif => components/nif}/record.hpp (100%) rename {nif => components/nif}/record_ptr.hpp (100%) rename {nif => components/nif}/tests/.gitignore (100%) rename {nif => components/nif}/tests/Makefile (100%) rename {nif => components/nif}/tests/nif_bsa_test.cpp (100%) rename {nif => components/nif}/tests/niftool.cpp (100%) rename {nif => components/nif}/tests/output/nif_bsa_test.out (100%) rename {nifogre => components/nif}/tests/test.sh (100%) rename {nifogre => components/nifogre}/ogre_nif_loader.cpp (99%) rename {nifogre => components/nifogre}/ogre_nif_loader.hpp (100%) rename {nifogre => components/nifogre}/tests/.gitignore (100%) rename {nifogre => components/nifogre}/tests/Makefile (100%) rename {nifogre => components/nifogre}/tests/ogre_common.cpp (100%) rename {nifogre => components/nifogre}/tests/ogre_manualresource_test.cpp (100%) rename {nifogre => components/nifogre}/tests/ogre_mesh_common.cpp (100%) rename {nifogre => components/nifogre}/tests/ogre_nif_test.cpp (100%) rename {nifogre => components/nifogre}/tests/ogre_skeleton_test.cpp (100%) rename {nifogre => components/nifogre}/tests/output/ogre_manualresource_test.out (100%) rename {nifogre => components/nifogre}/tests/output/ogre_nif_test.out (100%) rename {nifogre => components/nifogre}/tests/output/ogre_skeleton_test.out (100%) rename {nifogre => components/nifogre}/tests/plugins.cfg (100%) rename {tools => components/nifogre}/tests/test.sh (100%) rename {platform => libs/platform}/stdint.h (100%) rename {platform => libs/platform}/strings.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 268449e14..1de408bb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,62 +6,78 @@ cmake_minimum_required(VERSION 2.6) # Add path for CMake scripts set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) -# Local files +# source directory: apps -set(BSA bsa/bsa_archive.cpp bsa/bsa_file.cpp) -set(BSA_HEADER bsa/bsa_archive.hpp bsa/bsa_file.hpp) +set(GAME apps/openmw/main.cpp apps/openmw/engine.cpp) +set(GAME_HEADER apps/openmw/mwinput/inputmanager.hpp apps/openmw/engine.hpp) +source_group(game FILES ${GAME} ${GAME_HEADER}) + +set(GAMEREND apps/openmw/mwrender/mwscene.cpp apps/openmw/mwrender/cell.cpp + apps/openmw/mwrender/interior.cpp) +set(GAMEREND_HEADER apps/openmw/mwrender/cell.hpp apps/openmw/mwrender/mwscene.hpp + apps/openmw/mwrender/interior.hpp apps/openmw/mwrender/playerpos.hpp) +source_group(game_renderer FILES ${GAMEREND} ${GAMEREND_HEADER}) + +# set(GAMEINPUT) +set(GAMEINPUT_HEADER apps/openmw/mwinput/inputmanager.hpp) +source_group(game_input FILES ${GAMEINPUT} ${GAMEINPUT_HEADER}) + +set(APPS ${GAME} ${GAMEREND} ${GAMEINPUT}) +set(APPS_HEADER ${GAME_HEADER} ${GAMEREND_HEADER} ${GAMEINPUT_HEADER}) + +# source directory: components + +set(BSA components/bsa/bsa_archive.cpp components/bsa/bsa_file.cpp) +set(BSA_HEADER components/bsa/bsa_archive.hpp components/bsa/bsa_file.hpp) source_group(bsa FILES ${BSA} ${BSA_HEADER}) -set(NIF nif/nif_file.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(NIF components/nif/nif_file.cpp) +set(NIF_HEADER components/nif/controlled.hpp components/nif/effect.hpp + components/nif/nif_types.hpp components/nif/record.hpp + components/nif/controller.hpp components/nif/extra.hpp components/nif/node.hpp + components/nif/record_ptr.hpp + components/nif/data.hpp components/nif/nif_file.hpp components/nif/property.hpp) source_group(nif FILES ${NIF} ${NIF_HEADER}) -set(NIFOGRE nifogre/ogre_nif_loader.cpp) -set(NIFOGRE_HEADER nifogre/ogre_nif_loader.hpp) +set(NIFOGRE components/nifogre/ogre_nif_loader.cpp) +set(NIFOGRE_HEADER components/nifogre/ogre_nif_loader.hpp) source_group(nifogre FILES ${NIFOGRE} ${NIFOGRE_HEADER}) -set(TOOLS tools/stringops.cpp tools/fileops.cpp) -set(TOOLS_HEADER tools/fileops.hpp tools/slice_array.hpp tools/stringops.hpp) -source_group(tools FILES ${TOOLS} ${TOOLS_HEADER}) +set(ESM_STORE components/esm_store/store.cpp components/esm_store/cell_store.cpp) +set(ESM_STORE_HEADER components/esm_store/cell_store.hpp + components/esm_store/reclists.hpp components/esm_store/store.hpp) +source_group(esm_store FILES ${ESM_STORE} ${ESM_STORE_HEADER}) -set(MANGLE_VFS mangle/vfs/servers/ogre_vfs.cpp) -source_group(mangle_vfs FILES ${MANGLE_VFS}) +file(GLOB ESM_HEADER components/esm/*.hpp) +source_group(esm_header FILES ${ESM_HEADER}) -set(OGRE ogre/renderer.cpp) -set(OGRE_HEADER ogre/renderer.hpp) +set(OGRE components/engine/ogre/renderer.cpp) +set(OGRE_HEADER components/engine/ogre/renderer.hpp) source_group(ogre FILES ${OGRE} ${OGRE_HEADER}) -set(INPUT input/oismanager.cpp) -set(INPUT_HEADER input/oismanager.hpp input/listener.hpp input/func_binder.hpp input/dispatch_map.hpp input/dispatcher.hpp input/poller.hpp) +set(INPUT components/engine/input/oismanager.cpp) +set(INPUT_HEADER components/engine/input/oismanager.hpp components/engine/input/listener.hpp + components/engine/input/func_binder.hpp components/engine/input/dispatch_map.hpp + components/engine/input/dispatcher.hpp components/engine/input/poller.hpp) source_group(input FILES ${INPUT} ${INPUT_HEADER}) -set(GAME game/main.cpp game/engine.cpp) -set(GAME_HEADER game/mwinput/inputmanager.hpp game/engine.hpp) -source_group(game FILES ${GAME} ${GAME_HEADER}) +set(MISC components/misc/stringops.cpp components/misc/fileops.cpp) +set(MISC_HEADER components/misc/fileops.hpp components/misc/slice_array.hpp + components/misc/stringops.hpp) +source_group(misc FILES ${MISC} ${MISC_HEADER}) -set(ESM_STORE esm_store/store.cpp esm_store/cell_store.cpp) -set(ESM_STORE_HEADER esm_store/cell_store.hpp esm_store/reclists.hpp esm_store/store.hpp) -source_group(esm_store FILES ${ESM_STORE} ${ESM_STORE_HEADER}) +set(COMPONENTS ${BSA} ${NIF} ${NIFOGRE} ${ESM_STORE} ${OGRE} ${INPUT} ${MISC}) +set(COMPONENTS_HEADER ${BSA_HEADER} ${NIF_HEADER} ${NIFOGRE_HEADER} ${ESM_STORE_HEADER} + ${ESM_HEADER} ${OGRE_HEADER} ${INPUT_HEADER} ${MISC_HEADER}) + +# source directory: libs -set(GAMEREND game/mwrender/mwscene.cpp game/mwrender/cell.cpp game/mwrender/interior.cpp) -set(GAMEREND_HEADER game/mwrender/cell.hpp game/mwrender/mwscene.hpp - game/mwrender/interior.hpp game/mwrender/playerpos.hpp) -source_group(game_renderer FILES ${GAMEREND} ${GAMEREND_HEADER}) - -set(ESM_HEADER esm/defs.hpp esm/loadcell.hpp esm/loadfact.hpp esm/loadltex.hpp - esm/loadskil.hpp - esm/esm_reader.hpp esm/loadclas.hpp esm/loadglob.hpp esm/loadmgef.hpp esm/loadsndg.hpp - esm/loadacti.hpp esm/loadclot.hpp esm/loadgmst.hpp esm/loadmisc.hpp esm/loadsoun.hpp - esm/loadalch.hpp esm/loadcont.hpp esm/loadinfo.hpp esm/loadnpcc.hpp esm/loadspel.hpp - esm/loadappa.hpp esm/loadcrea.hpp esm/loadingr.hpp esm/loadnpc.hpp esm/loadsscr.hpp - esm/loadarmo.hpp esm/loadcrec.hpp esm/loadland.hpp esm/loadpgrd.hpp esm/loadstat.hpp - esm/loadbody.hpp esm/loaddial.hpp esm/loadlevlist.hpp esm/loadrace.hpp esm/loadweap.hpp - esm/loadbook.hpp esm/loaddoor.hpp esm/loadligh.hpp esm/loadregn.hpp esm/records.hpp - esm/loadbsgn.hpp esm/loadench.hpp esm/loadlocks.hpp esm/loadscpt.hpp) -source_group(esm_header FILES ${ESM_HEADER}) +set(MANGLE_VFS libs/mangle/vfs/servers/ogre_vfs.cpp) +source_group(mangle_vfs FILES ${MANGLE_VFS}) +set(OPENMW_LIBS ${MANGLE_VFS}) +set(OPENMW_LIBS_HEADER) + # Platform specific if (WIN32) set(PLATFORM_INCLUDE_DIR "platform") @@ -111,16 +127,9 @@ endif (CMAKE_COMPILER_IS_GNUCC) # Main executable add_executable(openmw MACOSX_BUNDLE - ${BSA} ${BSA_HEADER} - ${TOOLS} ${TOOLS_HEADER} - ${OGRE} ${OGRE_HEADER} - ${INPUT} ${INPUT_HEADER} - ${NIF} ${NIF_HEADER} - ${NIFOGRE} ${NIFOGRE_HEADER} - ${MANGLE_VFS} - ${GAME} - ${ESM_STORE} ${ESM_STORE_HEADER} - ${GAMEREND} ${GAMEREND_HEADER} + ${COMPONENTS} ${COMPONENTS_HEADER} + ${OPENMW_LIBS} ${OPENMW_LIBS_HEADER} + ${APPS} ${APPS_HEADER} ${ESM_HEADER} ${APPLE_BUNDLE_RESOURCES} ) diff --git a/game/engine.cpp b/apps/openmw/engine.cpp similarity index 89% rename from game/engine.cpp rename to apps/openmw/engine.cpp index e23f8272a..06d80bcc1 100644 --- a/game/engine.cpp +++ b/apps/openmw/engine.cpp @@ -4,14 +4,14 @@ #include -#include "esm_store/cell_store.hpp" -#include "bsa/bsa_archive.hpp" -#include "ogre/renderer.hpp" -#include "tools/fileops.hpp" +#include "components/esm_store/cell_store.hpp" +#include "components/bsa/bsa_archive.hpp" +#include "components/engine/ogre/renderer.hpp" +#include "components/misc/fileops.hpp" -#include "mwrender/interior.hpp" +#include "apps/openmw/mwrender/interior.hpp" #include "mwinput/inputmanager.hpp" -#include "mwrender/playerpos.hpp" +#include "apps/openmw/mwrender/playerpos.hpp" OMW::Engine::Engine() {} @@ -20,29 +20,29 @@ OMW::Engine::Engine() {} void OMW::Engine::prepareMaster() { std::string::size_type sep = mMaster.find_last_of ("."); - + if (sep==std::string::npos) { mMaster += ".esm"; } } - + // Load all BSA files in data directory. void OMW::Engine::loadBSA() { boost::filesystem::directory_iterator end; - + for (boost::filesystem::directory_iterator iter (mDataDir); iter!=end; ++iter) { if (boost::filesystem::extension (iter->path())==".bsa") { std::cout << "Adding " << iter->path().string() << std::endl; - addBSA(iter->path().file_string()); + addBSA(iter->path().file_string()); } } } - + // add resources directory // \note This function works recursively. @@ -50,8 +50,8 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path) { mOgre.getRoot()->addResourceLocation (path.file_string(), "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true); -} - +} + // Set data dir void OMW::Engine::setDataDir (const boost::filesystem::path& dataDir) @@ -83,9 +83,9 @@ void OMW::Engine::go() assert (!mDataDir.empty()); assert (!mCellName.empty()); assert (!mMaster.empty()); - + std::cout << "Hello, fellow traveler!\n"; - + std::cout << "Your data directory for today is: " << mDataDir << "\n"; std::cout << "Initializing OGRE\n"; @@ -93,16 +93,16 @@ void OMW::Engine::go() const char* plugCfg = "plugins.cfg"; mOgre.configure(!isFile("ogre.cfg"), plugCfg, false); - + addResourcesDirectory (mDataDir / "Meshes"); addResourcesDirectory (mDataDir / "Textures"); - + prepareMaster(); loadBSA(); - + boost::filesystem::path masterPath (mDataDir); masterPath /= mMaster; - + std::cout << "Loading ESM " << masterPath.string() << "\n"; ESM::ESMReader esm; ESMS::ESMStore store; @@ -141,6 +141,6 @@ void OMW::Engine::go() // Start the main rendering loop mOgre.start(); - std::cout << "\nThat's all for now!\n"; + std::cout << "\nThat's all for now!\n"; } diff --git a/game/engine.hpp b/apps/openmw/engine.hpp similarity index 94% rename from game/engine.hpp rename to apps/openmw/engine.hpp index fb6ddbbe4..dbe70b4d8 100644 --- a/game/engine.hpp +++ b/apps/openmw/engine.hpp @@ -5,7 +5,7 @@ #include -#include "mwrender/mwscene.hpp" +#include "apps/openmw/mwrender/mwscene.hpp" namespace OMW { @@ -17,21 +17,21 @@ namespace OMW Render::OgreRenderer mOgre; std::string mCellName; std::string mMaster; - + // not implemented Engine (const Engine&); Engine& operator= (const Engine&); - + /// adjust name and load bsa void prepareMaster(); - + /// add resources directory /// \note This function works recursively. void addResourcesDirectory (const boost::filesystem::path& path); - + /// Load all BSA files in data directory. void loadBSA(); - + public: Engine(); @@ -41,7 +41,7 @@ namespace OMW /// Set start cell name (only interiors for now) void setCell (const std::string& cellName); - + /// Set master file (esm) /// - If the given name does not have an extension, ".esm" is added automatically /// - Currently OpenMW only supports one master at the same time. diff --git a/game/main.cpp b/apps/openmw/main.cpp similarity index 100% rename from game/main.cpp rename to apps/openmw/main.cpp diff --git a/game/mwinput/inputmanager.hpp b/apps/openmw/mwinput/inputmanager.hpp similarity index 93% rename from game/mwinput/inputmanager.hpp rename to apps/openmw/mwinput/inputmanager.hpp index 5c2c9857f..d753eee84 100644 --- a/game/mwinput/inputmanager.hpp +++ b/apps/openmw/mwinput/inputmanager.hpp @@ -1,12 +1,12 @@ #ifndef _MWINPUT_MWINPUTMANAGER_H #define _MWINPUT_MWINPUTMANAGER_H -#include "input/listener.hpp" -#include "input/dispatcher.hpp" -#include "input/poller.hpp" +#include "components/engine/input/listener.hpp" +#include "components/engine/input/dispatcher.hpp" +#include "components/engine/input/poller.hpp" #include "boost/bind.hpp" -#include "game/mwrender/playerpos.hpp" -#include "platform/strings.h" +#include "apps/openmw/mwrender/playerpos.hpp" +#include "libs/platform/strings.h" namespace MWInput { @@ -47,7 +47,7 @@ namespace MWInput { // Find the first unused filename. // - char buf[50]; + char buf[50]; do { snprintf(buf, 50, "screenshot%03d.png", shotCount++); diff --git a/game/mwrender/.gitignore b/apps/openmw/mwrender/.gitignore similarity index 100% rename from game/mwrender/.gitignore rename to apps/openmw/mwrender/.gitignore diff --git a/game/mwrender/cell.cpp b/apps/openmw/mwrender/cell.cpp similarity index 95% rename from game/mwrender/cell.cpp rename to apps/openmw/mwrender/cell.cpp index 396e24cf5..912418459 100644 --- a/game/mwrender/cell.cpp +++ b/apps/openmw/mwrender/cell.cpp @@ -2,11 +2,11 @@ #include -#include "esm_store/cell_store.hpp" +#include "components/esm_store/cell_store.hpp" using namespace MWRender; -template +template void insertObj(CellRender& cellRender, const T& liveRef) { assert (liveRef.base != NULL); @@ -18,8 +18,8 @@ void insertObj(CellRender& cellRender, const T& liveRef) cellRender.insertEnd(); } } - -template<> + +template<> void insertObj(CellRender& cellRender, const ESMS::LiveCellRef& liveRef) { assert (liveRef.base != NULL); @@ -27,9 +27,9 @@ void insertObj(CellRender& cellRender, const ESMS::LiveCellRef& live if(!model.empty()) { cellRender.insertBegin (liveRef.ref); - + cellRender.insertMesh ("meshes\\" + model); - + // Extract the color and convert to floating point const int color = liveRef.base->data.color; const float r = ((color >> 0) & 0xFF) / 255.0f; @@ -37,9 +37,9 @@ void insertObj(CellRender& cellRender, const ESMS::LiveCellRef& live const float b = ((color >> 16) & 0xFF) / 255.0f; const float radius = float(liveRef.base->data.radius); cellRender.insertLight(r, g, b, radius); - + cellRender.insertEnd(); - } + } } template @@ -49,8 +49,8 @@ void insertCellRefList (CellRender& cellRender, const T& cellRefList) it != cellRefList.list.end(); it++) { insertObj (cellRender, *it); - } -} + } +} void CellRender::insertCell(const ESMS::CellStore &cell) { diff --git a/game/mwrender/cell.hpp b/apps/openmw/mwrender/cell.hpp similarity index 100% rename from game/mwrender/cell.hpp rename to apps/openmw/mwrender/cell.hpp diff --git a/game/mwrender/interior.cpp b/apps/openmw/mwrender/interior.cpp similarity index 97% rename from game/mwrender/interior.cpp rename to apps/openmw/mwrender/interior.cpp index 684e7cf63..83d340018 100644 --- a/game/mwrender/interior.cpp +++ b/apps/openmw/mwrender/interior.cpp @@ -3,7 +3,7 @@ #include #include -#include "nifogre/ogre_nif_loader.hpp" +#include "components/nifogre/ogre_nif_loader.hpp" #include "mwscene.hpp" using namespace MWRender; @@ -30,7 +30,7 @@ bool InteriorCellRender::lightOutQuadInLin = false; void InteriorCellRender::insertBegin (const ESM::CellRef &ref) { assert (!insert); - + // Create and place scene node for this object insert = base->createChildSceneNode(); @@ -59,7 +59,7 @@ void InteriorCellRender::insertBegin (const ESM::CellRef &ref) void InteriorCellRender::insertMesh(const std::string &mesh) { assert (insert); - + NIFLoader::load(mesh); MovableObject *ent = scene.getMgr()->createEntity(mesh); insert->attachObject(ent); @@ -74,7 +74,7 @@ void InteriorCellRender::insertLight(float r, float g, float b, float radius) light->setDiffuseColour (r, g, b); float cval=0.0f, lval=0.0f, qval=0.0f; - + if(lightConst) cval = lightConstValue; if(!lightOutQuadInLin) @@ -95,9 +95,9 @@ void InteriorCellRender::insertLight(float r, float g, float b, float radius) // Do quadratic or linear, depending if we're in an exterior or interior // cell, respectively. Ignore lightLinear and lightQuadratic. } - + light->setAttenuation(10*radius, cval, lval, qval); - + insert->attachObject(light); } @@ -108,19 +108,19 @@ std::string InteriorCellRender::insertEnd() assert (insert); std::string handle = insert->getName(); - + insert = 0; - + return handle; -} - +} + // configure lighting according to cell void InteriorCellRender::configureAmbient() { ambientColor.setAsABGR (cell.cell->ambi.ambient); setAmbientMode(); - + // Create a "sun" that shines light downwards. It doesn't look // completely right, but leave it for now. Ogre::Light *light = scene.getMgr()->createLight(); @@ -130,7 +130,7 @@ void InteriorCellRender::configureAmbient() light->setType(Ogre::Light::LT_DIRECTIONAL); light->setDirection(0,-1,0); } - + // configure fog according to cell void InteriorCellRender::configureFog() { @@ -144,28 +144,28 @@ void InteriorCellRender::configureFog() scene.getCamera()->setFarClipDistance (high + 10); scene.getViewport()->setBackgroundColour (color); } - + void InteriorCellRender::setAmbientMode() { switch (ambientMode) { case 0: - + scene.getMgr()->setAmbientLight(ambientColor); break; - + case 1: scene.getMgr()->setAmbientLight(0.7f*ambientColor + 0.3f*ColourValue(1,1,1)); break; - + case 2: - + scene.getMgr()->setAmbientLight(ColourValue(1,1,1)); break; } } - + void InteriorCellRender::show() { // If already loaded, just make the cell visible. @@ -208,14 +208,14 @@ void InteriorCellRender::toggleLight() ambientMode = 0; else ++ambientMode; - + switch (ambientMode) { case 0: std::cout << "Setting lights to normal\n"; break; case 1: std::cout << "Turning the lights up\n"; break; case 2: std::cout << "Turning the lights to full\n"; break; } - + setAmbientMode(); } diff --git a/game/mwrender/interior.hpp b/apps/openmw/mwrender/interior.hpp similarity index 90% rename from game/mwrender/interior.hpp rename to apps/openmw/mwrender/interior.hpp index da5ba6a21..7657a6751 100644 --- a/game/mwrender/interior.hpp +++ b/apps/openmw/mwrender/interior.hpp @@ -2,7 +2,7 @@ #define _GAME_RENDER_INTERIOR_H #include "cell.hpp" -#include "esm_store/cell_store.hpp" +#include "components/esm_store/cell_store.hpp" #include "OgreColourValue.h" @@ -14,7 +14,7 @@ namespace Ogre namespace MWRender { class MWScene; - + /** This class is responsible for inserting meshes and other rendering objects from the given cell into the given rendering @@ -22,10 +22,10 @@ namespace MWRender TODO FIXME: Doesn't do full cleanup yet. */ - + class InteriorCellRender : private CellRender { - + static bool lightConst; static float lightConstValue; @@ -40,19 +40,19 @@ namespace MWRender static float lightQuadraticRadiusMult; static bool lightOutQuadInLin; - + const ESMS::CellStore &cell; MWScene &scene; /// The scene node that contains all objects belonging to this /// cell. Ogre::SceneNode *base; - + Ogre::SceneNode *insert; // 0 normal, 1 more bright, 2 max int ambientMode; - + Ogre::ColourValue ambientColor; /// start inserting a new reference. @@ -60,28 +60,28 @@ namespace MWRender /// insert a mesh related to the most recent insertBegin call. virtual void insertMesh(const std::string &mesh); - + /// insert a light related to the most recent insertBegin call. virtual void insertLight(float r, float g, float b, float radius); - + /// finish inserting a new reference and return a handle to it. virtual std::string insertEnd(); - + /// configure lighting according to cell - void configureAmbient(); - + void configureAmbient(); + /// configure fog according to cell void configureFog(); - + void setAmbientMode(); - + public: - + InteriorCellRender(const ESMS::CellStore &_cell, MWScene &_scene) : cell(_cell), scene(_scene), base(NULL), insert(NULL), ambientMode (0) {} - + virtual ~InteriorCellRender() { destroy(); } - + /// Make the cell visible. Load the cell if necessary. void show(); @@ -90,8 +90,8 @@ namespace MWRender void hide(); /// Destroy all rendering objects connected with this cell. - void destroy(); - + void destroy(); + /// Switch through lighting modes. void toggleLight(); }; diff --git a/game/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp similarity index 100% rename from game/mwrender/mwscene.cpp rename to apps/openmw/mwrender/mwscene.cpp diff --git a/game/mwrender/mwscene.hpp b/apps/openmw/mwrender/mwscene.hpp similarity index 95% rename from game/mwrender/mwscene.hpp rename to apps/openmw/mwrender/mwscene.hpp index 724d4cb10..bca2b831b 100644 --- a/game/mwrender/mwscene.hpp +++ b/apps/openmw/mwrender/mwscene.hpp @@ -1,7 +1,7 @@ #ifndef _GAME_RENDER_MWSCENE_H #define _GAME_RENDER_MWSCENE_H -#include "ogre/renderer.hpp" +#include "components/engine/ogre/renderer.hpp" namespace Ogre { diff --git a/game/mwrender/playerpos.hpp b/apps/openmw/mwrender/playerpos.hpp similarity index 100% rename from game/mwrender/playerpos.hpp rename to apps/openmw/mwrender/playerpos.hpp diff --git a/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp similarity index 97% rename from bsa/bsa_archive.cpp rename to components/bsa/bsa_archive.cpp index a025c2507..4691eb546 100644 --- a/bsa/bsa_archive.cpp +++ b/components/bsa/bsa_archive.cpp @@ -27,7 +27,7 @@ #include #include #include "bsa_file.hpp" -#include +#include using namespace Ogre; using namespace Mangle::Stream; @@ -137,7 +137,7 @@ public: return name; } - Archive *createInstance( const String& name ) + Archive *createInstance( const String& name ) { return new BSAArchive(name); } diff --git a/bsa/bsa_archive.hpp b/components/bsa/bsa_archive.hpp similarity index 100% rename from bsa/bsa_archive.hpp rename to components/bsa/bsa_archive.hpp diff --git a/bsa/bsa_file.cpp b/components/bsa/bsa_file.cpp similarity index 96% rename from bsa/bsa_file.cpp rename to components/bsa/bsa_file.cpp index a6bf47848..acd63a4bc 100644 --- a/bsa/bsa_file.cpp +++ b/components/bsa/bsa_file.cpp @@ -23,9 +23,9 @@ #include "bsa_file.hpp" -#include -#include -#include +#include +#include +#include #include #include diff --git a/bsa/bsa_file.hpp b/components/bsa/bsa_file.hpp similarity index 98% rename from bsa/bsa_file.hpp rename to components/bsa/bsa_file.hpp index 5c19409ab..0e693dfdf 100644 --- a/bsa/bsa_file.hpp +++ b/components/bsa/bsa_file.hpp @@ -24,7 +24,7 @@ #ifndef _BSA_FILE_H_ #define _BSA_FILE_H_ -#include +#include #include #include diff --git a/bsa/tests/.gitignore b/components/bsa/tests/.gitignore similarity index 100% rename from bsa/tests/.gitignore rename to components/bsa/tests/.gitignore diff --git a/bsa/tests/Makefile b/components/bsa/tests/Makefile similarity index 100% rename from bsa/tests/Makefile rename to components/bsa/tests/Makefile diff --git a/bsa/tests/bsa_file_test.cpp b/components/bsa/tests/bsa_file_test.cpp similarity index 100% rename from bsa/tests/bsa_file_test.cpp rename to components/bsa/tests/bsa_file_test.cpp diff --git a/bsa/tests/bsatool.cpp b/components/bsa/tests/bsatool.cpp similarity index 100% rename from bsa/tests/bsatool.cpp rename to components/bsa/tests/bsatool.cpp diff --git a/bsa/tests/bsatool.ggo b/components/bsa/tests/bsatool.ggo similarity index 100% rename from bsa/tests/bsatool.ggo rename to components/bsa/tests/bsatool.ggo diff --git a/bsa/tests/bsatool_cmd.c b/components/bsa/tests/bsatool_cmd.c similarity index 100% rename from bsa/tests/bsatool_cmd.c rename to components/bsa/tests/bsatool_cmd.c diff --git a/bsa/tests/bsatool_cmd.h b/components/bsa/tests/bsatool_cmd.h similarity index 100% rename from bsa/tests/bsatool_cmd.h rename to components/bsa/tests/bsatool_cmd.h diff --git a/bsa/tests/ogre_archive_test.cpp b/components/bsa/tests/ogre_archive_test.cpp similarity index 100% rename from bsa/tests/ogre_archive_test.cpp rename to components/bsa/tests/ogre_archive_test.cpp diff --git a/bsa/tests/output/bsa_file_test.out b/components/bsa/tests/output/bsa_file_test.out similarity index 100% rename from bsa/tests/output/bsa_file_test.out rename to components/bsa/tests/output/bsa_file_test.out diff --git a/bsa/tests/output/ogre_archive_test.out b/components/bsa/tests/output/ogre_archive_test.out similarity index 100% rename from bsa/tests/output/ogre_archive_test.out rename to components/bsa/tests/output/ogre_archive_test.out diff --git a/bsa/tests/test.sh b/components/bsa/tests/test.sh similarity index 100% rename from bsa/tests/test.sh rename to components/bsa/tests/test.sh diff --git a/input/dispatch_map.hpp b/components/engine/input/dispatch_map.hpp similarity index 100% rename from input/dispatch_map.hpp rename to components/engine/input/dispatch_map.hpp diff --git a/input/dispatcher.hpp b/components/engine/input/dispatcher.hpp similarity index 100% rename from input/dispatcher.hpp rename to components/engine/input/dispatcher.hpp diff --git a/input/func_binder.hpp b/components/engine/input/func_binder.hpp similarity index 100% rename from input/func_binder.hpp rename to components/engine/input/func_binder.hpp diff --git a/input/listener.hpp b/components/engine/input/listener.hpp similarity index 98% rename from input/listener.hpp rename to components/engine/input/listener.hpp index ef4cce57f..ecc786f22 100644 --- a/input/listener.hpp +++ b/components/engine/input/listener.hpp @@ -2,7 +2,7 @@ #define _INPUT_LISTENER_H #include "oismanager.hpp" -#include "ogre/renderer.hpp" +#include "components/engine/ogre/renderer.hpp" #include "dispatcher.hpp" #include diff --git a/input/oismanager.cpp b/components/engine/input/oismanager.cpp similarity index 100% rename from input/oismanager.cpp rename to components/engine/input/oismanager.cpp diff --git a/input/oismanager.hpp b/components/engine/input/oismanager.hpp similarity index 85% rename from input/oismanager.hpp rename to components/engine/input/oismanager.hpp index 8e687782e..40d0f7c87 100644 --- a/input/oismanager.hpp +++ b/components/engine/input/oismanager.hpp @@ -1,7 +1,7 @@ #ifndef _INPUT_OISMANAGER_H #define _INPUT_OISMANAGER_H -#include "ogre/renderer.hpp" +#include "components/engine/ogre/renderer.hpp" #include namespace Input diff --git a/input/poller.hpp b/components/engine/input/poller.hpp similarity index 100% rename from input/poller.hpp rename to components/engine/input/poller.hpp diff --git a/input/tests/.gitignore b/components/engine/input/tests/.gitignore similarity index 100% rename from input/tests/.gitignore rename to components/engine/input/tests/.gitignore diff --git a/input/tests/Makefile b/components/engine/input/tests/Makefile similarity index 100% rename from input/tests/Makefile rename to components/engine/input/tests/Makefile diff --git a/input/tests/dispatch_map_test.cpp b/components/engine/input/tests/dispatch_map_test.cpp similarity index 100% rename from input/tests/dispatch_map_test.cpp rename to components/engine/input/tests/dispatch_map_test.cpp diff --git a/input/tests/funcbind_test.cpp b/components/engine/input/tests/funcbind_test.cpp similarity index 100% rename from input/tests/funcbind_test.cpp rename to components/engine/input/tests/funcbind_test.cpp diff --git a/input/tests/output/dispatch_map_test.out b/components/engine/input/tests/output/dispatch_map_test.out similarity index 100% rename from input/tests/output/dispatch_map_test.out rename to components/engine/input/tests/output/dispatch_map_test.out diff --git a/input/tests/output/funcbind_test.out b/components/engine/input/tests/output/funcbind_test.out similarity index 100% rename from input/tests/output/funcbind_test.out rename to components/engine/input/tests/output/funcbind_test.out diff --git a/input/tests/test.sh b/components/engine/input/tests/test.sh similarity index 100% rename from input/tests/test.sh rename to components/engine/input/tests/test.sh diff --git a/ogre/.gitignore b/components/engine/ogre/.gitignore similarity index 100% rename from ogre/.gitignore rename to components/engine/ogre/.gitignore diff --git a/ogre/renderer.cpp b/components/engine/ogre/renderer.cpp similarity index 100% rename from ogre/renderer.cpp rename to components/engine/ogre/renderer.cpp diff --git a/ogre/renderer.hpp b/components/engine/ogre/renderer.hpp similarity index 100% rename from ogre/renderer.hpp rename to components/engine/ogre/renderer.hpp diff --git a/esm/.gitignore b/components/esm/.gitignore similarity index 100% rename from esm/.gitignore rename to components/esm/.gitignore diff --git a/esm/defs.hpp b/components/esm/defs.hpp similarity index 100% rename from esm/defs.hpp rename to components/esm/defs.hpp diff --git a/esm/esm_reader.hpp b/components/esm/esm_reader.hpp similarity index 98% rename from esm/esm_reader.hpp rename to components/esm/esm_reader.hpp index 85d956689..d4f6f48ca 100644 --- a/esm/esm_reader.hpp +++ b/components/esm/esm_reader.hpp @@ -9,10 +9,10 @@ #include #include -#include -#include -#include -#include "tools/stringops.hpp" +#include +#include +#include +#include "components/misc/stringops.hpp" #ifdef __APPLE__ // need our own implementation of strnlen diff --git a/esm/loadacti.hpp b/components/esm/loadacti.hpp similarity index 100% rename from esm/loadacti.hpp rename to components/esm/loadacti.hpp diff --git a/esm/loadalch.hpp b/components/esm/loadalch.hpp similarity index 100% rename from esm/loadalch.hpp rename to components/esm/loadalch.hpp diff --git a/esm/loadappa.hpp b/components/esm/loadappa.hpp similarity index 100% rename from esm/loadappa.hpp rename to components/esm/loadappa.hpp diff --git a/esm/loadarmo.hpp b/components/esm/loadarmo.hpp similarity index 100% rename from esm/loadarmo.hpp rename to components/esm/loadarmo.hpp diff --git a/esm/loadbody.hpp b/components/esm/loadbody.hpp similarity index 100% rename from esm/loadbody.hpp rename to components/esm/loadbody.hpp diff --git a/esm/loadbook.hpp b/components/esm/loadbook.hpp similarity index 100% rename from esm/loadbook.hpp rename to components/esm/loadbook.hpp diff --git a/esm/loadbsgn.hpp b/components/esm/loadbsgn.hpp similarity index 100% rename from esm/loadbsgn.hpp rename to components/esm/loadbsgn.hpp diff --git a/esm/loadcell.hpp b/components/esm/loadcell.hpp similarity index 100% rename from esm/loadcell.hpp rename to components/esm/loadcell.hpp diff --git a/esm/loadclas.hpp b/components/esm/loadclas.hpp similarity index 100% rename from esm/loadclas.hpp rename to components/esm/loadclas.hpp diff --git a/esm/loadclot.hpp b/components/esm/loadclot.hpp similarity index 100% rename from esm/loadclot.hpp rename to components/esm/loadclot.hpp diff --git a/esm/loadcont.hpp b/components/esm/loadcont.hpp similarity index 100% rename from esm/loadcont.hpp rename to components/esm/loadcont.hpp diff --git a/esm/loadcrea.hpp b/components/esm/loadcrea.hpp similarity index 100% rename from esm/loadcrea.hpp rename to components/esm/loadcrea.hpp diff --git a/esm/loadcrec.hpp b/components/esm/loadcrec.hpp similarity index 100% rename from esm/loadcrec.hpp rename to components/esm/loadcrec.hpp diff --git a/esm/loaddial.hpp b/components/esm/loaddial.hpp similarity index 100% rename from esm/loaddial.hpp rename to components/esm/loaddial.hpp diff --git a/esm/loaddoor.hpp b/components/esm/loaddoor.hpp similarity index 100% rename from esm/loaddoor.hpp rename to components/esm/loaddoor.hpp diff --git a/esm/loadench.hpp b/components/esm/loadench.hpp similarity index 100% rename from esm/loadench.hpp rename to components/esm/loadench.hpp diff --git a/esm/loadfact.hpp b/components/esm/loadfact.hpp similarity index 100% rename from esm/loadfact.hpp rename to components/esm/loadfact.hpp diff --git a/esm/loadglob.hpp b/components/esm/loadglob.hpp similarity index 100% rename from esm/loadglob.hpp rename to components/esm/loadglob.hpp diff --git a/esm/loadgmst.hpp b/components/esm/loadgmst.hpp similarity index 100% rename from esm/loadgmst.hpp rename to components/esm/loadgmst.hpp diff --git a/esm/loadinfo.hpp b/components/esm/loadinfo.hpp similarity index 100% rename from esm/loadinfo.hpp rename to components/esm/loadinfo.hpp diff --git a/esm/loadingr.hpp b/components/esm/loadingr.hpp similarity index 100% rename from esm/loadingr.hpp rename to components/esm/loadingr.hpp diff --git a/esm/loadland.hpp b/components/esm/loadland.hpp similarity index 100% rename from esm/loadland.hpp rename to components/esm/loadland.hpp diff --git a/esm/loadlevlist.hpp b/components/esm/loadlevlist.hpp similarity index 100% rename from esm/loadlevlist.hpp rename to components/esm/loadlevlist.hpp diff --git a/esm/loadligh.hpp b/components/esm/loadligh.hpp similarity index 100% rename from esm/loadligh.hpp rename to components/esm/loadligh.hpp diff --git a/esm/loadlocks.hpp b/components/esm/loadlocks.hpp similarity index 100% rename from esm/loadlocks.hpp rename to components/esm/loadlocks.hpp diff --git a/esm/loadltex.hpp b/components/esm/loadltex.hpp similarity index 100% rename from esm/loadltex.hpp rename to components/esm/loadltex.hpp diff --git a/esm/loadmgef.hpp b/components/esm/loadmgef.hpp similarity index 100% rename from esm/loadmgef.hpp rename to components/esm/loadmgef.hpp diff --git a/esm/loadmisc.hpp b/components/esm/loadmisc.hpp similarity index 100% rename from esm/loadmisc.hpp rename to components/esm/loadmisc.hpp diff --git a/esm/loadnpc.hpp b/components/esm/loadnpc.hpp similarity index 100% rename from esm/loadnpc.hpp rename to components/esm/loadnpc.hpp diff --git a/esm/loadnpcc.hpp b/components/esm/loadnpcc.hpp similarity index 100% rename from esm/loadnpcc.hpp rename to components/esm/loadnpcc.hpp diff --git a/esm/loadpgrd.hpp b/components/esm/loadpgrd.hpp similarity index 100% rename from esm/loadpgrd.hpp rename to components/esm/loadpgrd.hpp diff --git a/esm/loadrace.hpp b/components/esm/loadrace.hpp similarity index 100% rename from esm/loadrace.hpp rename to components/esm/loadrace.hpp diff --git a/esm/loadregn.hpp b/components/esm/loadregn.hpp similarity index 100% rename from esm/loadregn.hpp rename to components/esm/loadregn.hpp diff --git a/esm/loadscpt.hpp b/components/esm/loadscpt.hpp similarity index 100% rename from esm/loadscpt.hpp rename to components/esm/loadscpt.hpp diff --git a/esm/loadskil.hpp b/components/esm/loadskil.hpp similarity index 100% rename from esm/loadskil.hpp rename to components/esm/loadskil.hpp diff --git a/esm/loadsndg.hpp b/components/esm/loadsndg.hpp similarity index 100% rename from esm/loadsndg.hpp rename to components/esm/loadsndg.hpp diff --git a/esm/loadsoun.hpp b/components/esm/loadsoun.hpp similarity index 100% rename from esm/loadsoun.hpp rename to components/esm/loadsoun.hpp diff --git a/esm/loadspel.hpp b/components/esm/loadspel.hpp similarity index 100% rename from esm/loadspel.hpp rename to components/esm/loadspel.hpp diff --git a/esm/loadsscr.hpp b/components/esm/loadsscr.hpp similarity index 100% rename from esm/loadsscr.hpp rename to components/esm/loadsscr.hpp diff --git a/esm/loadstat.hpp b/components/esm/loadstat.hpp similarity index 100% rename from esm/loadstat.hpp rename to components/esm/loadstat.hpp diff --git a/esm/loadweap.hpp b/components/esm/loadweap.hpp similarity index 100% rename from esm/loadweap.hpp rename to components/esm/loadweap.hpp diff --git a/esm/records.hpp b/components/esm/records.hpp similarity index 100% rename from esm/records.hpp rename to components/esm/records.hpp diff --git a/esm/tests/.gitignore b/components/esm/tests/.gitignore similarity index 100% rename from esm/tests/.gitignore rename to components/esm/tests/.gitignore diff --git a/esm/tests/Makefile b/components/esm/tests/Makefile similarity index 100% rename from esm/tests/Makefile rename to components/esm/tests/Makefile diff --git a/esm/tests/esmtool.cpp b/components/esm/tests/esmtool.cpp similarity index 100% rename from esm/tests/esmtool.cpp rename to components/esm/tests/esmtool.cpp diff --git a/esm/tests/esmtool.ggo b/components/esm/tests/esmtool.ggo similarity index 100% rename from esm/tests/esmtool.ggo rename to components/esm/tests/esmtool.ggo diff --git a/esm/tests/esmtool_cmd.c b/components/esm/tests/esmtool_cmd.c similarity index 100% rename from esm/tests/esmtool_cmd.c rename to components/esm/tests/esmtool_cmd.c diff --git a/esm/tests/esmtool_cmd.h b/components/esm/tests/esmtool_cmd.h similarity index 100% rename from esm/tests/esmtool_cmd.h rename to components/esm/tests/esmtool_cmd.h diff --git a/esm_store/cell_store.cpp b/components/esm_store/cell_store.cpp similarity index 98% rename from esm_store/cell_store.cpp rename to components/esm_store/cell_store.cpp index 5bad6e10f..2f03511b4 100644 --- a/esm_store/cell_store.cpp +++ b/components/esm_store/cell_store.cpp @@ -1,6 +1,6 @@ #include "cell_store.hpp" #include -#include "mangle/tools/str_exception.hpp" +#include "libs/mangle/tools/str_exception.hpp" using namespace ESMS; using namespace std; @@ -24,7 +24,7 @@ void CellStore::loadExt(int X, int Y, const ESMStore &store, ESMReader &esm) void CellStore::loadRefs(const ESMStore &store, ESMReader &esm) { assert (cell); - + // Reopen the ESM reader and seek to the right position. cell->restore(esm); diff --git a/esm_store/cell_store.hpp b/components/esm_store/cell_store.hpp similarity index 95% rename from esm_store/cell_store.hpp rename to components/esm_store/cell_store.hpp index f39d482f6..0a997e021 100644 --- a/esm_store/cell_store.hpp +++ b/components/esm_store/cell_store.hpp @@ -11,9 +11,9 @@ */ #include "store.hpp" -#include "esm/records.hpp" -#include "esm/loadcell.hpp" -#include +#include "components/esm/records.hpp" +#include "components/esm/loadcell.hpp" +#include #include namespace ESMS @@ -70,9 +70,9 @@ namespace ESMS { public: CellStore() : cell (0) {} - + const ESM::Cell *cell; - + // Lists for each individual object type CellRefList activators; CellRefList potions; diff --git a/esm_store/reclists.hpp b/components/esm_store/reclists.hpp similarity index 98% rename from esm_store/reclists.hpp rename to components/esm_store/reclists.hpp index 6fd6e9f72..196ce6063 100644 --- a/esm_store/reclists.hpp +++ b/components/esm_store/reclists.hpp @@ -1,7 +1,7 @@ #ifndef _GAME_ESM_RECLISTS_H #define _GAME_ESM_RECLISTS_H -#include "esm/records.hpp" +#include "components/esm/records.hpp" #include #include #include diff --git a/esm_store/store.cpp b/components/esm_store/store.cpp similarity index 100% rename from esm_store/store.cpp rename to components/esm_store/store.cpp diff --git a/esm_store/store.hpp b/components/esm_store/store.hpp similarity index 99% rename from esm_store/store.hpp rename to components/esm_store/store.hpp index 2271f4238..44bd87279 100644 --- a/esm_store/store.hpp +++ b/components/esm_store/store.hpp @@ -13,7 +13,7 @@ maintainability. */ -#include "esm/records.hpp" +#include "components/esm/records.hpp" #include "reclists.hpp" namespace ESMS diff --git a/tools/fileops.cpp b/components/misc/fileops.cpp similarity index 100% rename from tools/fileops.cpp rename to components/misc/fileops.cpp diff --git a/tools/fileops.hpp b/components/misc/fileops.hpp similarity index 100% rename from tools/fileops.hpp rename to components/misc/fileops.hpp diff --git a/tools/slice_array.hpp b/components/misc/slice_array.hpp similarity index 100% rename from tools/slice_array.hpp rename to components/misc/slice_array.hpp diff --git a/tools/stringops.cpp b/components/misc/stringops.cpp similarity index 100% rename from tools/stringops.cpp rename to components/misc/stringops.cpp diff --git a/tools/stringops.hpp b/components/misc/stringops.hpp similarity index 100% rename from tools/stringops.hpp rename to components/misc/stringops.hpp diff --git a/tools/tests/.gitignore b/components/misc/tests/.gitignore similarity index 100% rename from tools/tests/.gitignore rename to components/misc/tests/.gitignore diff --git a/tools/tests/Makefile b/components/misc/tests/Makefile similarity index 100% rename from tools/tests/Makefile rename to components/misc/tests/Makefile diff --git a/tools/tests/output/slice_test.out b/components/misc/tests/output/slice_test.out similarity index 100% rename from tools/tests/output/slice_test.out rename to components/misc/tests/output/slice_test.out diff --git a/tools/tests/output/strops_test.out b/components/misc/tests/output/strops_test.out similarity index 100% rename from tools/tests/output/strops_test.out rename to components/misc/tests/output/strops_test.out diff --git a/tools/tests/slice_test.cpp b/components/misc/tests/slice_test.cpp similarity index 100% rename from tools/tests/slice_test.cpp rename to components/misc/tests/slice_test.cpp diff --git a/tools/tests/strops_test.cpp b/components/misc/tests/strops_test.cpp similarity index 100% rename from tools/tests/strops_test.cpp rename to components/misc/tests/strops_test.cpp diff --git a/nif/tests/test.sh b/components/misc/tests/test.sh similarity index 100% rename from nif/tests/test.sh rename to components/misc/tests/test.sh diff --git a/nif/.gitignore b/components/nif/.gitignore similarity index 100% rename from nif/.gitignore rename to components/nif/.gitignore diff --git a/nif/controlled.hpp b/components/nif/controlled.hpp similarity index 100% rename from nif/controlled.hpp rename to components/nif/controlled.hpp diff --git a/nif/controller.hpp b/components/nif/controller.hpp similarity index 100% rename from nif/controller.hpp rename to components/nif/controller.hpp diff --git a/nif/data.hpp b/components/nif/data.hpp similarity index 100% rename from nif/data.hpp rename to components/nif/data.hpp diff --git a/nif/effect.hpp b/components/nif/effect.hpp similarity index 100% rename from nif/effect.hpp rename to components/nif/effect.hpp diff --git a/nif/extra.hpp b/components/nif/extra.hpp similarity index 100% rename from nif/extra.hpp rename to components/nif/extra.hpp diff --git a/nif/nif_file.cpp b/components/nif/nif_file.cpp similarity index 99% rename from nif/nif_file.cpp rename to components/nif/nif_file.cpp index dc7fc2ed8..12845e617 100644 --- a/nif/nif_file.cpp +++ b/components/nif/nif_file.cpp @@ -23,7 +23,7 @@ #include "nif_file.hpp" #include "record.hpp" -#include "tools/stringops.hpp" +#include "components/misc/stringops.hpp" #include "extra.hpp" #include "controlled.hpp" diff --git a/nif/nif_file.hpp b/components/nif/nif_file.hpp similarity index 95% rename from nif/nif_file.hpp rename to components/nif/nif_file.hpp index a1c34b3bb..f6ee80a9e 100644 --- a/nif/nif_file.hpp +++ b/components/nif/nif_file.hpp @@ -24,11 +24,11 @@ #ifndef _NIF_FILE_H_ #define _NIF_FILE_H_ -#include -#include -#include +#include +#include +#include -#include "../tools/slice_array.hpp" +#include "../misc/slice_array.hpp" #include #include diff --git a/nif/nif_types.hpp b/components/nif/nif_types.hpp similarity index 100% rename from nif/nif_types.hpp rename to components/nif/nif_types.hpp diff --git a/nif/node.hpp b/components/nif/node.hpp similarity index 100% rename from nif/node.hpp rename to components/nif/node.hpp diff --git a/nif/property.hpp b/components/nif/property.hpp similarity index 100% rename from nif/property.hpp rename to components/nif/property.hpp diff --git a/nif/record.hpp b/components/nif/record.hpp similarity index 100% rename from nif/record.hpp rename to components/nif/record.hpp diff --git a/nif/record_ptr.hpp b/components/nif/record_ptr.hpp similarity index 100% rename from nif/record_ptr.hpp rename to components/nif/record_ptr.hpp diff --git a/nif/tests/.gitignore b/components/nif/tests/.gitignore similarity index 100% rename from nif/tests/.gitignore rename to components/nif/tests/.gitignore diff --git a/nif/tests/Makefile b/components/nif/tests/Makefile similarity index 100% rename from nif/tests/Makefile rename to components/nif/tests/Makefile diff --git a/nif/tests/nif_bsa_test.cpp b/components/nif/tests/nif_bsa_test.cpp similarity index 100% rename from nif/tests/nif_bsa_test.cpp rename to components/nif/tests/nif_bsa_test.cpp diff --git a/nif/tests/niftool.cpp b/components/nif/tests/niftool.cpp similarity index 100% rename from nif/tests/niftool.cpp rename to components/nif/tests/niftool.cpp diff --git a/nif/tests/output/nif_bsa_test.out b/components/nif/tests/output/nif_bsa_test.out similarity index 100% rename from nif/tests/output/nif_bsa_test.out rename to components/nif/tests/output/nif_bsa_test.out diff --git a/nifogre/tests/test.sh b/components/nif/tests/test.sh similarity index 100% rename from nifogre/tests/test.sh rename to components/nif/tests/test.sh diff --git a/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp similarity index 99% rename from nifogre/ogre_nif_loader.cpp rename to components/nifogre/ogre_nif_loader.cpp index 3c4ac19e0..670fba830 100644 --- a/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -25,12 +25,12 @@ #include #include -#include -#include "nif/nif_file.hpp" -#include "nif/node.hpp" -#include "nif/data.hpp" -#include "nif/property.hpp" -#include "platform/strings.h" +#include +#include "components/nif/nif_file.hpp" +#include "components/nif/node.hpp" +#include "components/nif/data.hpp" +#include "components/nif/property.hpp" +#include "libs/platform/strings.h" // For warning messages #include diff --git a/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp similarity index 100% rename from nifogre/ogre_nif_loader.hpp rename to components/nifogre/ogre_nif_loader.hpp diff --git a/nifogre/tests/.gitignore b/components/nifogre/tests/.gitignore similarity index 100% rename from nifogre/tests/.gitignore rename to components/nifogre/tests/.gitignore diff --git a/nifogre/tests/Makefile b/components/nifogre/tests/Makefile similarity index 100% rename from nifogre/tests/Makefile rename to components/nifogre/tests/Makefile diff --git a/nifogre/tests/ogre_common.cpp b/components/nifogre/tests/ogre_common.cpp similarity index 100% rename from nifogre/tests/ogre_common.cpp rename to components/nifogre/tests/ogre_common.cpp diff --git a/nifogre/tests/ogre_manualresource_test.cpp b/components/nifogre/tests/ogre_manualresource_test.cpp similarity index 100% rename from nifogre/tests/ogre_manualresource_test.cpp rename to components/nifogre/tests/ogre_manualresource_test.cpp diff --git a/nifogre/tests/ogre_mesh_common.cpp b/components/nifogre/tests/ogre_mesh_common.cpp similarity index 100% rename from nifogre/tests/ogre_mesh_common.cpp rename to components/nifogre/tests/ogre_mesh_common.cpp diff --git a/nifogre/tests/ogre_nif_test.cpp b/components/nifogre/tests/ogre_nif_test.cpp similarity index 100% rename from nifogre/tests/ogre_nif_test.cpp rename to components/nifogre/tests/ogre_nif_test.cpp diff --git a/nifogre/tests/ogre_skeleton_test.cpp b/components/nifogre/tests/ogre_skeleton_test.cpp similarity index 100% rename from nifogre/tests/ogre_skeleton_test.cpp rename to components/nifogre/tests/ogre_skeleton_test.cpp diff --git a/nifogre/tests/output/ogre_manualresource_test.out b/components/nifogre/tests/output/ogre_manualresource_test.out similarity index 100% rename from nifogre/tests/output/ogre_manualresource_test.out rename to components/nifogre/tests/output/ogre_manualresource_test.out diff --git a/nifogre/tests/output/ogre_nif_test.out b/components/nifogre/tests/output/ogre_nif_test.out similarity index 100% rename from nifogre/tests/output/ogre_nif_test.out rename to components/nifogre/tests/output/ogre_nif_test.out diff --git a/nifogre/tests/output/ogre_skeleton_test.out b/components/nifogre/tests/output/ogre_skeleton_test.out similarity index 100% rename from nifogre/tests/output/ogre_skeleton_test.out rename to components/nifogre/tests/output/ogre_skeleton_test.out diff --git a/nifogre/tests/plugins.cfg b/components/nifogre/tests/plugins.cfg similarity index 100% rename from nifogre/tests/plugins.cfg rename to components/nifogre/tests/plugins.cfg diff --git a/tools/tests/test.sh b/components/nifogre/tests/test.sh similarity index 100% rename from tools/tests/test.sh rename to components/nifogre/tests/test.sh diff --git a/platform/stdint.h b/libs/platform/stdint.h similarity index 100% rename from platform/stdint.h rename to libs/platform/stdint.h diff --git a/platform/strings.h b/libs/platform/strings.h similarity index 100% rename from platform/strings.h rename to libs/platform/strings.h From 91f5c9c01fc0a3664c449ae331204b32c10d3c80 Mon Sep 17 00:00:00 2001 From: Nicolay Korslund Date: Sat, 26 Jun 2010 10:39:37 +0200 Subject: [PATCH 005/100] Moved mangle submodule. Running 'git submodule update' should be enough. --- .gitmodules | 4 ++-- libs/mangle | 1 + mangle | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) create mode 160000 libs/mangle delete mode 160000 mangle diff --git a/.gitmodules b/.gitmodules index 5cf974020..1e2f38738 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "mangle"] - path = mangle +[submodule "libs/mangle"] + path = libs/mangle url = git://github.com/korslund/mangle.git diff --git a/libs/mangle b/libs/mangle new file mode 160000 index 000000000..eed875ae0 --- /dev/null +++ b/libs/mangle @@ -0,0 +1 @@ +Subproject commit eed875ae043c3c48fd23e18342c17d6f2331cc17 diff --git a/mangle b/mangle deleted file mode 160000 index 19649bfea..000000000 --- a/mangle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 19649bfeaa5a204cc765c7b0a66789919d6681d9 From 106d12906a9b6299f7878be17f3b280074407190 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 27 Jun 2010 14:17:04 +0200 Subject: [PATCH 006/100] special case handling for script records --- components/esm_store/reclists.hpp | 29 +++++++++++++++++++++++++++++ components/esm_store/store.hpp | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/components/esm_store/reclists.hpp b/components/esm_store/reclists.hpp index 196ce6063..75d4e67ae 100644 --- a/components/esm_store/reclists.hpp +++ b/components/esm_store/reclists.hpp @@ -131,6 +131,35 @@ namespace ESMS } } }; + + template + struct ScriptListT : RecList + { + typedef std::map MapType; + + MapType list; + + // Load one object of this type + void load(ESMReader &esm, const std::string &id) + { + X ref; + ref.load (esm); + + std::string realId = ref.data.name.toString(); + + std::swap (list[realId], ref); + } + + // Find the given object ID, or return NULL if not found. + const X* find(const std::string &id) const + { + if(list.find(id) == list.end()) + return NULL; + return &list.find(id)->second; + } + + int getSize() { return list.size(); } + }; /* We need special lists for: diff --git a/components/esm_store/store.hpp b/components/esm_store/store.hpp index 44bd87279..7c4971ac4 100644 --- a/components/esm_store/store.hpp +++ b/components/esm_store/store.hpp @@ -73,7 +73,7 @@ namespace ESMS //RecListT lands; //RecListT landTexts; //RecListT magicEffects; - //RecListT