diff --git a/apps/openmw/mwgui/referenceinterface.hpp b/apps/openmw/mwgui/referenceinterface.hpp index 40844b238..aba9071f3 100644 --- a/apps/openmw/mwgui/referenceinterface.hpp +++ b/apps/openmw/mwgui/referenceinterface.hpp @@ -22,7 +22,7 @@ namespace MWGui MWWorld::Ptr mPtr; private: - MWWorld::Ptr::CellStore* mCurrentPlayerCell; + MWWorld::CellStore* mCurrentPlayerCell; }; } diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index f62a3fa0f..7a8b72886 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -26,14 +26,16 @@ #include "../mwbase/environment.hpp" +#include "../mwworld/ptr.hpp" +#include "../mwworld/cellstore.hpp" + #include "console.hpp" #include "journalwindow.hpp" #include "charactercreation.hpp" #include -#include -#include +#include #include using namespace MWGui; @@ -82,7 +84,7 @@ WindowManager::WindowManager( // Set up the GUI system mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath); gui = mGuiManager->getGui(); - + //Register own widgets with MyGUI MyGUI::FactoryManager::getInstance().registerFactory("Widget"); MyGUI::FactoryManager::getInstance().registerFactory("Widget"); diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index fd1e61021..03ffa6b59 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -22,7 +22,6 @@ #include #include "../mwmechanics/stat.hpp" -#include "../mwworld/ptr.hpp" #include "mode.hpp" @@ -39,7 +38,8 @@ namespace Compiler namespace MWWorld { - class World; + class Ptr; + class CellStore; } namespace MWMechanics @@ -181,7 +181,7 @@ namespace MWGui void setBounty (int bounty); ///< set the current bounty value void updateSkillArea(); ///< update display of skills, factions, birth sign, reputation and bounty - void changeCell(MWWorld::Ptr::CellStore* cell); ///< change the active cell + void changeCell(MWWorld::CellStore* cell); ///< change the active cell void setPlayerPos(const float x, const float y); ///< set player position in map space void setPlayerDir(const float x, const float y); ///< set player view direction in map space @@ -302,7 +302,7 @@ namespace MWGui /** * Called when MyGUI tries to retrieve a tag. This usually corresponds to a GMST string, - * so this method will retrieve the GMST with the name \a _tag and place the result in \a _result + * so this method will retrieve the GMST with the name \a _tag and place the result in \a _result */ void onRetrieveTag(const MyGUI::UString& _tag, MyGUI::UString& _result); }; diff --git a/apps/openmw/mwmechanics/actors.hpp b/apps/openmw/mwmechanics/actors.hpp index 1be29463f..82f8a943c 100644 --- a/apps/openmw/mwmechanics/actors.hpp +++ b/apps/openmw/mwmechanics/actors.hpp @@ -5,13 +5,17 @@ #include #include -#include "../mwworld/ptr.hpp" - namespace Ogre { class Vector3; } +namespace MWWorld +{ + class Ptr; + class CellStore; +} + namespace MWMechanics { class Actors @@ -35,7 +39,7 @@ namespace MWMechanics /// /// \note Ignored, if \a ptr is not a registered actor. - void dropActors (const MWWorld::Ptr::CellStore *cellStore); + void dropActors (const MWWorld::CellStore *cellStore); ///< Deregister all actors in the given cell. void update (std::vector >& movement, diff --git a/apps/openmw/mwmechanics/mechanicsmanager.hpp b/apps/openmw/mwmechanics/mechanicsmanager.hpp index 62bb4cf7e..97bb369fd 100644 --- a/apps/openmw/mwmechanics/mechanicsmanager.hpp +++ b/apps/openmw/mwmechanics/mechanicsmanager.hpp @@ -15,6 +15,11 @@ namespace Ogre class Vector3; } +namespace MWWorld +{ + class CellStore; +} + namespace MWMechanics { class MechanicsManager @@ -43,7 +48,7 @@ namespace MWMechanics void removeActor (const MWWorld::Ptr& ptr); ///< Deregister an actor for stats management - void dropActors (const MWWorld::Ptr::CellStore *cellStore); + void dropActors (const MWWorld::CellStore *cellStore); ///< Deregister all actors in the given cell. void watchActor (const MWWorld::Ptr& ptr); diff --git a/apps/openmw/mwrender/actors.hpp b/apps/openmw/mwrender/actors.hpp index c66492780..63cd3baa1 100644 --- a/apps/openmw/mwrender/actors.hpp +++ b/apps/openmw/mwrender/actors.hpp @@ -8,16 +8,22 @@ #include "components/nifogre/ogre_nif_loader.hpp" #include "../mwworld/refdata.hpp" -#include "../mwworld/ptr.hpp" #include "../mwworld/actiontalk.hpp" + #include "npcanimation.hpp" #include "creatureanimation.hpp" #include +namespace MWWorld +{ + class Ptr; + class CellStore; +} + namespace MWRender{ class Actors{ OEngine::Render::OgreRenderer &mRend; - std::map mCellSceneNodes; + std::map mCellSceneNodes; Ogre::SceneNode* mMwRoot; std::map mAllActors; @@ -33,7 +39,7 @@ namespace MWRender{ bool deleteObject (const MWWorld::Ptr& ptr); ///< \return found? - void removeCell(MWWorld::Ptr::CellStore* store); + void removeCell(MWWorld::CellStore* store); void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number = 1); diff --git a/apps/openmw/mwrender/debugging.hpp b/apps/openmw/mwrender/debugging.hpp index e12c0647c..d312b6d54 100644 --- a/apps/openmw/mwrender/debugging.hpp +++ b/apps/openmw/mwrender/debugging.hpp @@ -4,11 +4,15 @@ #include #include #include -#include "../mwworld/ptr.hpp" #include #include +namespace ESM +{ + struct Pathgrid; +} + namespace Ogre { class Camera; @@ -22,7 +26,8 @@ namespace Ogre namespace MWWorld { - class World; + class Ptr; + class CellStore; } namespace MWRender @@ -39,7 +44,7 @@ namespace MWRender void togglePathgrid(); - typedef std::vector CellList; + typedef std::vector CellList; CellList mActiveCells; Ogre::SceneNode *mMwRoot; @@ -50,8 +55,8 @@ namespace MWRender ExteriorPathgridNodes mExteriorPathgridNodes; Ogre::SceneNode *mInteriorPathgridNode; - void enableCellPathgrid(MWWorld::Ptr::CellStore *store); - void disableCellPathgrid(MWWorld::Ptr::CellStore *store); + void enableCellPathgrid(MWWorld::CellStore *store); + void disableCellPathgrid(MWWorld::CellStore *store); // utility void destroyCellPathgridNode(Ogre::SceneNode *node); @@ -70,8 +75,8 @@ namespace MWRender ~Debugging(); bool toggleRenderMode (int mode); - void cellAdded(MWWorld::Ptr::CellStore* store); - void cellRemoved(MWWorld::Ptr::CellStore* store); + void cellAdded(MWWorld::CellStore* store); + void cellRemoved(MWWorld::CellStore* store); }; diff --git a/apps/openmw/mwrender/localmap.hpp b/apps/openmw/mwrender/localmap.hpp index 9e03988f3..c5cd908fc 100644 --- a/apps/openmw/mwrender/localmap.hpp +++ b/apps/openmw/mwrender/localmap.hpp @@ -1,10 +1,15 @@ #ifndef _GAME_RENDER_LOCALMAP_H #define _GAME_RENDER_LOCALMAP_H -#include "../mwworld/ptr.hpp" - #include +#include + +namespace MWWorld +{ + class CellStore; +} + namespace MWRender { class RenderingManager; @@ -24,7 +29,7 @@ namespace MWRender * or rendered if it is not already cached. * @param exterior cell */ - void requestMap (MWWorld::Ptr::CellStore* cell); + void requestMap (MWWorld::CellStore* cell); /** * Request the local map for an interior cell. @@ -33,7 +38,7 @@ namespace MWRender * @param interior cell * @param bounding box of the cell */ - void requestMap (MWWorld::Ptr::CellStore* cell, + void requestMap (MWWorld::CellStore* cell, Ogre::AxisAlignedBox bounds); /** @@ -51,7 +56,7 @@ namespace MWRender * new cell, as well as when the game is quit. * @param current cell */ - void saveFogOfWar(MWWorld::Ptr::CellStore* cell); + void saveFogOfWar(MWWorld::CellStore* cell); private: OEngine::Render::OgreRenderer* mRendering; diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp index c78a98ef5..03bb925c3 100644 --- a/apps/openmw/mwrender/objects.cpp +++ b/apps/openmw/mwrender/objects.cpp @@ -4,6 +4,9 @@ #include #include + +#include "../mwworld/ptr.hpp" + #include "renderconst.hpp" using namespace MWRender; diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp index 05634e4b0..e240b11c9 100644 --- a/apps/openmw/mwrender/objects.hpp +++ b/apps/openmw/mwrender/objects.hpp @@ -1,10 +1,15 @@ #ifndef _GAME_RENDER_OBJECTS_H #define _GAME_RENDER_OBJECTS_H +#include + #include -#include "../mwworld/refdata.hpp" -#include "../mwworld/ptr.hpp" +namespace MWWorld +{ + class Ptr; + class CellStore; +} namespace MWRender{ @@ -45,10 +50,10 @@ struct LightInfo class Objects{ OEngine::Render::OgreRenderer &mRenderer; - std::map mCellSceneNodes; - std::map mStaticGeometry; - std::map mStaticGeometrySmall; - std::map mBounds; + std::map mCellSceneNodes; + std::map mStaticGeometry; + std::map mStaticGeometrySmall; + std::map mBounds; std::vector mLights; Ogre::SceneNode* mMwRoot; bool mIsStatic; @@ -79,14 +84,14 @@ public: void update (const float dt); ///< per-frame update - Ogre::AxisAlignedBox getDimensions(MWWorld::Ptr::CellStore*); + Ogre::AxisAlignedBox getDimensions(MWWorld::CellStore*); ///< get a bounding box that encloses all objects in the specified cell bool deleteObject (const MWWorld::Ptr& ptr); ///< \return found? - void removeCell(MWWorld::Ptr::CellStore* store); - void buildStaticGeometry(MWWorld::Ptr::CellStore &cell); + void removeCell(MWWorld::CellStore* store); + void buildStaticGeometry(MWWorld::CellStore &cell); void setMwRoot(Ogre::SceneNode* root); }; } diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 2c1b21dd5..9aaba3803 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -20,8 +20,6 @@ #include #include -#include "../mwworld/ptr.hpp" - #include #include "renderinginterface.hpp" @@ -41,7 +39,8 @@ namespace Ogre namespace MWWorld { - class World; + class Ptr; + class CellStore; } namespace MWRender @@ -79,18 +78,18 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList OEngine::Render::Fader* getFader(); - void removeCell (MWWorld::Ptr::CellStore *store); + void removeCell (MWWorld::CellStore *store); /// \todo this function should be removed later. Instead the rendering subsystems should track /// when rebatching is needed and update automatically at the end of each frame. - void cellAdded (MWWorld::Ptr::CellStore *store); - void waterAdded(MWWorld::Ptr::CellStore *store); + void cellAdded (MWWorld::CellStore *store); + void waterAdded(MWWorld::CellStore *store); void removeWater(); static const bool useMRT(); - void preCellChange (MWWorld::Ptr::CellStore* store); + void preCellChange (MWWorld::CellStore* store); ///< this event is fired immediately before changing cell void addObject (const MWWorld::Ptr& ptr); @@ -105,7 +104,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList void toggleWater(); /// \param store Cell the object was in previously (\a ptr has already been updated to the new cell). - void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store); + void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::CellStore *store); void update (float duration); @@ -136,13 +135,13 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList int skyGetMasserPhase() const; int skyGetSecundaPhase() const; void skySetMoonColour (bool red); - void configureAmbient(MWWorld::Ptr::CellStore &mCell); + void configureAmbient(MWWorld::CellStore &mCell); - void requestMap (MWWorld::Ptr::CellStore* cell); + void requestMap (MWWorld::CellStore* cell); ///< request the local map for a cell /// configure fog according to cell - void configureFog(MWWorld::Ptr::CellStore &mCell); + void configureFog(MWWorld::CellStore &mCell); /// configure fog manually void configureFog(const float density, const Ogre::ColourValue& colour); diff --git a/apps/openmw/mwrender/terrain.cpp b/apps/openmw/mwrender/terrain.cpp index 4678daa34..cbc2f33b6 100644 --- a/apps/openmw/mwrender/terrain.cpp +++ b/apps/openmw/mwrender/terrain.cpp @@ -3,6 +3,8 @@ #include #include +#include + #include #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwrender/terrain.hpp b/apps/openmw/mwrender/terrain.hpp index 0693c0cec..7ac48047d 100644 --- a/apps/openmw/mwrender/terrain.hpp +++ b/apps/openmw/mwrender/terrain.hpp @@ -3,9 +3,10 @@ #include #include -#include "terrainmaterial.hpp" -#include "../mwworld/ptr.hpp" +#include + +#include "terrainmaterial.hpp" namespace Ogre{ class SceneManager; @@ -14,6 +15,11 @@ namespace Ogre{ class Terrain; } +namespace MWWorld +{ + class CellStore; +} + namespace MWRender{ class RenderingManager; @@ -32,8 +38,8 @@ namespace MWRender{ void setDiffuse(const Ogre::ColourValue& diffuse); void setAmbient(const Ogre::ColourValue& ambient); - void cellAdded(MWWorld::Ptr::CellStore* store); - void cellRemoved(MWWorld::Ptr::CellStore* store); + void cellAdded(MWWorld::CellStore* store); + void cellRemoved(MWWorld::CellStore* store); private: Ogre::TerrainGlobalOptions* mTerrainGlobals; Ogre::TerrainGroup mTerrainGroup; diff --git a/apps/openmw/mwsound/soundmanager.hpp b/apps/openmw/mwsound/soundmanager.hpp index 562b2af00..ff360122b 100644 --- a/apps/openmw/mwsound/soundmanager.hpp +++ b/apps/openmw/mwsound/soundmanager.hpp @@ -130,7 +130,7 @@ namespace MWSound void stopSound3D(MWWorld::Ptr reference); ///< Stop the given object from playing all sounds. - void stopSound(const MWWorld::Ptr::CellStore *cell); + void stopSound(const MWWorld::CellStore *cell); ///< Stop all sounds for the given cell. void stopSound(const std::string& soundId); diff --git a/apps/openmw/mwworld/localscripts.hpp b/apps/openmw/mwworld/localscripts.hpp index 1ea2cf4d5..78f65e356 100644 --- a/apps/openmw/mwworld/localscripts.hpp +++ b/apps/openmw/mwworld/localscripts.hpp @@ -13,6 +13,8 @@ namespace ESMS namespace MWWorld { + class CellStore; + /// \brief List of active local scripts class LocalScripts { @@ -41,13 +43,13 @@ namespace MWWorld void add (const std::string& scriptName, const Ptr& ptr); ///< Add script to collection of active local scripts. - void addCell (Ptr::CellStore *cell); + void addCell (CellStore *cell); ///< Add all local scripts in a cell. void clear(); ///< Clear active local scripts collection. - void clearCell (Ptr::CellStore *cell); + void clearCell (CellStore *cell); ///< Remove all scripts belonging to \a cell. void remove (const Ptr& ptr); diff --git a/apps/openmw/mwworld/player.hpp b/apps/openmw/mwworld/player.hpp index 7521342cf..b1692bd81 100644 --- a/apps/openmw/mwworld/player.hpp +++ b/apps/openmw/mwworld/player.hpp @@ -21,11 +21,13 @@ namespace MWRender namespace MWWorld { + class CellStore; + /// \brief NPC object representing the player and additional player data class Player { LiveCellRef mPlayer; - MWWorld::Ptr::CellStore *mCellStore; + MWWorld::CellStore *mCellStore; MWRender::Player *mRenderer; std::string mName; bool mMale; @@ -46,7 +48,7 @@ namespace MWWorld /// Set where the player is looking at. Uses Morrowind (euler) angles void setRot(float x, float y, float z); - void setCell (MWWorld::Ptr::CellStore *cellStore) + void setCell (MWWorld::CellStore *cellStore) { mCellStore = cellStore; } diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 0ccb5218e..39496def3 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -338,7 +338,7 @@ namespace MWWorld /// \todo this whole code needs major clean up, and doesn't belong in this class. - void Scene::insertObject(MWWorld::Ptr ptr, Ptr::CellStore* cell) + void Scene::insertObject (const Ptr& ptr, CellStore* cell) { std::string type = ptr.getTypeName(); diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp index 52449a24d..64a8c9f8e 100644 --- a/apps/openmw/mwworld/scene.hpp +++ b/apps/openmw/mwworld/scene.hpp @@ -12,8 +12,6 @@ #include "../mwrender/renderinginterface.hpp" #include "physicssystem.hpp" -#include "refdata.hpp" -#include "ptr.hpp" #include "globals.hpp" namespace Ogre @@ -45,24 +43,25 @@ namespace MWRender namespace MWWorld { class Player; + class CellStore; + class Ptr; class Scene { - public: - typedef std::set CellStoreCollection; + typedef std::set CellStoreCollection; private: //OEngine::Render::OgreRenderer& mRenderer; - Ptr::CellStore* mCurrentCell; // the cell, the player is in + CellStore* mCurrentCell; // the cell, the player is in CellStoreCollection mActiveCells; bool mCellChanged; PhysicsSystem *mPhysics; MWRender::RenderingManager& mRendering; - void playerCellChange (Ptr::CellStore *cell, const ESM::Position& position, + void playerCellChange (CellStore *cell, const ESM::Position& position, bool adjustPlayerPos = true); @@ -74,13 +73,13 @@ namespace MWWorld void unloadCell (CellStoreCollection::iterator iter); - void loadCell (Ptr::CellStore *cell); + void loadCell (CellStore *cell); void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos); ///< Move from exterior to interior or from interior cell to a different /// interior cell. - Ptr::CellStore* getCurrentCell (); + CellStore* getCurrentCell (); const CellStoreCollection& getActiveCells () const; @@ -99,7 +98,7 @@ namespace MWWorld /// this method is only meant for dropping objects into the gameworld from a container /// and thus only handles object types that can be placed in a container - void insertObject(MWWorld::Ptr object, Ptr::CellStore* cell); + void insertObject (const Ptr& object, CellStore* cell); void update (float duration);