Issue #107: Ptr related include cleanup

actorid
Marc Zinnschlag 13 years ago
parent 5a7b95bf7a
commit 87667ab57e

@ -22,7 +22,7 @@ namespace MWGui
MWWorld::Ptr mPtr;
private:
MWWorld::Ptr::CellStore* mCurrentPlayerCell;
MWWorld::CellStore* mCurrentPlayerCell;
};
}

@ -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 <components/settings/settings.hpp>
#include <assert.h>
#include <iostream>
#include <cassert>
#include <iterator>
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<DialogueHistory>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSkill>("Widget");

@ -22,7 +22,6 @@
#include <openengine/gui/manager.hpp>
#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);
};

@ -5,13 +5,17 @@
#include <vector>
#include <string>
#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<std::pair<std::string, Ogre::Vector3> >& movement,

@ -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);

@ -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 <openengine/bullet/physic.hpp>
namespace MWWorld
{
class Ptr;
class CellStore;
}
namespace MWRender{
class Actors{
OEngine::Render::OgreRenderer &mRend;
std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
std::map<MWWorld::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
Ogre::SceneNode* mMwRoot;
std::map<MWWorld::Ptr, Animation*> 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);

@ -4,11 +4,15 @@
#include <utility>
#include <openengine/ogre/renderer.hpp>
#include <openengine/bullet/physic.hpp>
#include "../mwworld/ptr.hpp"
#include <vector>
#include <string>
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<MWWorld::Ptr::CellStore *> CellList;
typedef std::vector<MWWorld::CellStore *> 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);
};

@ -1,10 +1,15 @@
#ifndef _GAME_RENDER_LOCALMAP_H
#define _GAME_RENDER_LOCALMAP_H
#include "../mwworld/ptr.hpp"
#include <openengine/ogre/renderer.hpp>
#include <OgreAxisAlignedBox.h>
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;

@ -4,6 +4,9 @@
#include <components/nifogre/ogre_nif_loader.hpp>
#include <components/settings/settings.hpp>
#include "../mwworld/ptr.hpp"
#include "renderconst.hpp"
using namespace MWRender;

@ -1,10 +1,15 @@
#ifndef _GAME_RENDER_OBJECTS_H
#define _GAME_RENDER_OBJECTS_H
#include <OgreColourValue.h>
#include <openengine/ogre/renderer.hpp>
#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<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometry;
std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometrySmall;
std::map<MWWorld::Ptr::CellStore *, Ogre::AxisAlignedBox> mBounds;
std::map<MWWorld::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
std::map<MWWorld::CellStore *, Ogre::StaticGeometry*> mStaticGeometry;
std::map<MWWorld::CellStore *, Ogre::StaticGeometry*> mStaticGeometrySmall;
std::map<MWWorld::CellStore *, Ogre::AxisAlignedBox> mBounds;
std::vector<LightInfo> 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);
};
}

@ -20,8 +20,6 @@
#include <vector>
#include <string>
#include "../mwworld/ptr.hpp"
#include <boost/filesystem.hpp>
#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);

@ -3,6 +3,8 @@
#include <OgreTerrain.h>
#include <OgreTerrainGroup.h>
#include <components/esm_store/store.hpp>
#include <components/settings/settings.hpp>
#include "../mwbase/environment.hpp"

@ -3,9 +3,10 @@
#include <OgreTerrain.h>
#include <OgreTerrainGroup.h>
#include "terrainmaterial.hpp"
#include "../mwworld/ptr.hpp"
#include <components/esm/loadland.hpp>
#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;

@ -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);

@ -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);

@ -21,11 +21,13 @@ namespace MWRender
namespace MWWorld
{
class CellStore;
/// \brief NPC object representing the player and additional player data
class Player
{
LiveCellRef<ESM::NPC> 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;
}

@ -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();

@ -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<Ptr::CellStore *> CellStoreCollection;
typedef std::set<CellStore *> 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);

Loading…
Cancel
Save