Issue #107: World is accessed only through the interface class from now on; some include cleanup

actorid
Marc Zinnschlag 13 years ago
parent 035c1c4b6e
commit 4c39fefd1e

@ -47,7 +47,7 @@ add_openmw_dir (mwsound
)
add_openmw_dir (mwworld
refdata world physicssystem scene globals class action nullaction actionteleport
refdata worldimp physicssystem scene globals class action nullaction actionteleport
containerstore actiontalk actiontake manualref player cellfunctors
cells localscripts customdata weather inventorystore ptr actionopen actionread
actionequip timestamp actionalchemy cellstore

@ -38,10 +38,10 @@
#include "mwsound/soundmanager.hpp"
#include "mwworld/world.hpp"
#include "mwworld/class.hpp"
#include "mwworld/player.hpp"
#include "mwworld/cellstore.hpp"
#include "mwworld/worldimp.hpp"
#include "mwclass/classes.hpp"
@ -51,6 +51,7 @@
#include "mwmechanics/mechanicsmanager.hpp"
#include "mwbase/environment.hpp"
#include "mwbase/world.hpp"
void OMW::Engine::executeLocalScripts()

@ -9,13 +9,13 @@
#include "../mwsound/soundmanager.hpp"
#include "../mwworld/world.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
#include "../mwdialogue/journal.hpp"
#include "../mwmechanics/mechanicsmanager.hpp"
#include "world.hpp"
MWBase::Environment *MWBase::Environment::sThis = 0;
MWBase::Environment::Environment()
@ -32,7 +32,7 @@ MWBase::Environment::~Environment()
sThis = 0;
}
void MWBase::Environment::setWorld (MWWorld::World *world)
void MWBase::Environment::setWorld (World *world)
{
mWorld = world;
}
@ -77,7 +77,7 @@ void MWBase::Environment::setFrameDuration (float duration)
mFrameDuration = duration;
}
MWWorld::World *MWBase::Environment::getWorld() const
MWBase::World *MWBase::Environment::getWorld() const
{
assert (mWorld);
return mWorld;

@ -32,13 +32,10 @@ namespace MWInput
struct MWInputManager;
}
namespace MWWorld
namespace MWBase
{
class World;
}
namespace MWBase
{
/// \brief Central hub for mw-subsystems
///
/// This class allows each mw-subsystem to access any others subsystem's top-level manager class.
@ -49,7 +46,7 @@ namespace MWBase
{
static Environment *sThis;
MWWorld::World *mWorld;
World *mWorld;
MWSound::SoundManager *mSoundManager;
MWScript::ScriptManager *mScriptManager;
MWGui::WindowManager *mWindowManager;
@ -71,7 +68,7 @@ namespace MWBase
~Environment();
void setWorld (MWWorld::World *world);
void setWorld (World *world);
void setSoundManager (MWSound::SoundManager *soundManager);
@ -90,7 +87,7 @@ namespace MWBase
void setFrameDuration (float duration);
///< Set length of current frame in seconds.
MWWorld::World *getWorld() const;
World *getWorld() const;
MWSound::SoundManager *getSoundManager() const;

@ -4,11 +4,11 @@
#include <components/esm/loadappa.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionalchemy.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwrender/objects.hpp"

@ -5,15 +5,15 @@
#include <components/esm/loadskil.hpp>
#include <components/esm/loadgmst.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwbase/environment.hpp"
#include "../mwrender/objects.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,10 +4,10 @@
#include <components/esm/loadbook.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actionread.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwrender/objects.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loadclot.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/tooltips.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loadcont.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/nullaction.hpp"
#include "../mwworld/containerstore.hpp"
#include "../mwworld/customdata.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loaddoor.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/nullaction.hpp"
#include "../mwworld/actionteleport.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,10 +4,10 @@
#include <components/esm/loadingr.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,13 +4,13 @@
#include <components/esm/loadligh.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/nullaction.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loadlocks.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -6,10 +6,10 @@
#include <components/esm/loadmisc.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -9,6 +9,9 @@
#include <components/esm/loadnpc.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/npcstats.hpp"
#include "../mwmechanics/movement.hpp"
@ -16,13 +19,12 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontalk.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/customdata.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwrender/actors.hpp"
#include "../mwbase/environment.hpp"
#include "../mwgui/window_manager.hpp"
namespace
{

@ -4,10 +4,10 @@
#include <components/esm/loadalch.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loadlocks.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,10 +4,10 @@
#include <components/esm/loadlocks.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -4,12 +4,12 @@
#include <components/esm/loadweap.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/actionequip.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwgui/window_manager.hpp"

@ -10,9 +10,9 @@
#include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/refdata.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/containerstore.hpp"
@ -121,24 +121,24 @@ namespace
}
template<typename T>
bool checkGlobal (char comp, const std::string& name, T value, MWWorld::World& world)
bool checkGlobal (char comp, const std::string& name, T value)
{
switch (world.getGlobalVariableType (name))
switch (MWBase::Environment::get().getWorld()->getGlobalVariableType (name))
{
case 's':
return selectCompare (comp, world.getGlobalVariable (name).mShort, value);
return selectCompare (comp, MWBase::Environment::get().getWorld()->getGlobalVariable (name).mShort, value);
case 'l':
return selectCompare (comp, world.getGlobalVariable (name).mLong, value);
return selectCompare (comp, MWBase::Environment::get().getWorld()->getGlobalVariable (name).mLong, value);
case 'f':
return selectCompare (comp, world.getGlobalVariable (name).mFloat, value);
return selectCompare (comp, MWBase::Environment::get().getWorld()->getGlobalVariable (name).mFloat, value);
case ' ':
world.getGlobalVariable (name); // trigger exception
MWBase::Environment::get().getWorld()->getGlobalVariable (name); // trigger exception
break;
default:
@ -309,12 +309,12 @@ namespace MWDialogue
if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
select.type==ESM::VT_Long)
{
if (!checkGlobal (comp, toLower (name), select.i, *MWBase::Environment::get().getWorld()))
if (!checkGlobal (comp, toLower (name), select.i))
return false;
}
else if (select.type==ESM::VT_Float)
{
if (!checkGlobal (comp, toLower (name), select.f, *MWBase::Environment::get().getWorld()))
if (!checkGlobal (comp, toLower (name), select.f))
return false;
}
else

@ -2,12 +2,11 @@
#include "journal.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/messagebox.hpp"
#include "../mwworld/world.hpp"
namespace MWDialogue
{
Quest& Journal::getQuest (const std::string& id)
@ -30,14 +29,13 @@ namespace MWDialogue
void Journal::addEntry (const std::string& id, int index)
{
StampedJournalEntry entry =
StampedJournalEntry::makeFromQuest (id, index, *MWBase::Environment::get().getWorld());
StampedJournalEntry entry = StampedJournalEntry::makeFromQuest (id, index);
mJournal.push_back (entry);
Quest& quest = getQuest (id);
quest.addEntry (entry, *MWBase::Environment::get().getWorld()); // we are doing slicing on purpose here
quest.addEntry (entry); // we are doing slicing on purpose here
std::vector<std::string> empty;
std::string notification = MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sJournalEntry")->str;
@ -48,7 +46,7 @@ namespace MWDialogue
{
Quest& quest = getQuest (id);
quest.setIndex (index, *MWBase::Environment::get().getWorld());
quest.setIndex (index);
}
void Journal::addTopic (const std::string& topicId, const std::string& infoId)
@ -63,7 +61,7 @@ namespace MWDialogue
iter = result.first;
}
iter->second.addEntry (JournalEntry (topicId, infoId), *MWBase::Environment::get().getWorld());
iter->second.addEntry (JournalEntry (topicId, infoId));
}
int Journal::getJournalIndex (const std::string& id) const

@ -5,7 +5,8 @@
#include <components/esm_store/store.hpp>
#include "../mwworld/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
namespace MWDialogue
{
@ -27,16 +28,14 @@ namespace MWDialogue
throw std::runtime_error ("unknown info ID " + mInfoId + " for topic " + mTopic);
}
JournalEntry JournalEntry::makeFromQuest (const std::string& topic, int index,
const MWWorld::World& world)
JournalEntry JournalEntry::makeFromQuest (const std::string& topic, int index)
{
return JournalEntry (topic, idFromIndex (topic, index, world));
return JournalEntry (topic, idFromIndex (topic, index));
}
std::string JournalEntry::idFromIndex (const std::string& topic, int index,
const MWWorld::World& world)
std::string JournalEntry::idFromIndex (const std::string& topic, int index)
{
const ESM::Dialogue *dialogue = world.getStore().dialogs.find (topic);
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (topic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter)
@ -57,13 +56,12 @@ namespace MWDialogue
: JournalEntry (topic, infoId), mDay (day), mMonth (month), mDayOfMonth (dayOfMonth)
{}
StampedJournalEntry StampedJournalEntry::makeFromQuest (const std::string& topic, int index,
const MWWorld::World& world)
StampedJournalEntry StampedJournalEntry::makeFromQuest (const std::string& topic, int index)
{
int day = world.getGlobalVariable ("dayspassed").mLong;
int month = world.getGlobalVariable ("day").mLong;
int dayOfMonth = world.getGlobalVariable ("month").mLong;
int day = MWBase::Environment::get().getWorld()->getGlobalVariable ("dayspassed").mLong;
int month = MWBase::Environment::get().getWorld()->getGlobalVariable ("day").mLong;
int dayOfMonth = MWBase::Environment::get().getWorld()->getGlobalVariable ("month").mLong;
return StampedJournalEntry (topic, idFromIndex (topic, index, world), day, month, dayOfMonth);
return StampedJournalEntry (topic, idFromIndex (topic, index), day, month, dayOfMonth);
}
}

@ -8,11 +8,6 @@ namespace ESMS
struct ESMStore;
}
namespace MWWorld
{
class World;
}
namespace MWDialogue
{
/// \brief A quest or dialogue entry
@ -27,11 +22,9 @@ namespace MWDialogue
std::string getText (const ESMS::ESMStore& store) const;
static JournalEntry makeFromQuest (const std::string& topic, int index,
const MWWorld::World& world);
static JournalEntry makeFromQuest (const std::string& topic, int index);
static std::string idFromIndex (const std::string& topic, int index,
const MWWorld::World& world);
static std::string idFromIndex (const std::string& topic, int index);
};
/// \biref A quest entry with a timestamp.
@ -46,8 +39,7 @@ namespace MWDialogue
StampedJournalEntry (const std::string& topic, const std::string& infoId,
int day, int month, int dayOfMonth);
static StampedJournalEntry makeFromQuest (const std::string& topic, int index,
const MWWorld::World& world);
static StampedJournalEntry makeFromQuest (const std::string& topic, int index);
};
}

