diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 7f384a7944..b8784dc818 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -80,10 +80,6 @@ set(GAMEWORLD mwworld/world.cpp mwworld/globals.cpp mwworld/class.cpp - mwworld/classes.cpp - mwworld/activator.cpp - mwworld/creature.cpp - mwworld/npc.cpp ) set(GAMEWORLD_HEADER mwworld/refdata.hpp @@ -92,13 +88,23 @@ set(GAMEWORLD_HEADER mwworld/environment.hpp mwworld/globals.hpp mwworld/class.hpp - mwworld/classes.hpp - mwworld/activator.hpp - mwworld/creature.hpp - mwworld/npc.hpp ) source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER}) +set(GAMECLASS + mwclass/classes.cpp + mwclass/activator.cpp + mwclass/creature.cpp + mwclass/npc.cpp + ) +set(GAMECLASS_HEADER + mwclass/classes.hpp + mwclass/activator.hpp + mwclass/creature.hpp + mwclass/npc.hpp + ) +source_group(apps\\openmw\\mwclass FILES ${GAMECLASS} ${GAMECLASS_HEADER}) + set(GAMEMECHANICS mwmechanics/mechanicsmanager.cpp) set(GAMEMECHANICS_HEADER @@ -109,10 +115,11 @@ set(GAMEMECHANICS_HEADER source_group(apps\\openmw\\mwmechanics FILES ${GAMEMECHANICS} ${GAMEMECHANICS_HEADER}) set(OPENMW_CPP ${GAME} ${GAMEREND} ${GAMEINPUT} ${GAMESCRIPT} ${GAMESOUND} ${GAMEGUI} ${GAMEWORLD} - ${GAMEMECHANICS} + ${GAMECLASS} ${GAMEMECHANICS} ) set(OPENMW_HEADER ${GAME_HEADER} ${GAMEREND_HEADER} ${GAMEINPUT_HEADER} ${GAMESCRIPT_HEADER} - ${GAMESOUND_HEADER} ${GAMEGUI_HEADER} ${GAMEWORLD_HEADER} ${GAMEMECHANICS_HEADER} + ${GAMESOUND_HEADER} ${GAMEGUI_HEADER} ${GAMEWORLD_HEADER} ${GAMECLASS_HEADER} + ${GAMEMECHANICS_HEADER} ) # Main executable diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index f49216cdaf..5b6aea3c2f 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -23,7 +23,8 @@ #include "mwworld/world.hpp" #include "mwworld/ptr.hpp" #include "mwworld/environment.hpp" -#include "mwworld/classes.hpp" + +#include "mwclass/classes.hpp" #include "mwmechanics/mechanicsmanager.hpp" @@ -79,7 +80,7 @@ OMW::Engine::Engine() , mScriptManager (0) , mScriptContext (0) { - MWWorld::registerClasses(); + MWClass::registerClasses(); } OMW::Engine::~Engine() diff --git a/apps/openmw/mwclass/activator.cpp b/apps/openmw/mwclass/activator.cpp index 27bf00e10b..0e3df53a26 100644 --- a/apps/openmw/mwclass/activator.cpp +++ b/apps/openmw/mwclass/activator.cpp @@ -3,7 +3,7 @@ #include -namespace MWWorld +namespace MWClass { void Activator::registerSelf() { diff --git a/apps/openmw/mwclass/activator.hpp b/apps/openmw/mwclass/activator.hpp new file mode 100644 index 0000000000..a649ce6efe --- /dev/null +++ b/apps/openmw/mwclass/activator.hpp @@ -0,0 +1,17 @@ +#ifndef GAME_MWCLASS_ACTIVATOR_H +#define GAME_MWCLASS_ACTIVATOR_H + +#include "../mwworld/class.hpp" + +namespace MWClass +{ + class Activator : public MWWorld::Class + { + public: + + + static void registerSelf(); + }; +} + +#endif diff --git a/apps/openmw/mwworld/classes.cpp b/apps/openmw/mwclass/classes.cpp similarity index 92% rename from apps/openmw/mwworld/classes.cpp rename to apps/openmw/mwclass/classes.cpp index 4ae2076d9c..16f3fab4d2 100644 --- a/apps/openmw/mwworld/classes.cpp +++ b/apps/openmw/mwclass/classes.cpp @@ -5,7 +5,7 @@ #include "creature.hpp" #include "npc.hpp" -namespace MWWorld +namespace MWClass { void registerClasses() { diff --git a/apps/openmw/mwclass/classes.hpp b/apps/openmw/mwclass/classes.hpp new file mode 100644 index 0000000000..0ab90b677b --- /dev/null +++ b/apps/openmw/mwclass/classes.hpp @@ -0,0 +1,10 @@ +#ifndef GAME_MWCLASS_CLASSES_H +#define GAME_MWCLASS_CLASSES_H + +namespace MWClass +{ + void registerClasses(); + ///< register all known classes +} + +#endif diff --git a/apps/openmw/mwworld/creature.cpp b/apps/openmw/mwclass/creature.cpp similarity index 88% rename from apps/openmw/mwworld/creature.cpp rename to apps/openmw/mwclass/creature.cpp index dff1cb1c96..a367b0f8fa 100644 --- a/apps/openmw/mwworld/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -5,18 +5,18 @@ #include "../mwmechanics/creaturestats.hpp" -#include "ptr.hpp" +#include "../mwworld/ptr.hpp" -namespace MWWorld +namespace MWClass { - MWMechanics::CreatureStats& Creature::getCreatureStats (const Ptr& ptr) const + MWMechanics::CreatureStats& Creature::getCreatureStats (const MWWorld::Ptr& ptr) const { if (!ptr.getRefData().getCreatureStats().get()) { boost::shared_ptr stats ( new MWMechanics::CreatureStats); - ESMS::LiveCellRef *ref = ptr.get(); + ESMS::LiveCellRef *ref = ptr.get(); stats->mAttributes[0].set (ref->base->data.strength); stats->mAttributes[1].set (ref->base->data.intelligence); diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp new file mode 100644 index 0000000000..a583fb6d42 --- /dev/null +++ b/apps/openmw/mwclass/creature.hpp @@ -0,0 +1,19 @@ +#ifndef GAME_MWCLASS_CREATURE_H +#define GAME_MWCLASS_CREATURE_H + +#include "../mwworld/class.hpp" + +namespace MWClass +{ + class Creature : public MWWorld::Class + { + public: + + virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const; + ///< Return creature stats + + static void registerSelf(); + }; +} + +#endif diff --git a/apps/openmw/mwworld/npc.cpp b/apps/openmw/mwclass/npc.cpp similarity index 85% rename from apps/openmw/mwworld/npc.cpp rename to apps/openmw/mwclass/npc.cpp index e98e532da3..eba033ef70 100644 --- a/apps/openmw/mwworld/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -3,18 +3,18 @@ #include -#include "ptr.hpp" +#include "../mwworld/ptr.hpp" -namespace MWWorld +namespace MWClass { - MWMechanics::CreatureStats& Npc::getCreatureStats (const Ptr& ptr) const + MWMechanics::CreatureStats& Npc::getCreatureStats (const MWWorld::Ptr& ptr) const { if (!ptr.getRefData().getCreatureStats().get()) { boost::shared_ptr stats ( new MWMechanics::CreatureStats); - ESMS::LiveCellRef *ref = ptr.get(); + ESMS::LiveCellRef *ref = ptr.get(); stats->mAttributes[0].set (ref->base->npdt52.strength); stats->mAttributes[1].set (ref->base->npdt52.intelligence); diff --git a/apps/openmw/mwworld/npc.hpp b/apps/openmw/mwclass/npc.hpp similarity index 51% rename from apps/openmw/mwworld/npc.hpp rename to apps/openmw/mwclass/npc.hpp index 7b10ccb328..48367bc711 100644 --- a/apps/openmw/mwworld/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -1,15 +1,15 @@ -#ifndef GAME_MWWORLD_NPC_H -#define GAME_MWWORLD_NPC_H +#ifndef GAME_MWCLASS_NPC_H +#define GAME_MWCLASS_NPC_H -#include "class.hpp" +#include "../mwworld/class.hpp" -namespace MWWorld +namespace MWClass { - class Npc : public Class + class Npc : public MWWorld::Class { public: - virtual MWMechanics::CreatureStats& getCreatureStats (const Ptr& ptr) const; + virtual MWMechanics::CreatureStats& getCreatureStats (const MWWorld::Ptr& ptr) const; ///< Return creature stats static void registerSelf(); diff --git a/apps/openmw/mwworld/activator.cpp b/apps/openmw/mwworld/activator.cpp deleted file mode 100644 index 27bf00e10b..0000000000 --- a/apps/openmw/mwworld/activator.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "activator.hpp" - -#include - -namespace MWWorld -{ - void Activator::registerSelf() - { - boost::shared_ptr instance (new Activator); - - registerClass (typeid (ESM::Activator).name(), instance); - } -} diff --git a/apps/openmw/mwworld/activator.hpp b/apps/openmw/mwworld/activator.hpp deleted file mode 100644 index 023790e6f0..0000000000 --- a/apps/openmw/mwworld/activator.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GAME_MWWORLD_ACTIVATOR_H -#define GAME_MWWORLD_ACTIVATOR_H - -#include "class.hpp" - -namespace MWWorld -{ - class Activator : public Class - { - public: - - - static void registerSelf(); - }; -} - -#endif diff --git a/apps/openmw/mwworld/classes.hpp b/apps/openmw/mwworld/classes.hpp deleted file mode 100644 index 9b83b8d73a..0000000000 --- a/apps/openmw/mwworld/classes.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GAME_MWWORLD_CLASSES_H -#define GAME_MWWORLD_CLASSES_H - -namespace MWWorld -{ - void registerClasses(); - ///< register all known classes -} - -#endif diff --git a/apps/openmw/mwworld/creature.hpp b/apps/openmw/mwworld/creature.hpp deleted file mode 100644 index 7ab2b5af0a..0000000000 --- a/apps/openmw/mwworld/creature.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef GAME_MWWORLD_CREATURE_H -#define GAME_MWWORLD_CREATURE_H - -#include "class.hpp" - -namespace MWWorld -{ - class Creature : public Class - { - public: - - virtual MWMechanics::CreatureStats& getCreatureStats (const Ptr& ptr) const; - ///< Return creature stats - - static void registerSelf(); - }; -} - -#endif