@ -3,7 +3,8 @@
#include <components/esm_store/store.hpp>
#include "../mwworld/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
namespace MWDialogue
{
@ -15,9 +16,9 @@ namespace MWDialogue
: Topic (topic), mIndex (0), mFinished (false)
{}
const std::string Quest::getName (const MWWorld::World& world) const
const std::string Quest::getName() const
{
const ESM::Dialogue *dialogue = world.getStore().dialogs.find (mTopic);
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter)
@ -32,9 +33,9 @@ namespace MWDialogue
return mIndex;
}
void Quest::setIndex (int index, const MWWorld::World& world)
void Quest::setIndex (int index)
{
const ESM::Dialogue *dialogue = world.getStore().dialogs.find (mTopic);
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter)
@ -58,11 +59,11 @@ namespace MWDialogue
return mFinished;
}
void Quest::addEntry (const JournalEntry& entry, const MWWorld::World& world)
void Quest::addEntry (const JournalEntry& entry)
{
int index = -1;
const ESM::Dialogue *dialogue = world.getStore().dialogs.find (entry.mTopic);
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (entry.mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter)
@ -75,7 +76,7 @@ namespace MWDialogue
if (index==-1)
throw std::runtime_error ("unknown journal entry for topic " + mTopic);
setIndex (index, world);
setIndex (index);
for (TEntryIter iter (mEntries.begin()); iter!=mEntries.end(); ++iter)
if (*iter==entry.mInfoId)

@ -17,17 +17,17 @@ namespace MWDialogue
Quest (const std::string& topic);
const std::string getName (const MWWorld::World& world) const;
const std::string getName() const;
///< May be an empty string
int getIndex() const;
void setIndex (int index, const MWWorld::World& world);
void setIndex (int index);
///< Calling this function with a non-existant index while throw an exception.
bool isFinished() const;
virtual void addEntry (const JournalEntry& entry, const MWWorld::World& world);
virtual void addEntry (const JournalEntry& entry);
///< Add entry and adjust index accordingly.
///
/// \note Redundant entries are ignored, but the index is still adjusted.

@ -3,8 +3,6 @@
#include <components/esm_store/store.hpp>
#include "../mwworld/world.hpp"
namespace MWDialogue
{
Topic::Topic()
@ -17,7 +15,7 @@ namespace MWDialogue
Topic::~Topic()
{}
void Topic::addEntry (const JournalEntry& entry, const MWWorld::World& world)
void Topic::addEntry (const JournalEntry& entry)
{
if (entry.mTopic!=mTopic)
throw std::runtime_error ("topic does not match: " + mTopic);

@ -6,11 +6,6 @@
#include "journalentry.hpp"
namespace MWWorld
{
class World;
}
namespace MWDialogue
{
/// \brief Collection of seen responses for a topic
@ -34,7 +29,7 @@ namespace MWDialogue
virtual ~Topic();
virtual void addEntry (const JournalEntry& entry, const MWWorld::World& world);
virtual void addEntry (const JournalEntry& entry);
///< Add entry
///
/// \note Redundant entries are ignored.

@ -3,10 +3,12 @@
#include <boost/algorithm/string.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/manualref.hpp"
#include "../mwworld/containerstore.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp"

@ -3,10 +3,12 @@
#include "window_manager.hpp"
#include <components/esm_store/store.hpp>
#include "../mwbase/world.hpp"
#include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwmechanics/stat.hpp"
#include "../mwworld/world.hpp"
#include <components/esm_store/store.hpp>
namespace MWGui
{

@ -3,7 +3,7 @@
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
namespace MWGui
{

@ -3,6 +3,9 @@
#include <algorithm>
#include <components/esm_store/reclists.hpp>
#include <components/esm_store/store.hpp>
#include <components/compiler/exception.hpp>
#include "../mwscript/extensions.hpp"

@ -3,19 +3,23 @@
#include <cmath>
#include <algorithm>
#include <iterator>
#include <assert.h>
#include <cassert>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/manualref.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/containerstore.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/player.hpp"
#include "../mwclass/container.hpp"
#include "../mwinput/inputmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp"

@ -3,7 +3,7 @@
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
namespace MWGui
{
@ -77,7 +77,7 @@ namespace MWGui
{
if (_sender->getCaption() == "")
return;
unsigned int count;
try
{

@ -7,11 +7,13 @@
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwsound/soundmanager.hpp"
#include "inventorywindow.hpp"
#include "window_manager.hpp"
#include "container.hpp"
@ -239,7 +241,7 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
// drop item into the gameworld
MWWorld::Ptr object = *mDragAndDrop->mDraggedWidget->getUserData<MWWorld::Ptr>();
MWWorld::World* world = MWBase::Environment::get().getWorld();
MWBase::World* world = MWBase::Environment::get().getWorld();
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntPoint cursorPosition = MyGUI::InputManager::getInstance().getMousePosition();
@ -308,7 +310,7 @@ void HUD::onWorldMouseOver(MyGUI::Widget* _sender, int x, int y)
float mouseX = cursorPosition.left / float(viewSize.width);
float mouseY = cursorPosition.top / float(viewSize.height);
MWWorld::World* world = MWBase::Environment::get().getWorld();
MWBase::World* world = MWBase::Environment::get().getWorld();
// if we can't drop the object at the wanted position, show the "drop on ground" cursor.
bool canDrop = world->canPlaceObject(mouseX, mouseY);

@ -3,21 +3,24 @@
#include <cmath>
#include <algorithm>
#include <iterator>
#include <assert.h>
#include <iostream>
#include <cassert>
#include <boost/lexical_cast.hpp>
#include "../mwclass/container.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/containerstore.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/manualref.hpp"
#include "../mwworld/actiontake.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwclass/container.hpp"
#include "window_manager.hpp"
#include "widgets.hpp"
#include "bookwindow.hpp"
@ -171,7 +174,7 @@ namespace MWGui
/// \todo scripts
boost::shared_ptr<MWWorld::Action> action = MWWorld::Class::get(ptr).use(ptr);
action->execute();
// this is necessary for books/scrolls: if they are already in the player's inventory,

@ -1,11 +1,14 @@
#include "journalwindow.hpp"
#include "window_manager.hpp"
#include "../mwdialogue/journal.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwdialogue/journal.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp"
namespace
{
struct book

@ -1,9 +1,10 @@
#include "referenceinterface.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/player.hpp"
namespace MWGui
{
ReferenceInterface::ReferenceInterface()

@ -11,8 +11,12 @@
#include <components/settings/settings.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwrender/renderingmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwinput/inputmanager.hpp"
#include "window_manager.hpp"

@ -4,13 +4,18 @@
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include "../mwworld/world.hpp"
#include <components/esm_store/store.hpp>
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwbase/environment.hpp"
#include "../mwmechanics/spells.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/spellsuccess.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp"

@ -6,10 +6,13 @@
#include <boost/lexical_cast.hpp>
#include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/class.hpp"
#include "../mwmechanics/mechanicsmanager.hpp"
#include "window_manager.hpp"
#include "tooltips.hpp"
@ -539,7 +542,7 @@ void StatsWindow::updateSkillArea()
skillWidgets[skillWidgets.size()-1-i]->setUserString("ToolTipLayout", "TextToolTip");
skillWidgets[skillWidgets.size()-1-i]->setUserString("Caption_Text", "#{sSkillsMenuReputationHelp}");
}
addValueItem(mWindowManager.getGameSettingString("sBounty", "Bounty"),
boost::lexical_cast<std::string>(static_cast<int>(bounty)), "normal", coord1, coord2);

@ -1,15 +1,17 @@
#include "tooltips.hpp"
#include "window_manager.hpp"
#include "widgets.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/environment.hpp"
#include <boost/lexical_cast.hpp>
#include <components/settings/settings.hpp>
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/class.hpp"
#include "window_manager.hpp"
#include "widgets.hpp"
using namespace MWGui;
using namespace MyGUI;
@ -392,7 +394,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
/**
* \todo
* the various potion effects should appear in the tooltip depending if the player
* the various potion effects should appear in the tooltip depending if the player
* has enough skill in alchemy to know about the effects of this potion.
*/

@ -3,7 +3,8 @@
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/manualref.hpp"
#include "../mwsound/soundmanager.hpp"

@ -3,9 +3,10 @@
#include <cstdlib>
#include "../mwbase/environment.hpp"
#include <components/esm_store/store.hpp>
#include "../mwworld/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
namespace MWMechanics
{

@ -3,14 +3,14 @@
#include <components/esm_store/store.hpp>
#include "../mwgui/window_manager.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp"
namespace MWMechanics
{
void MechanicsManager::buildPlayer()

@ -1,11 +1,12 @@
#include "spells.hpp"
#include <components/esm_store/store.hpp>
#include <components/esm/loadspel.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "magiceffects.hpp"

@ -1,9 +1,11 @@
#ifndef MWMECHANICS_SPELLSUCCESS_H
#define MWMECHANICS_SPELLSUCCESS_H
#include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/class.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "npcstats.hpp"

@ -1,7 +1,7 @@
#include "creatureanimation.hpp"
#include "renderconst.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
using namespace Ogre;
using namespace NifOgre;

@ -1,18 +1,22 @@
#include "debugging.hpp"
#include <assert.h>
#include <cassert>
#include <OgreNode.h>
#include <OgreSceneManager.h>
#include <OgreMaterial.h>
#include <OgreMaterialManager.h>
#include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone
#include "../mwbase/environment.hpp"
#include "../mwworld/ptr.hpp"
#include <components/esm/loadstat.hpp>
#include <components/esm/loadpgrd.hpp>
#include <components/esm_store/store.hpp>
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
#include "../mwbase/environment.hpp"
#include "../mwworld/ptr.hpp"
#include "player.hpp"
using namespace Ogre;
@ -162,11 +166,11 @@ Debugging::~Debugging()
bool Debugging::toggleRenderMode (int mode){
switch (mode)
{
case MWWorld::World::Render_CollisionDebug:
case MWBase::World::Render_CollisionDebug:
return mEngine->toggleDebugRendering();
case MWWorld::World::Render_Pathgrid:
case MWBase::World::Render_Pathgrid:
togglePathgrid();
return mPathgridEnabled;
}

@ -1,13 +1,15 @@
#include "localmap.hpp"
#include "renderingmanager.hpp"
#include <OgreOverlayManager.h>
#include <OgreMaterialManager.h>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwgui/window_manager.hpp"
#include "renderconst.hpp"
#include <OgreOverlayManager.h>
#include <OgreMaterialManager.h>
#include "renderconst.hpp"
#include "renderingmanager.hpp"
using namespace MWRender;
using namespace Ogre;

@ -1,8 +1,9 @@
#include "npcanimation.hpp"
#include "../mwworld/world.hpp"
#include "renderconst.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "renderconst.hpp"
using namespace Ogre;
using namespace NifOgre;

@ -1,6 +1,6 @@
#include "renderingmanager.hpp"
#include <assert.h>
#include <cassert>
#include "OgreRoot.h"
#include "OgreRenderWindow.h"
@ -9,22 +9,24 @@
#include "OgreCamera.h"
#include "OgreTextureManager.h"
#include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone
#include "../mwworld/ptr.hpp"
#include "../mwworld/player.hpp"
#include "../mwbase/environment.hpp"
#include <components/esm/loadstat.hpp>
#include <components/settings/settings.hpp>
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
#include "../mwbase/environment.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/player.hpp"
#include "../mwgui/window_manager.hpp" // FIXME
#include "../mwinput/inputmanager.hpp" // FIXME
#include "shadows.hpp"
#include "shaderhelper.hpp"
#include "localmap.hpp"
#include "water.hpp"
#include "compositors.hpp"
#include "../mwgui/window_manager.hpp" // FIXME
#include "../mwinput/inputmanager.hpp" // FIXME
using namespace MWRender;
using namespace Ogre;
@ -298,9 +300,9 @@ void RenderingManager::skySetMoonColour (bool red){
bool RenderingManager::toggleRenderMode(int mode)
{
if (mode == MWWorld::World::Render_CollisionDebug || mode == MWWorld::World::Render_Pathgrid)
if (mode == MWBase::World::Render_CollisionDebug || mode == MWBase::World::Render_Pathgrid)
return mDebugging->toggleRenderMode(mode);
else if (mode == MWWorld::World::Render_Wireframe)
else if (mode == MWBase::World::Render_Wireframe)
{
if (mRendering.getCamera()->getPolygonMode() == PM_SOLID)
{

@ -11,7 +11,8 @@
#include <components/nifogre/ogre_nif_loader.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "renderconst.hpp"
#include "renderingmanager.hpp"

@ -1,16 +1,18 @@
#include <boost/lexical_cast.hpp>
#include <OgreTerrain.h>
#include <OgreTerrainGroup.h>
#include <boost/lexical_cast.hpp>
#include "../mwworld/world.hpp"
#include <components/settings/settings.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "terrainmaterial.hpp"
#include "terrain.hpp"
#include "renderconst.hpp"
#include "shadows.hpp"
#include <components/settings/settings.hpp>
#include "renderingmanager.hpp"
using namespace Ogre;

@ -16,6 +16,8 @@ namespace Ogre{
namespace MWRender{
class RenderingManager;
/**
* Implements the Morrowind terrain using the Ogre Terrain Component
*

@ -7,6 +7,8 @@
#include <components/interpreter/runtime.hpp>
#include <components/interpreter/opcodes.hpp>
#include "../mwworld/class.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "interpretercontext.hpp"

@ -9,7 +9,7 @@
#include <components/interpreter/runtime.hpp>
#include <components/interpreter/opcodes.hpp>
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "interpretercontext.hpp"
#include "ref.hpp"

@ -1,6 +1,8 @@
#include "cellextensions.hpp"
#include <components/esm_store/store.hpp>
#include <components/compiler/extensions.hpp>
#include <components/interpreter/interpreter.hpp>
@ -8,8 +10,8 @@
#include <components/interpreter/opcodes.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "interpretercontext.hpp"

@ -1,9 +1,13 @@
#include "compilercontext.hpp"
#include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/class.hpp"
#include "scriptmanager.hpp"

@ -10,6 +10,7 @@
#include "../mwbase/environment.hpp"
#include "../mwworld/player.hpp"
#include "../mwworld/class.hpp"
#include "../mwmechanics/npcstats.hpp"

@ -3,6 +3,9 @@
#include <cassert>
#include <components/esm_store/reclists.hpp>
#include <components/esm_store/store.hpp>
#include "interpretercontext.hpp"
#include "scriptmanager.hpp"

@ -3,13 +3,13 @@
#include <cmath>
#include <stdexcept>
#include <iostream>
#include <components/interpreter/types.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/class.hpp"
#include "../mwgui/window_manager.hpp"

@ -5,8 +5,9 @@
#include <components/interpreter/context.hpp>
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/action.hpp"
namespace MWSound

@ -1,6 +1,8 @@
#include "miscextensions.hpp"
#include <libs/openengine/ogre/fader.hpp>
#include <components/compiler/extensions.hpp>
#include <components/interpreter/interpreter.hpp>
@ -102,7 +104,7 @@ namespace MWScript
static_cast<InterpreterContext&> (runtime.getContext());
bool enabled =
MWBase::Environment::get().getWorld()->toggleRenderMode (MWWorld::World::Render_CollisionDebug);
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_CollisionDebug);
context.report (enabled ?
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
@ -119,7 +121,7 @@ namespace MWScript
static_cast<InterpreterContext&> (runtime.getContext());
bool enabled =
MWBase::Environment::get().getWorld()->toggleRenderMode (MWWorld::World::Render_Wireframe);
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_Wireframe);
context.report (enabled ?
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
@ -135,7 +137,7 @@ namespace MWScript
static_cast<InterpreterContext&> (runtime.getContext());
bool enabled =
MWBase::Environment::get().getWorld()->toggleRenderMode (MWWorld::World::Render_Pathgrid);
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_Pathgrid);
context.report (enabled ?
"Path Grid rendering -> On" : "Path Grid Rendering -> Off");

@ -6,9 +6,9 @@
#include <components/interpreter/runtime.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp"
#include "interpretercontext.hpp"

@ -8,8 +8,7 @@
#include <components/interpreter/opcodes.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwsound/soundmanager.hpp"

@ -9,10 +9,12 @@
#include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/player.hpp"
#include "../mwrender/player.hpp"
#include "sound_output.hpp"
#include "sound_decoder.hpp"
#include "sound.hpp"

@ -1,9 +1,11 @@
#include "actionequip.hpp"
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/player.hpp"
#include "../mwbase/world.hpp"
#include "inventorystore.hpp"
#include "player.hpp"
#include "class.hpp"
namespace MWWorld
{
@ -14,7 +16,7 @@ namespace MWWorld
void ActionEquip::execute ()
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWWorld::InventoryStore& invStore = static_cast<MWWorld::InventoryStore&>(MWWorld::Class::get(player).getContainerStore(player));
MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player);
// slots that this item can be equipped in
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(mObject).getEquipmentSlots(mObject);
@ -51,4 +53,3 @@ namespace MWWorld
}
}
}

@ -1,13 +1,14 @@
#include "actionopen.hpp"
#include "../mwbase/environment.hpp"
#include "class.hpp"
#include "world.hpp"
#include "containerstore.hpp"
#include "../mwclass/container.hpp"
#include "../mwgui/window_manager.hpp"
#include "../mwgui/container.hpp"
#include "class.hpp"
#include "containerstore.hpp"
namespace MWWorld
{
ActionOpen::ActionOpen (const MWWorld::Ptr& container) : mContainer (container) {

@ -2,10 +2,11 @@
#include "actiontake.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwgui/window_manager.hpp"
#include "class.hpp"
#include "world.hpp"
#include "containerstore.hpp"
namespace MWWorld

@ -2,8 +2,7 @@
#include "actionteleport.hpp"
#include "../mwbase/environment.hpp"
#include "world.hpp"
#include "../mwbase/world.hpp"
namespace MWWorld
{

@ -4,7 +4,9 @@
#include <algorithm>
#include "world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "class.hpp"
#include "containerstore.hpp"
@ -85,8 +87,8 @@ MWWorld::Ptr MWWorld::Cells::getPtrAndCache (const std::string& name, Ptr::CellS
return ptr;
}
MWWorld::Cells::Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader, MWWorld::World& world)
: mStore (store), mReader (reader), mWorld (world),
MWWorld::Cells::Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader)
: mStore (store), mReader (reader),
mIdCache (20, std::pair<std::string, Ptr::CellStore *> ("", 0)), /// \todo make cache size configurable
mIdCacheIndex (0)
{}
@ -111,11 +113,11 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getExterior (int x, int y)
record.water = 0;
record.mapColor = 0;
cell = mWorld.createRecord (record);
cell = MWBase::Environment::get().getWorld()->createRecord (record);
}
result = mExteriors.insert (std::make_pair (
std::make_pair (x, y), Ptr::CellStore (cell))).first;
std::make_pair (x, y), CellStore (cell))).first;
}
if (result->second.mState!=Ptr::CellStore::State_Loaded)

@ -18,39 +18,36 @@ namespace ESM
namespace MWWorld
{
class World;
/// \brief Cell container
class Cells
{
const ESMS::ESMStore& mStore;
ESM::ESMReader& mReader;
std::map<std::string, Ptr::CellStore> mInteriors;
std::map<std::pair<int, int>, Ptr::CellStore> mExteriors;
MWWorld::World& mWorld;
std::vector<std::pair<std::string, Ptr::CellStore *> > mIdCache;
std::map<std::string, CellStore> mInteriors;
std::map<std::pair<int, int>, CellStore> mExteriors;
std::vector<std::pair<std::string, CellStore *> > mIdCache;
std::size_t mIdCacheIndex;
Cells (const Cells&);
Cells& operator= (const Cells&);
Ptr::CellStore *getCellStore (const ESM::Cell *cell);
CellStore *getCellStore (const ESM::Cell *cell);
void fillContainers (Ptr::CellStore& cellStore);
void fillContainers (CellStore& cellStore);
Ptr getPtrAndCache (const std::string& name, Ptr::CellStore& cellStore);
Ptr getPtrAndCache (const std::string& name, CellStore& cellStore);
public:
Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader, MWWorld::World& world);
Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader);
///< \todo pass the dynamic part of the ESMStore isntead (once it is written) of the whole
/// world
Ptr::CellStore *getExterior (int x, int y);
CellStore *getExterior (int x, int y);
Ptr::CellStore *getInterior (const std::string& name);
CellStore *getInterior (const std::string& name);
Ptr getPtr (const std::string& name, Ptr::CellStore& cellStore);
Ptr getPtr (const std::string& name, CellStore& cellStore);
Ptr getPtr (const std::string& name);
};

@ -10,7 +10,7 @@
#include <components/esm/loadcont.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "manualref.hpp"
#include "refdata.hpp"

@ -7,8 +7,7 @@
#include <components/esm/loadench.hpp>
#include "../mwbase/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwmechanics/npcstats.hpp"

@ -1,18 +1,19 @@
#include "physicssystem.hpp"
#include <stdexcept>
#include "physicssystem.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/world.hpp" // FIXME
#include <components/nifbullet/bullet_nif_loader.hpp>
#include <OgreRoot.h>
#include <OgreRenderWindow.h>
#include <OgreSceneManager.h>
#include <OgreViewport.h>
#include <OgreCamera.h>
#include <OgreTextureManager.h>
#include "OgreRoot.h"
#include "OgreRenderWindow.h"
#include "OgreSceneManager.h"
#include "OgreViewport.h"
#include "OgreCamera.h"
#include "OgreTextureManager.h"
#include <components/nifbullet/bullet_nif_loader.hpp>
#include "../mwbase/world.hpp" // FIXME
#include "ptr.hpp"
using namespace Ogre;
namespace MWWorld

@ -1,18 +1,20 @@
#include "player.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwrender/player.hpp"
#include "../mwmechanics/movement.hpp"
#include "../mwmechanics/npcstats.hpp"
#include "world.hpp"
#include "class.hpp"
namespace MWWorld
{
Player::Player (MWRender::Player *renderer, const ESM::NPC *player, MWWorld::World& world) :
mCellStore (0), mRenderer (renderer), mWorld (world), mClass (0),
Player::Player (MWRender::Player *renderer, const ESM::NPC *player, const MWBase::World& world) :
mCellStore (0), mRenderer (renderer), mClass (0),
mAutoMove (false), mForwardBackward (0)
{
mPlayer.base = player;
@ -36,8 +38,8 @@ namespace MWWorld
void Player::setPos(float x, float y, float z)
{
/// \todo This fcuntion should be removed during the mwrender-refactoring.
mWorld.moveObject (getPlayer(), x, y, z);
/// \todo This fcuntion should be removed during the mwrender-refactoring.
MWBase::Environment::get().getWorld()->moveObject (getPlayer(), x, y, z);
}
void Player::setRot(float x, float y, float z)
@ -90,14 +92,13 @@ namespace MWWorld
MWWorld::Class::get (ptr).getMovementSettings (ptr).mForwardBackward = value;
}
void Player::setUpDown(int value)
{
MWWorld::Ptr ptr = getPlayer();
void Player::setUpDown(int value)
{
MWWorld::Ptr ptr = getPlayer();
MWWorld::Class::get (ptr).getMovementSettings (ptr).mUpDown = value;
}
}
void Player::toggleRunning()
{

@ -9,6 +9,11 @@
#include "../mwmechanics/drawstate.hpp"
namespace MWBase
{
class World;
}
namespace MWRender
{
class Player;
@ -16,15 +21,12 @@ namespace MWRender
namespace MWWorld
{
class World;
/// \brief NPC object representing the player and additional player data
class Player
{
LiveCellRef<ESM::NPC> mPlayer;
MWWorld::Ptr::CellStore *mCellStore;
MWRender::Player *mRenderer;
MWWorld::World& mWorld;
std::string mName;
bool mMale;
std::string mRace;
@ -34,7 +36,7 @@ namespace MWWorld
int mForwardBackward;
public:
Player(MWRender::Player *renderer, const ESM::NPC *player, MWWorld::World& world);
Player(MWRender::Player *renderer, const ESM::NPC *player, const MWBase::World& world);
~Player();

@ -1,7 +1,7 @@
#include "scene.hpp"
#include "world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" /// FIXME
#include "../mwmechanics/mechanicsmanager.hpp"
@ -9,12 +9,12 @@
#include "../mwgui/window_manager.hpp"
#include "../mwworld/world.hpp" /// FIXME
#include "../mwworld/manualref.hpp" /// FIXME
#include "ptr.hpp"
#include "player.hpp"
#include "class.hpp"
#include "localscripts.hpp"
#include "cellfunctors.hpp"
@ -86,7 +86,7 @@ namespace MWWorld
if (!((*iter)->cell->data.flags & ESM::Cell::Interior))
{
ESM::Land* land = mWorld->getStore().lands.search((*iter)->cell->data.gridX,(*iter)->cell->data.gridY);
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search((*iter)->cell->data.gridX,(*iter)->cell->data.gridY);
if (land)
mPhysics->removeHeightField( (*iter)->cell->data.gridX, (*iter)->cell->data.gridY );
}
@ -95,7 +95,7 @@ namespace MWWorld
mRendering.removeCell(*iter);
//mPhysics->removeObject("Unnamed_43");
mWorld->getLocalScripts().clearCell (*iter);
MWBase::Environment::get().getWorld()->getLocalScripts().clearCell (*iter);
MWBase::Environment::get().getMechanicsManager()->dropActors (*iter);
MWBase::Environment::get().getSoundManager()->stopSound (*iter);
mActiveCells.erase(*iter);
@ -107,7 +107,7 @@ namespace MWWorld
void Scene::loadCell (Ptr::CellStore *cell)
{
// register local scripts
mWorld->getLocalScripts().addCell (cell);
MWBase::Environment::get().getWorld()->getLocalScripts().addCell (cell);
@ -124,7 +124,7 @@ namespace MWWorld
if (!(cell->cell->data.flags & ESM::Cell::Interior))
{
ESM::Land* land = mWorld->getStore().lands.search(cell->cell->data.gridX,cell->cell->data.gridY);
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cell->cell->data.gridX,cell->cell->data.gridY);
if (land)
mPhysics->addHeightField (land->landData->heights,
cell->cell->data.gridX, cell->cell->data.gridY,
@ -146,14 +146,14 @@ namespace MWWorld
mPhysics->setCurrentWater(hasWater, cell->cell->water);
if (adjustPlayerPos)
{
mWorld->getPlayer().setPos (position.pos[0], position.pos[1], position.pos[2]);
mWorld->getPlayer().setRot (position.rot[0], position.rot[1], position.rot[2]);
MWBase::Environment::get().getWorld()->getPlayer().setPos (position.pos[0], position.pos[1], position.pos[2]);
MWBase::Environment::get().getWorld()->getPlayer().setRot (position.rot[0], position.rot[1], position.rot[2]);
}
mWorld->getPlayer().setCell (cell);
MWBase::Environment::get().getWorld()->getPlayer().setCell (cell);
MWBase::Environment::get().getMechanicsManager()->addActor (mWorld->getPlayer().getPlayer());
MWBase::Environment::get().getMechanicsManager()->watchActor (mWorld->getPlayer().getPlayer());
MWBase::Environment::get().getMechanicsManager()->addActor (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
MWBase::Environment::get().getMechanicsManager()->watchActor (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
MWBase::Environment::get().getWindowManager()->changeCell( mCurrentCell );
}
@ -163,7 +163,7 @@ namespace MWWorld
mRendering.preCellChange(mCurrentCell);
// remove active
MWBase::Environment::get().getMechanicsManager()->removeActor (mWorld->getPlayer().getPlayer());
MWBase::Environment::get().getMechanicsManager()->removeActor (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
CellStoreCollection::iterator active = mActiveCells.begin();
@ -202,7 +202,7 @@ namespace MWWorld
if (iter==mActiveCells.end())
{
Ptr::CellStore *cell = mWorld->getExterior(x, y);
CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);
loadCell (cell);
}
@ -228,10 +228,10 @@ namespace MWWorld
// adjust player
playerCellChange (mWorld->getExterior(X, Y), position, adjustPlayerPos);
playerCellChange (MWBase::Environment::get().getWorld()->getExterior(X, Y), position, adjustPlayerPos);
// Sky system
mWorld->adjustSky();
MWBase::Environment::get().getWorld()->adjustSky();
mRendering.switchToExterior();
@ -239,9 +239,8 @@ namespace MWWorld
}
//We need the ogre renderer and a scene node.
Scene::Scene (World *world, MWRender::RenderingManager& rendering, PhysicsSystem *physics)
: mCurrentCell (0), mCellChanged (false), mWorld(world),
mPhysics(physics), mRendering(rendering)
Scene::Scene (MWRender::RenderingManager& rendering, PhysicsSystem *physics)
: mCurrentCell (0), mCellChanged (false), mPhysics(physics), mRendering(rendering)
{
}
@ -263,7 +262,7 @@ namespace MWWorld
{
std::cout << "Changing to interior\n";
Ptr::CellStore *cell = mWorld->getInterior(cellName);
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
// remove active
CellStoreCollection::iterator active = mActiveCells.begin();
@ -287,7 +286,7 @@ namespace MWWorld
mRendering.configureFog(*cell);
// Sky system
mWorld->adjustSky();
MWBase::Environment::get().getWorld()->adjustSky();
mCellChanged = true;
}
@ -297,7 +296,7 @@ namespace MWWorld
int x = 0;
int y = 0;
mWorld->positionToIndex (position.pos[0], position.pos[1], x, y);
MWBase::Environment::get().getWorld()->positionToIndex (position.pos[0], position.pos[1], x, y);
changeCell (x, y, position, true);
}

@ -59,7 +59,6 @@ namespace MWWorld
Ptr::CellStore* mCurrentCell; // the cell, the player is in
CellStoreCollection mActiveCells;
bool mCellChanged;
World *mWorld;
PhysicsSystem *mPhysics;
MWRender::RenderingManager& mRendering;
@ -69,7 +68,7 @@ namespace MWWorld
public:
Scene (World *world, MWRender::RenderingManager& rendering, PhysicsSystem *physics);
Scene (MWRender::RenderingManager& rendering, PhysicsSystem *physics);
~Scene();

@ -1,9 +1,4 @@
#include "weather.hpp"
#include "world.hpp"
#include "player.hpp"
#include "../mwrender/renderingmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include <ctime>
#include <cstdlib>
@ -12,6 +7,13 @@
#include <boost/algorithm/string.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwrender/renderingmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "player.hpp"
using namespace Ogre;
using namespace MWWorld;

@ -1,4 +1,4 @@
#include "world.hpp"
#include "worldimp.hpp"
#include <cmath>
#include <iostream>
@ -179,7 +179,7 @@ namespace MWWorld
const std::string& master, const boost::filesystem::path& resDir, bool newGame,
const std::string& encoding, std::map<std::string,std::string> fallbackMap)
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
mSky (true), mNextDynamicRecord (0), mCells (mStore, mEsm, *this),
mSky (true), mNextDynamicRecord (0), mCells (mStore, mEsm),
mNumFacing(0)
{
mPhysics = new PhysicsSystem(renderer);
@ -211,7 +211,7 @@ namespace MWWorld
mGlobalVariables->setInt ("chargenstate", 1);
}
mWorldScene = new Scene(this, *mRendering, mPhysics);
mWorldScene = new Scene(*mRendering, mPhysics);
setFallbackValues(fallbackMap);

@ -1,5 +1,5 @@
#ifndef GAME_MWWORLD_WORLD_H
#define GAME_MWWORLD_WORLD_H
#ifndef GAME_MWWORLD_WORLDIMP_H
#define GAME_MWWORLD_WORLDIMP_H
#include <vector>
#include <map>

@ -4,7 +4,6 @@
#include <btBulletDynamicsCommon.h>
#include <btBulletCollisionCommon.h>
#include <components/nifbullet/bullet_nif_loader.hpp>
//#include <apps\openmw\mwworld\world.hpp>
namespace OEngine {
namespace Physic

@ -3,7 +3,6 @@
#include <btBulletCollisionCommon.h>
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>
#include <components/nifbullet/bullet_nif_loader.hpp>
//#include <apps\openmw\mwworld\world.hpp>
#include "CMotionState.h"
#include "OgreRoot.h"
#include "btKinematicCharacterController.h"
@ -286,7 +285,7 @@ namespace Physic
minh = h;
maxh = h;
}
if (h>maxh) maxh = h;
if (h<minh) minh = h;
}

@ -5,12 +5,11 @@
#include <btBulletDynamicsCommon.h>
#include <btBulletCollisionCommon.h>
#include <components/nifbullet/bullet_nif_loader.hpp>
//#include <apps\openmw\mwworld\world.hpp>
#include <openengine/bullet/pmove.h>
#include <openengine/bullet/physic.hpp>
enum traceWorldType
{
collisionWorldTrace = 1,
@ -33,7 +32,7 @@ struct NewPhysTraceResults
float fraction;
bool startSolid;
//const Object* hitObj;
};
};
struct traceResults
{
Ogre::Vector3 endpos;

Loading…
Cancel
Save