Merge branch 'decouple' into player_control

Conflicts:
	apps/openmw/mwsound/soundmanagerimp.hpp
This commit is contained in:
Marc Zinnschlag 2012-08-09 16:12:10 +02:00
commit aca08eb4c2
63 changed files with 546 additions and 295 deletions

View file

@ -33,18 +33,18 @@ add_openmw_dir (mwgui
) )
add_openmw_dir (mwdialogue add_openmw_dir (mwdialogue
dialoguemanager journal journalentry quest topic dialoguemanagerimp journalimp journalentry quest topic
) )
add_openmw_dir (mwscript add_openmw_dir (mwscript
locals scriptmanager compilercontext interpretercontext cellextensions miscextensions locals scriptmanagerimp compilercontext interpretercontext cellextensions miscextensions
guiextensions soundextensions skyextensions statsextensions containerextensions guiextensions soundextensions skyextensions statsextensions containerextensions
aiextensions controlextensions extensions globalscripts ref dialogueextensions aiextensions controlextensions extensions globalscripts ref dialogueextensions
animationextensions transformationextensions consoleextensions userextensions animationextensions transformationextensions consoleextensions userextensions
) )
add_openmw_dir (mwsound add_openmw_dir (mwsound
soundmanager openal_output audiere_decoder mpgsnd_decoder ffmpeg_decoder soundmanagerimp openal_output audiere_decoder mpgsnd_decoder ffmpeg_decoder
) )
add_openmw_dir (mwworld add_openmw_dir (mwworld
@ -65,7 +65,7 @@ add_openmw_dir (mwmechanics
) )
add_openmw_dir (mwbase add_openmw_dir (mwbase
environment world environment world scriptmanager dialoguemanager journal soundmanager
) )
# Main executable # Main executable

View file

@ -18,10 +18,10 @@
#include "mwgui/window_manager.hpp" #include "mwgui/window_manager.hpp"
#include "mwgui/cursorreplace.hpp" #include "mwgui/cursorreplace.hpp"
#include "mwscript/scriptmanager.hpp" #include "mwscript/scriptmanagerimp.hpp"
#include "mwscript/extensions.hpp" #include "mwscript/extensions.hpp"
#include "mwsound/soundmanager.hpp" #include "mwsound/soundmanagerimp.hpp"
#include "mwworld/class.hpp" #include "mwworld/class.hpp"
#include "mwworld/player.hpp" #include "mwworld/player.hpp"
@ -29,8 +29,8 @@
#include "mwclass/classes.hpp" #include "mwclass/classes.hpp"
#include "mwdialogue/dialoguemanager.hpp" #include "mwdialogue/dialoguemanagerimp.hpp"
#include "mwdialogue/journal.hpp" #include "mwdialogue/journalimp.hpp"
#include "mwmechanics/mechanicsmanager.hpp" #include "mwmechanics/mechanicsmanager.hpp"

View file

@ -0,0 +1,46 @@
#ifndef GAME_MWBASE_DIALOGUEMANAGER_H
#define GAME_MWBASE_DIALOGUEMANAGER_H
#include <string>
namespace MWWorld
{
class Ptr;
}
namespace MWBase
{
/// \brief Interface for dialogue manager (implemented in MWDialogue)
class DialogueManager
{
DialogueManager (const DialogueManager&);
///< not implemented
DialogueManager& operator= (const DialogueManager&);
///< not implemented
public:
DialogueManager() {}
virtual ~DialogueManager() {}
virtual void startDialogue (const MWWorld::Ptr& actor) = 0;
virtual void addTopic (const std::string& topic) = 0;
virtual void askQuestion (const std::string& question,int choice) = 0;
virtual void goodbye() = 0;
///get the faction of the actor you are talking with
virtual std::string getFaction() const = 0;
//calbacks for the GUI
virtual void keywordSelected (const std::string& keyword) = 0;
virtual void goodbyeSelected() = 0;
virtual void questionAnswered (const std::string& answer) = 0;
};
}
#endif

View file

@ -5,16 +5,13 @@
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
#include "../mwscript/scriptmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
#include "../mwdialogue/journal.hpp"
#include "../mwmechanics/mechanicsmanager.hpp" #include "../mwmechanics/mechanicsmanager.hpp"
#include "world.hpp" #include "world.hpp"
#include "scriptmanager.hpp"
#include "dialoguemanager.hpp"
#include "journal.hpp"
#include "soundmanager.hpp"
MWBase::Environment *MWBase::Environment::sThis = 0; MWBase::Environment *MWBase::Environment::sThis = 0;
@ -37,12 +34,12 @@ void MWBase::Environment::setWorld (World *world)
mWorld = world; mWorld = world;
} }
void MWBase::Environment::setSoundManager (MWSound::SoundManager *soundManager) void MWBase::Environment::setSoundManager (SoundManager *soundManager)
{ {
mSoundManager = soundManager; mSoundManager = soundManager;
} }
void MWBase::Environment::setScriptManager (MWScript::ScriptManager *scriptManager) void MWBase::Environment::setScriptManager (ScriptManager *scriptManager)
{ {
mScriptManager = scriptManager; mScriptManager = scriptManager;
} }
@ -57,12 +54,12 @@ void MWBase::Environment::setMechanicsManager (MWMechanics::MechanicsManager *me
mMechanicsManager = mechanicsManager; mMechanicsManager = mechanicsManager;
} }
void MWBase::Environment::setDialogueManager (MWDialogue::DialogueManager *dialogueManager) void MWBase::Environment::setDialogueManager (DialogueManager *dialogueManager)
{ {
mDialogueManager = dialogueManager; mDialogueManager = dialogueManager;
} }
void MWBase::Environment::setJournal (MWDialogue::Journal *journal) void MWBase::Environment::setJournal (Journal *journal)
{ {
mJournal = journal; mJournal = journal;
} }
@ -83,13 +80,13 @@ MWBase::World *MWBase::Environment::getWorld() const
return mWorld; return mWorld;
} }
MWSound::SoundManager *MWBase::Environment::getSoundManager() const MWBase::SoundManager *MWBase::Environment::getSoundManager() const
{ {
assert (mSoundManager); assert (mSoundManager);
return mSoundManager; return mSoundManager;
} }
MWScript::ScriptManager *MWBase::Environment::getScriptManager() const MWBase::ScriptManager *MWBase::Environment::getScriptManager() const
{ {
assert (mScriptManager); assert (mScriptManager);
return mScriptManager; return mScriptManager;
@ -107,13 +104,13 @@ MWMechanics::MechanicsManager *MWBase::Environment::getMechanicsManager() const
return mMechanicsManager; return mMechanicsManager;
} }
MWDialogue::DialogueManager *MWBase::Environment::getDialogueManager() const MWBase::DialogueManager *MWBase::Environment::getDialogueManager() const
{ {
assert (mDialogueManager); assert (mDialogueManager);
return mDialogueManager; return mDialogueManager;
} }
MWDialogue::Journal *MWBase::Environment::getJournal() const MWBase::Journal *MWBase::Environment::getJournal() const
{ {
assert (mJournal); assert (mJournal);
return mJournal; return mJournal;

View file

@ -1,16 +1,6 @@
#ifndef GAME_BASE_INVIRONMENT_H #ifndef GAME_BASE_INVIRONMENT_H
#define GAME_BASE_INVIRONMENT_H #define GAME_BASE_INVIRONMENT_H
namespace MWSound
{
class SoundManager;
}
namespace MWScript
{
class ScriptManager;
}
namespace MWGui namespace MWGui
{ {
class WindowManager; class WindowManager;
@ -21,12 +11,6 @@ namespace MWMechanics
class MechanicsManager; class MechanicsManager;
} }
namespace MWDialogue
{
class DialogueManager;
class Journal;
}
namespace MWInput namespace MWInput
{ {
struct MWInputManager; struct MWInputManager;
@ -35,6 +19,10 @@ namespace MWInput
namespace MWBase namespace MWBase
{ {
class World; class World;
class ScriptManager;
class DialogueManager;
class Journal;
class SoundManager;
/// \brief Central hub for mw-subsystems /// \brief Central hub for mw-subsystems
/// ///
@ -47,12 +35,12 @@ namespace MWBase
static Environment *sThis; static Environment *sThis;
World *mWorld; World *mWorld;
MWSound::SoundManager *mSoundManager; SoundManager *mSoundManager;
MWScript::ScriptManager *mScriptManager; ScriptManager *mScriptManager;
MWGui::WindowManager *mWindowManager; MWGui::WindowManager *mWindowManager;
MWMechanics::MechanicsManager *mMechanicsManager; MWMechanics::MechanicsManager *mMechanicsManager;
MWDialogue::DialogueManager *mDialogueManager; DialogueManager *mDialogueManager;
MWDialogue::Journal *mJournal; Journal *mJournal;
MWInput::MWInputManager *mInputManager; MWInput::MWInputManager *mInputManager;
float mFrameDuration; float mFrameDuration;
@ -70,17 +58,17 @@ namespace MWBase
void setWorld (World *world); void setWorld (World *world);
void setSoundManager (MWSound::SoundManager *soundManager); void setSoundManager (SoundManager *soundManager);
void setScriptManager (MWScript::ScriptManager *scriptManager); void setScriptManager (MWBase::ScriptManager *scriptManager);
void setWindowManager (MWGui::WindowManager *windowManager); void setWindowManager (MWGui::WindowManager *windowManager);
void setMechanicsManager (MWMechanics::MechanicsManager *mechanicsManager); void setMechanicsManager (MWMechanics::MechanicsManager *mechanicsManager);
void setDialogueManager (MWDialogue::DialogueManager *dialogueManager); void setDialogueManager (DialogueManager *dialogueManager);
void setJournal (MWDialogue::Journal *journal); void setJournal (Journal *journal);
void setInputManager (MWInput::MWInputManager *inputManager); void setInputManager (MWInput::MWInputManager *inputManager);
@ -89,17 +77,17 @@ namespace MWBase
World *getWorld() const; World *getWorld() const;
MWSound::SoundManager *getSoundManager() const; SoundManager *getSoundManager() const;
MWScript::ScriptManager *getScriptManager() const; MWBase::ScriptManager *getScriptManager() const;
MWGui::WindowManager *getWindowManager() const; MWGui::WindowManager *getWindowManager() const;
MWMechanics::MechanicsManager *getMechanicsManager() const; MWMechanics::MechanicsManager *getMechanicsManager() const;
MWDialogue::DialogueManager *getDialogueManager() const; DialogueManager *getDialogueManager() const;
MWDialogue::Journal *getJournal() const; Journal *getJournal() const;
MWInput::MWInputManager *getInputManager() const; MWInput::MWInputManager *getInputManager() const;

View file

@ -0,0 +1,76 @@
#ifndef GAME_MWBASE_JOURNAL_H
#define GAME_MWBASE_JOURNAL_H
#include <string>
#include <deque>
#include <map>
namespace MWDialogue
{
class Quest;
class Topic;
struct StampedJournalEntry;
}
namespace MWBase
{
/// \brief Interface for the player's journal (implemented in MWDialogue)
class Journal
{
Journal (const Journal&);
///< not implemented
Journal& operator= (const Journal&);
///< not implemented
public:
typedef std::deque<MWDialogue::StampedJournalEntry> TEntryContainer;
typedef TEntryContainer::const_iterator TEntryIter;
typedef std::map<std::string, MWDialogue::Quest> TQuestContainer; // topc, quest
typedef TQuestContainer::const_iterator TQuestIter;
typedef std::map<std::string, MWDialogue::Topic> TTopicContainer; // topic-id, topic-content
typedef TTopicContainer::const_iterator TTopicIter;
public:
Journal() {}
virtual ~Journal() {}
virtual void addEntry (const std::string& id, int index) = 0;
///< Add a journal entry.
virtual void setJournalIndex (const std::string& id, int index) = 0;
///< Set the journal index without adding an entry.
virtual int getJournalIndex (const std::string& id) const = 0;
///< Get the journal index.
virtual void addTopic (const std::string& topicId, const std::string& infoId) = 0;
virtual TEntryIter begin() const = 0;
///< Iterator pointing to the begin of the main journal.
///
/// \note Iterators to main journal entries will never become invalid.
virtual TEntryIter end() const = 0;
///< Iterator pointing past the end of the main journal.
virtual TQuestIter questBegin() const = 0;
///< Iterator pointing to the first quest (sorted by topic ID)
virtual TQuestIter questEnd() const = 0;
///< Iterator pointing past the last quest.
virtual TTopicIter topicBegin() const = 0;
///< Iterator pointing to the first topic (sorted by topic ID)
///
/// \note The topic ID is identical with the user-visible topic string.
virtual TTopicIter topicEnd() const = 0;
///< Iterator pointing past the last topic.
};
}
#endif

View file

@ -0,0 +1,62 @@
#ifndef GAME_MWBASE_SCRIPTMANAGER_H
#define GAME_MWBASE_SCRIPTMANAGER_H
#include <string>
namespace Interpreter
{
class Context;
}
namespace Compiler
{
class Locals;
}
namespace MWScript
{
class GlobalScripts;
}
namespace MWBase
{
/// \brief Interface for script manager (implemented in MWScript)
class ScriptManager
{
ScriptManager (const ScriptManager&);
///< not implemented
ScriptManager& operator= (const ScriptManager&);
///< not implemented
public:
ScriptManager() {}
virtual ~ScriptManager() {}
virtual void run (const std::string& name, Interpreter::Context& interpreterContext) = 0;
///< Run the script with the given name (compile first, if not compiled yet)
virtual bool compile (const std::string& name) = 0;
///< Compile script with the given namen
/// \return Success?
virtual std::pair<int, int> compileAll() = 0;
///< Compile all scripts
/// \return count, success
virtual Compiler::Locals& getLocals (const std::string& name) = 0;
///< Return locals for script \a name.
virtual MWScript::GlobalScripts& getGlobalScripts() = 0;
virtual int getLocalIndex (const std::string& scriptId, const std::string& variable,
char type) = 0;
///< Return index of the variable of the given name and type in the given script. Will
/// throw an exception, if there is no such script or variable or the type does not match.
};
}
#endif

View file

@ -0,0 +1,129 @@
#ifndef GAME_MWBASE_SOUNDMANAGER_H
#define GAME_MWBASE_SOUNDMANAGER_H
#include <string>
#include <boost/shared_ptr.hpp>
#include <components/settings/settings.hpp>
#include "../mwworld/ptr.hpp"
namespace Ogre
{
class Vector3;
}
namespace MWWorld
{
class CellStore;
}
namespace MWSound
{
class Sound;
}
namespace MWBase
{
typedef boost::shared_ptr<MWSound::Sound> SoundPtr;
/// \brief Interface for sound manager (implemented in MWSound)
class SoundManager
{
public:
enum PlayMode {
Play_Normal = 0, /* tracked, non-looping, multi-instance, environment */
Play_Loop = 1<<0, /* Sound will continually loop until explicitly stopped */
Play_NoEnv = 1<<1, /* Do not apply environment effects (eg, underwater filters) */
Play_NoTrack = 1<<2, /* (3D only) Play the sound at the given object's position
* but do not keep it updated (the sound will not move with
* the object and will not stop when the object is deleted. */
};
private:
SoundManager (const SoundManager&);
///< not implemented
SoundManager& operator= (const SoundManager&);
///< not implemented
public:
SoundManager() {}
virtual ~SoundManager() {}
virtual void processChangedSettings(const Settings::CategorySettingVector& settings) = 0;
virtual void stopMusic() = 0;
///< Stops music if it's playing
virtual void streamMusic(const std::string& filename) = 0;
///< Play a soundifle
/// \param filename name of a sound file in "Music/" in the data directory.
virtual void startRandomTitle() = 0;
///< Starts a random track from the current playlist
virtual bool isMusicPlaying() = 0;
///< Returns true if music is playing
virtual void playPlaylist(const std::string &playlist) = 0;
///< Start playing music from the selected folder
/// \param name of the folder that contains the playlist
virtual void say(MWWorld::Ptr reference, const std::string& filename) = 0;
///< Make an actor say some text.
/// \param filename name of a sound file in "Sound/" in the data directory.
virtual void say(const std::string& filename) = 0;
///< Say some text, without an actor ref
/// \param filename name of a sound file in "Sound/" in the data directory.
virtual bool sayDone(MWWorld::Ptr reference=MWWorld::Ptr()) const = 0;
///< Is actor not speaking?
virtual void stopSay(MWWorld::Ptr reference=MWWorld::Ptr()) = 0;
///< Stop an actor speaking
virtual SoundPtr playSound(const std::string& soundId, float volume, float pitch,
int mode=Play_Normal) = 0;
///< Play a sound, independently of 3D-position
virtual SoundPtr playSound3D(MWWorld::Ptr reference, const std::string& soundId,
float volume, float pitch, int mode=Play_Normal) = 0;
///< Play a sound from an object
virtual void stopSound3D(MWWorld::Ptr reference, const std::string& soundId) = 0;
///< Stop the given object from playing the given sound,
virtual void stopSound3D(MWWorld::Ptr reference) = 0;
///< Stop the given object from playing all sounds.
virtual void stopSound(const MWWorld::CellStore *cell) = 0;
///< Stop all sounds for the given cell.
virtual void stopSound(const std::string& soundId) = 0;
///< Stop a non-3d looping sound
virtual bool getSoundPlaying(MWWorld::Ptr reference, const std::string& soundId) const = 0;
///< Is the given sound currently playing on the given object?
virtual void updateObject(MWWorld::Ptr reference) = 0;
///< Update the position of all sounds connected to the given object.
virtual void update(float duration) = 0;
virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir) = 0;
};
inline int operator|(SoundManager::PlayMode a, SoundManager::PlayMode b)
{ return static_cast<int> (a) | static_cast<int> (b); }
inline int operator&(SoundManager::PlayMode a, SoundManager::PlayMode b)
{ return static_cast<int> (a) & static_cast<int> (b); }
}
#endif

View file

@ -46,6 +46,7 @@ namespace MWWorld
namespace MWBase namespace MWBase
{ {
/// \brief Interface for the World (implemented in MWWorld)
class World class World
{ {
World (const World&); World (const World&);
@ -54,14 +55,6 @@ namespace MWBase
World& operator= (const World&); World& operator= (const World&);
///< not implemented ///< not implemented
protected:
virtual void
placeObject(
const MWWorld::Ptr &ptr,
MWWorld::CellStore &cell,
const ESM::Position &pos) = 0;
public: public:
enum RenderMode enum RenderMode

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -18,8 +19,6 @@
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Apparatus::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -39,7 +38,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Apparatus::getModel(const MWWorld::Ptr &ptr) const std::string Apparatus::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Apparatus> *ref = MWWorld::LiveCellRef<ESM::Apparatus> *ref =
@ -64,7 +63,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Apparatus::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -7,6 +7,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -21,8 +22,6 @@
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Armor::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -42,7 +41,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Armor::getModel(const MWWorld::Ptr &ptr) const std::string Armor::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Armor> *ref = MWWorld::LiveCellRef<ESM::Armor> *ref =
@ -67,7 +66,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actionread.hpp" #include "../mwworld/actionread.hpp"
@ -17,8 +18,6 @@
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Book::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -38,7 +37,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Book::getModel(const MWWorld::Ptr &ptr) const std::string Book::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Book> *ref = MWWorld::LiveCellRef<ESM::Book> *ref =

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Clothing::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -40,7 +39,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Clothing::getModel(const MWWorld::Ptr &ptr) const std::string Clothing::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Clothing> *ref = MWWorld::LiveCellRef<ESM::Clothing> *ref =
@ -65,7 +64,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Clothing::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/nullaction.hpp" #include "../mwworld/nullaction.hpp"
@ -20,8 +21,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace namespace
{ {
struct CustomData : public MWWorld::CustomData struct CustomData : public MWWorld::CustomData
@ -69,7 +68,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Container::getModel(const MWWorld::Ptr &ptr) const std::string Container::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Container> *ref = MWWorld::LiveCellRef<ESM::Container> *ref =

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Door::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -17,8 +18,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Ingredient::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -38,7 +37,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Ingredient::getModel(const MWWorld::Ptr &ptr) const std::string Ingredient::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Ingredient> *ref = MWWorld::LiveCellRef<ESM::Ingredient> *ref =
@ -63,7 +62,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Ingredient::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -17,8 +18,6 @@
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "../mwgui/tooltips.hpp" #include "../mwgui/tooltips.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
@ -58,7 +57,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, "meshes\\" + model); physics.insertObjectPhysics(ptr, "meshes\\" + model);
} }
if (!ref->base->sound.empty()) { if (!ref->base->sound.empty()) {
MWBase::Environment::get().getSoundManager()->playSound3D(ptr, ref->base->sound, 1.0, 1.0, MWSound::Play_Loop); MWBase::Environment::get().getSoundManager()->playSound3D(ptr, ref->base->sound, 1.0, 1.0, MWBase::SoundManager::Play_Loop);
} }
} }
@ -95,7 +94,7 @@ namespace MWClass
if (!(ref->base->data.flags & ESM::Light::Carry)) if (!(ref->base->data.flags & ESM::Light::Carry))
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction); return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Lockpick::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -40,7 +39,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Lockpick::getModel(const MWWorld::Ptr &ptr) const std::string Lockpick::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Tool> *ref = MWWorld::LiveCellRef<ESM::Tool> *ref =
@ -65,7 +64,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -7,6 +7,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -20,8 +21,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
namespace MWClass namespace MWClass
@ -43,7 +42,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Miscellaneous::getModel(const MWWorld::Ptr &ptr) const std::string Miscellaneous::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
@ -68,7 +67,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Miscellaneous::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));
@ -189,7 +188,7 @@ namespace MWClass
Miscellaneous::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const Miscellaneous::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
{ {
MWWorld::Ptr newPtr; MWWorld::Ptr newPtr;
const ESMS::ESMStore &store = const ESMS::ESMStore &store =
MWBase::Environment::get().getWorld()->getStore(); MWBase::Environment::get().getWorld()->getStore();

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Potion::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -65,7 +64,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Potion::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Probe::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -40,7 +39,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Probe::getModel(const MWWorld::Ptr &ptr) const std::string Probe::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Probe> *ref = MWWorld::LiveCellRef<ESM::Probe> *ref =
@ -64,7 +63,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));
@ -174,4 +173,3 @@ namespace MWClass
return MWWorld::Ptr(&cell.probes.insert(*ref), &cell); return MWWorld::Ptr(&cell.probes.insert(*ref), &cell);
} }
} }

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -17,8 +18,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Repair::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -38,7 +37,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Repair::getModel(const MWWorld::Ptr &ptr) const std::string Repair::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Repair> *ref = MWWorld::LiveCellRef<ESM::Repair> *ref =
@ -63,7 +62,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Repair::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -5,6 +5,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
@ -19,8 +20,6 @@
#include "../mwrender/objects.hpp" #include "../mwrender/objects.hpp"
#include "../mwrender/renderinginterface.hpp" #include "../mwrender/renderinginterface.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWClass namespace MWClass
{ {
void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const void Weapon::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
@ -40,7 +39,7 @@ namespace MWClass
physics.insertObjectPhysics(ptr, model); physics.insertObjectPhysics(ptr, model);
} }
} }
std::string Weapon::getModel(const MWWorld::Ptr &ptr) const std::string Weapon::getModel(const MWWorld::Ptr &ptr) const
{ {
MWWorld::LiveCellRef<ESM::Weapon> *ref = MWWorld::LiveCellRef<ESM::Weapon> *ref =
@ -65,7 +64,7 @@ namespace MWClass
boost::shared_ptr<MWWorld::Action> Weapon::activate (const MWWorld::Ptr& ptr, boost::shared_ptr<MWWorld::Action> Weapon::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor) const const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
return boost::shared_ptr<MWWorld::Action> ( return boost::shared_ptr<MWWorld::Action> (
new MWWorld::ActionTake (ptr)); new MWWorld::ActionTake (ptr));

View file

@ -1,5 +1,5 @@
#include "dialoguemanager.hpp" #include "dialoguemanagerimp.hpp"
#include <cctype> #include <cctype>
#include <algorithm> #include <algorithm>
@ -11,6 +11,8 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/scriptmanager.hpp"
#include "../mwbase/journal.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/refdata.hpp" #include "../mwworld/refdata.hpp"
@ -21,12 +23,9 @@
#include "../mwgui/dialogue.hpp" #include "../mwgui/dialogue.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "journal.hpp"
#include <iostream> #include <iostream>
#include "../mwscript/extensions.hpp" #include "../mwscript/extensions.hpp"
#include "../mwscript/scriptmanager.hpp"
#include <components/compiler/exception.hpp> #include <components/compiler/exception.hpp>
#include <components/compiler/errorhandler.hpp> #include <components/compiler/errorhandler.hpp>
@ -599,12 +598,12 @@ namespace MWDialogue
} }
} }
void DialogueManager::addTopic(std::string topic) void DialogueManager::addTopic (const std::string& topic)
{ {
mKnownTopics[toLower(topic)] = true; mKnownTopics[toLower(topic)] = true;
} }
void DialogueManager::parseText(std::string text) void DialogueManager::parseText (std::string text)
{ {
std::list<std::string>::iterator it; std::list<std::string>::iterator it;
for(it = mActorKnownTopics.begin();it != mActorKnownTopics.end();++it) for(it = mActorKnownTopics.begin();it != mActorKnownTopics.end();++it)
@ -804,7 +803,7 @@ namespace MWDialogue
mChoice = choice; mChoice = choice;
} }
void DialogueManager::keywordSelected(std::string keyword) void DialogueManager::keywordSelected (const std::string& keyword)
{ {
if(!mIsInChoice) if(!mIsInChoice)
{ {
@ -846,11 +845,11 @@ namespace MWDialogue
MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue);
} }
void DialogueManager::questionAnswered(std::string answere) void DialogueManager::questionAnswered (const std::string& answer)
{ {
if(mChoiceMap.find(answere) != mChoiceMap.end()) if(mChoiceMap.find(answer) != mChoiceMap.end())
{ {
mChoice = mChoiceMap[answere]; mChoice = mChoiceMap[answer];
std::vector<ESM::DialInfo>::const_iterator iter; std::vector<ESM::DialInfo>::const_iterator iter;
if(mDialogueMap.find(mLastTopic) != mDialogueMap.end()) if(mDialogueMap.find(mLastTopic) != mDialogueMap.end())
@ -882,13 +881,13 @@ namespace MWDialogue
} }
} }
void DialogueManager::printError(std::string error) void DialogueManager::printError (std::string error)
{ {
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->addText(error); win->addText(error);
} }
void DialogueManager::askQuestion(std::string question, int choice) void DialogueManager::askQuestion (const std::string& question, int choice)
{ {
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->askQuestion(question); win->askQuestion(question);
@ -896,7 +895,7 @@ namespace MWDialogue
mIsInChoice = true; mIsInChoice = true;
} }
std::string DialogueManager::getFaction() std::string DialogueManager::getFaction() const
{ {
if (mActor.getTypeName() != typeid(ESM::NPC).name()) if (mActor.getTypeName() != typeid(ESM::NPC).name())
return ""; return "";

View file

@ -1,5 +1,5 @@
#ifndef GAME_MMDIALOG_DIALOGUEMANAGER_H #ifndef GAME_MMDIALOG_DIALOGUEMANAGERIMP_H
#define GAME_MWDIALOG_DIALOGUEMANAGER_H #define GAME_MWDIALOG_DIALOGUEMANAGERIMP_H
#include <components/esm/loadinfo.hpp> #include <components/esm/loadinfo.hpp>
@ -8,12 +8,15 @@
#include "../mwscript/interpretercontext.hpp" #include "../mwscript/interpretercontext.hpp"
#include <components/compiler/output.hpp> #include <components/compiler/output.hpp>
#include "../mwbase/dialoguemanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include <map> #include <map>
namespace MWDialogue namespace MWDialogue
{ {
class DialogueManager class DialogueManager : public MWBase::DialogueManager
{ {
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo::SelectStruct& select) const; bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo::SelectStruct& select) const;
@ -50,21 +53,21 @@ namespace MWDialogue
DialogueManager (const Compiler::Extensions& extensions); DialogueManager (const Compiler::Extensions& extensions);
void startDialogue (const MWWorld::Ptr& actor); virtual void startDialogue (const MWWorld::Ptr& actor);
void addTopic(std::string topic); virtual void addTopic (const std::string& topic);
void askQuestion(std::string question,int choice); virtual void askQuestion (const std::string& question,int choice);
void goodbye(); virtual void goodbye();
///get the faction of the actor you are talking with ///get the faction of the actor you are talking with
std::string getFaction(); virtual std::string getFaction() const;
//calbacks for the GUI //calbacks for the GUI
void keywordSelected(std::string keyword); virtual void keywordSelected (const std::string& keyword);
void goodbyeSelected(); virtual void goodbyeSelected();
void questionAnswered(std::string answere); virtual void questionAnswered (const std::string& answer);
}; };
} }

View file

@ -1,5 +1,5 @@
#include "journal.hpp" #include "journalimp.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"

View file

@ -1,9 +1,7 @@
#ifndef GAME_MMDIALOG_JOURNAL_H #ifndef GAME_MMDIALOG_JOURNAL_H
#define GAME_MWDIALOG_JOURNAL_H #define GAME_MWDIALOG_JOURNAL_H
#include <string> #include "../mwbase/journal.hpp"
#include <deque>
#include <map>
#include "journalentry.hpp" #include "journalentry.hpp"
#include "quest.hpp" #include "quest.hpp"
@ -11,19 +9,8 @@
namespace MWDialogue namespace MWDialogue
{ {
/// \brief The player's journal /// \brief The player's journal
class Journal class Journal : public MWBase::Journal
{ {
public:
typedef std::deque<StampedJournalEntry> TEntryContainer;
typedef TEntryContainer::const_iterator TEntryIter;
typedef std::map<std::string, Quest> TQuestContainer; // topc, quest
typedef TQuestContainer::const_iterator TQuestIter;
typedef std::map<std::string, Topic> TTopicContainer; // topic-id, topic-content
typedef TTopicContainer::const_iterator TTopicIter;
private:
TEntryContainer mJournal; TEntryContainer mJournal;
TQuestContainer mQuests; TQuestContainer mQuests;
TTopicContainer mTopics; TTopicContainer mTopics;
@ -34,37 +21,37 @@ namespace MWDialogue
Journal(); Journal();
void addEntry (const std::string& id, int index); virtual void addEntry (const std::string& id, int index);
///< Add a journal entry. ///< Add a journal entry.
void setJournalIndex (const std::string& id, int index); virtual void setJournalIndex (const std::string& id, int index);
///< Set the journal index without adding an entry. ///< Set the journal index without adding an entry.
int getJournalIndex (const std::string& id) const; virtual int getJournalIndex (const std::string& id) const;
///< Get the journal index. ///< Get the journal index.
void addTopic (const std::string& topicId, const std::string& infoId); virtual void addTopic (const std::string& topicId, const std::string& infoId);
TEntryIter begin() const; virtual TEntryIter begin() const;
///< Iterator pointing to the begin of the main journal. ///< Iterator pointing to the begin of the main journal.
/// ///
/// \note Iterators to main journal entries will never become invalid. /// \note Iterators to main journal entries will never become invalid.
TEntryIter end() const; virtual TEntryIter end() const;
///< Iterator pointing past the end of the main journal. ///< Iterator pointing past the end of the main journal.
TQuestIter questBegin() const; virtual TQuestIter questBegin() const;
///< Iterator pointing to the first quest (sorted by topic ID) ///< Iterator pointing to the first quest (sorted by topic ID)
TQuestIter questEnd() const; virtual TQuestIter questEnd() const;
///< Iterator pointing past the last quest. ///< Iterator pointing past the last quest.
TTopicIter topicBegin() const; virtual TTopicIter topicBegin() const;
///< Iterator pointing to the first topic (sorted by topic ID) ///< Iterator pointing to the first topic (sorted by topic ID)
/// ///
/// \note The topic ID is identical with the user-visible topic string. /// \note The topic ID is identical with the user-visible topic string.
TTopicIter topicEnd() const; virtual TTopicIter topicEnd() const;
///< Iterator pointing past the last topic. ///< Iterator pointing past the last topic.
}; };
} }

View file

@ -4,13 +4,12 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
namespace namespace

View file

@ -4,8 +4,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
@ -98,7 +100,7 @@ void BookWindow::onCloseButtonClicked (MyGUI::Widget* _sender)
void BookWindow::onTakeButtonClicked (MyGUI::Widget* _sender) void BookWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
{ {
MWBase::Environment::get().getSoundManager()->playSound ("Item Book Up", 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound ("Item Book Up", 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
MWWorld::ActionTake take(mBook); MWWorld::ActionTake take(mBook);
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer()); take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());

View file

@ -9,7 +9,7 @@
#include "mode.hpp" #include "mode.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwsound/soundmanager.hpp" #include "../mwbase/soundmanager.hpp"
namespace namespace
{ {

View file

@ -10,6 +10,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
@ -20,8 +21,6 @@
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "countdialog.hpp" #include "countdialog.hpp"

View file

@ -9,7 +9,8 @@
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwdialogue/dialoguemanager.hpp" #include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/world.hpp"
#include "dialogue_history.hpp" #include "dialogue_history.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"

View file

@ -8,12 +8,11 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwgui/widgets.hpp" #include "../mwgui/widgets.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"

View file

@ -9,6 +9,7 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
@ -17,10 +18,6 @@
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwclass/container.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
#include "widgets.hpp" #include "widgets.hpp"
#include "bookwindow.hpp" #include "bookwindow.hpp"

View file

@ -2,10 +2,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/journal.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwdialogue/journal.hpp" #include "../mwdialogue/journalentry.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"

View file

@ -2,10 +2,12 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
#include "../mwworld/actiontake.hpp" #include "../mwworld/actiontake.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwsound/soundmanager.hpp"
#include "formatting.hpp" #include "formatting.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
@ -62,7 +64,7 @@ void ScrollWindow::onCloseButtonClicked (MyGUI::Widget* _sender)
void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender) void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
{ {
MWBase::Environment::get().getSoundManager()->playSound ("Item Book Up", 1.0, 1.0, MWSound::Play_NoTrack); MWBase::Environment::get().getSoundManager()->playSound ("Item Book Up", 1.0, 1.0, MWBase::SoundManager::Play_NoTrack);
MWWorld::ActionTake take(mScroll); MWWorld::ActionTake take(mScroll);
take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer()); take.execute (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());

View file

@ -12,11 +12,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwrender/renderingmanager.hpp" #include "../mwrender/renderingmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"

View file

@ -8,6 +8,7 @@
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
@ -16,8 +17,6 @@
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/spellsuccess.hpp" #include "../mwmechanics/spellsuccess.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
#include "confirmationdialog.hpp" #include "confirmationdialog.hpp"

View file

@ -4,10 +4,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "../mwworld/manualref.hpp" #include "../mwworld/manualref.hpp"
#include "../mwsound/soundmanager.hpp"
#include "window_manager.hpp" #include "window_manager.hpp"
#include "inventorywindow.hpp" #include "inventorywindow.hpp"

View file

@ -4,12 +4,11 @@
#include <OgreCamera.h> #include <OgreCamera.h>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/refdata.hpp" #include "../mwworld/refdata.hpp"
#include "../mwsound/soundmanager.hpp"
namespace MWRender namespace MWRender
{ {
Player::Player (Ogre::Camera *camera, Ogre::SceneNode* node) Player::Player (Ogre::Camera *camera, Ogre::SceneNode* node)

View file

@ -2,6 +2,8 @@
#include <OgreTerrain.h> #include <OgreTerrain.h>
#include <stdexcept>
#include <extern/shiny/Main/Factory.hpp> #include <extern/shiny/Main/Factory.hpp>
namespace namespace

View file

@ -3,14 +3,15 @@
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include <components/compiler/locals.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/scriptmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "scriptmanager.hpp"
namespace MWScript namespace MWScript
{ {
CompilerContext::CompilerContext (Type type) CompilerContext::CompilerContext (Type type)

View file

@ -7,8 +7,9 @@
#include <components/interpreter/runtime.hpp> #include <components/interpreter/runtime.hpp>
#include <components/interpreter/opcodes.hpp> #include <components/interpreter/opcodes.hpp>
#include "../mwdialogue/journal.hpp" #include "../mwbase/environment.hpp"
#include "../mwdialogue/dialoguemanager.hpp" #include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/journal.hpp"
#include "interpretercontext.hpp" #include "interpretercontext.hpp"
#include "ref.hpp" #include "ref.hpp"
@ -84,7 +85,7 @@ namespace MWScript
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0) virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
{ {
MWDialogue::DialogueManager* dialogue = MWBase::Environment::get().getDialogueManager(); MWBase::DialogueManager* dialogue = MWBase::Environment::get().getDialogueManager();
while(arg0>0) while(arg0>0)
{ {
std::string question = runtime.getStringLiteral (runtime[0].mInteger); std::string question = runtime.getStringLiteral (runtime[0].mInteger);

View file

@ -6,13 +6,15 @@
#include <components/esm_store/reclists.hpp> #include <components/esm_store/reclists.hpp>
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/scriptmanager.hpp"
#include "interpretercontext.hpp" #include "interpretercontext.hpp"
#include "scriptmanager.hpp"
namespace MWScript namespace MWScript
{ {
GlobalScripts::GlobalScripts (const ESMS::ESMStore& store, ScriptManager& scriptManager) GlobalScripts::GlobalScripts (const ESMS::ESMStore& store)
: mStore (store), mScriptManager (scriptManager) : mStore (store)
{ {
addScript ("Main"); addScript ("Main");
@ -63,9 +65,8 @@ namespace MWScript
{ {
MWScript::InterpreterContext interpreterContext ( MWScript::InterpreterContext interpreterContext (
&iter->second.second, MWWorld::Ptr()); &iter->second.second, MWWorld::Ptr());
mScriptManager.run (iter->first, interpreterContext); MWBase::Environment::get().getScriptManager()->run (iter->first, interpreterContext);
} }
} }
} }
} }

View file

@ -13,17 +13,14 @@ namespace ESMS
namespace MWScript namespace MWScript
{ {
class ScriptManager;
class GlobalScripts class GlobalScripts
{ {
const ESMS::ESMStore& mStore; const ESMS::ESMStore& mStore;
ScriptManager& mScriptManager;
std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables std::map<std::string, std::pair<bool, Locals> > mScripts; // running, local variables
public: public:
GlobalScripts (const ESMS::ESMStore& store, ScriptManager& scriptManager); GlobalScripts (const ESMS::ESMStore& store);
void addScript (const std::string& name); void addScript (const std::string& name);

View file

@ -8,6 +8,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/scriptmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
@ -18,7 +19,6 @@
#include "locals.hpp" #include "locals.hpp"
#include "globalscripts.hpp" #include "globalscripts.hpp"
#include "scriptmanager.hpp"
namespace MWScript namespace MWScript
{ {

View file

@ -1,5 +1,5 @@
#include "scriptmanager.hpp" #include "scriptmanagerimp.hpp"
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
@ -21,7 +21,7 @@ namespace MWScript
Compiler::Context& compilerContext) Compiler::Context& compilerContext)
: mErrorHandler (std::cerr), mStore (store), mVerbose (verbose), : mErrorHandler (std::cerr), mStore (store), mVerbose (verbose),
mCompilerContext (compilerContext), mParser (mErrorHandler, mCompilerContext), mCompilerContext (compilerContext), mParser (mErrorHandler, mCompilerContext),
mOpcodesInstalled (false), mGlobalScripts (store, *this) mOpcodesInstalled (false), mGlobalScripts (store)
{} {}
bool ScriptManager::compile (const std::string& name) bool ScriptManager::compile (const std::string& name)

View file

@ -10,6 +10,8 @@
#include <components/interpreter/interpreter.hpp> #include <components/interpreter/interpreter.hpp>
#include <components/interpreter/types.hpp> #include <components/interpreter/types.hpp>
#include "../mwbase/scriptmanager.hpp"
#include "globalscripts.hpp" #include "globalscripts.hpp"
namespace ESMS namespace ESMS
@ -30,7 +32,7 @@ namespace Interpreter
namespace MWScript namespace MWScript
{ {
class ScriptManager class ScriptManager : public MWBase::ScriptManager
{ {
Compiler::StreamErrorHandler mErrorHandler; Compiler::StreamErrorHandler mErrorHandler;
const ESMS::ESMStore& mStore; const ESMS::ESMStore& mStore;
@ -51,23 +53,24 @@ namespace MWScript
ScriptManager (const ESMS::ESMStore& store, bool verbose, ScriptManager (const ESMS::ESMStore& store, bool verbose,
Compiler::Context& compilerContext); Compiler::Context& compilerContext);
void run (const std::string& name, Interpreter::Context& interpreterContext); virtual void run (const std::string& name, Interpreter::Context& interpreterContext);
///< Run the script with the given name (compile first, if not compiled yet) ///< Run the script with the given name (compile first, if not compiled yet)
bool compile (const std::string& name); virtual bool compile (const std::string& name);
///< Compile script with the given namen ///< Compile script with the given namen
/// \return Success? /// \return Success?
std::pair<int, int> compileAll(); virtual std::pair<int, int> compileAll();
///< Compile all scripts ///< Compile all scripts
/// \return count, success /// \return count, success
Compiler::Locals& getLocals (const std::string& name); virtual Compiler::Locals& getLocals (const std::string& name);
///< Return locals for script \a name. ///< Return locals for script \a name.
GlobalScripts& getGlobalScripts(); virtual GlobalScripts& getGlobalScripts();
int getLocalIndex (const std::string& scriptId, const std::string& variable, char type); virtual int getLocalIndex (const std::string& scriptId, const std::string& variable,
char type);
///< Return index of the variable of the given name and type in the given script. Will ///< Return index of the variable of the given name and type in the given script. Will
/// throw an exception, if there is no such script or variable or the type does not match. /// throw an exception, if there is no such script or variable or the type does not match.
}; };

View file

@ -9,8 +9,7 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "interpretercontext.hpp" #include "interpretercontext.hpp"
#include "ref.hpp" #include "ref.hpp"
@ -116,7 +115,7 @@ namespace MWScript
std::string sound = runtime.getStringLiteral (runtime[0].mInteger); std::string sound = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop(); runtime.pop();
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, sound, 1.0, 1.0, mLoop ? MWSound::Play_Loop : 0); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, sound, 1.0, 1.0, mLoop ? MWBase::SoundManager::Play_Loop : 0);
} }
}; };
@ -142,7 +141,7 @@ namespace MWScript
Interpreter::Type_Float pitch = runtime[0].mFloat; Interpreter::Type_Float pitch = runtime[0].mFloat;
runtime.pop(); runtime.pop();
MWBase::Environment::get().getSoundManager()->playSound3D (ptr, sound, volume, pitch, mLoop ? MWSound::Play_Loop : 0); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, sound, volume, pitch, mLoop ? MWBase::SoundManager::Play_Loop : 0);
} }
}; };

View file

@ -16,6 +16,7 @@
#include <components/interpreter/opcodes.hpp> #include <components/interpreter/opcodes.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/dialoguemanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
@ -26,7 +27,6 @@
#include "interpretercontext.hpp" #include "interpretercontext.hpp"
#include "ref.hpp" #include "ref.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
namespace MWScript namespace MWScript
{ {

View file

@ -8,7 +8,7 @@
#include "openal_output.hpp" #include "openal_output.hpp"
#include "sound_decoder.hpp" #include "sound_decoder.hpp"
#include "sound.hpp" #include "sound.hpp"
#include "soundmanager.hpp" #include "soundmanagerimp.hpp"
#ifndef ALC_ALL_DEVICES_SPECIFIER #ifndef ALC_ALL_DEVICES_SPECIFIER
#define ALC_ALL_DEVICES_SPECIFIER 0x1013 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
@ -263,7 +263,7 @@ void OpenAL_SoundStream::update()
{ {
ALfloat gain = mVolume*mBaseVolume; ALfloat gain = mVolume*mBaseVolume;
ALfloat pitch = mPitch; ALfloat pitch = mPitch;
if(!(mFlags&Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater) if(!(mFlags&MWBase::SoundManager::Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater)
{ {
gain *= 0.9f; gain *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;
@ -400,7 +400,7 @@ void OpenAL_Sound::update()
{ {
ALfloat gain = mVolume*mBaseVolume; ALfloat gain = mVolume*mBaseVolume;
ALfloat pitch = mPitch; ALfloat pitch = mPitch;
if(!(mFlags&Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater) if(!(mFlags&MWBase::SoundManager::Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater)
{ {
gain *= 0.9f; gain *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;
@ -420,7 +420,7 @@ void OpenAL_Sound3D::update()
ALfloat pitch = mPitch; ALfloat pitch = mPitch;
if(mPos.squaredDistance(mOutput.mPos) > mMaxDistance*mMaxDistance) if(mPos.squaredDistance(mOutput.mPos) > mMaxDistance*mMaxDistance)
gain = 0.0f; gain = 0.0f;
else if(!(mFlags&Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater) else if(!(mFlags&MWBase::SoundManager::Play_NoEnv) && mOutput.mLastEnvironment == Env_Underwater)
{ {
gain *= 0.9f; gain *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;
@ -642,7 +642,7 @@ void OpenAL_Output::bufferFinished(ALuint buf)
} }
SoundPtr OpenAL_Output::playSound(const std::string &fname, float volume, float pitch, int flags) MWBase::SoundPtr OpenAL_Output::playSound(const std::string &fname, float volume, float pitch, int flags)
{ {
boost::shared_ptr<OpenAL_Sound> sound; boost::shared_ptr<OpenAL_Sound> sound;
ALuint src=0, buf=0; ALuint src=0, buf=0;
@ -674,7 +674,7 @@ SoundPtr OpenAL_Output::playSound(const std::string &fname, float volume, float
alSourcef(src, AL_MAX_DISTANCE, 1000.0f); alSourcef(src, AL_MAX_DISTANCE, 1000.0f);
alSourcef(src, AL_ROLLOFF_FACTOR, 0.0f); alSourcef(src, AL_ROLLOFF_FACTOR, 0.0f);
if(!(flags&Play_NoEnv) && mLastEnvironment == Env_Underwater) if(!(flags&MWBase::SoundManager::Play_NoEnv) && mLastEnvironment == Env_Underwater)
{ {
volume *= 0.9f; volume *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;
@ -683,7 +683,7 @@ SoundPtr OpenAL_Output::playSound(const std::string &fname, float volume, float
alSourcef(src, AL_PITCH, pitch); alSourcef(src, AL_PITCH, pitch);
alSourcei(src, AL_SOURCE_RELATIVE, AL_TRUE); alSourcei(src, AL_SOURCE_RELATIVE, AL_TRUE);
alSourcei(src, AL_LOOPING, (flags&Play_Loop) ? AL_TRUE : AL_FALSE); alSourcei(src, AL_LOOPING, (flags&MWBase::SoundManager::Play_Loop) ? AL_TRUE : AL_FALSE);
throwALerror(); throwALerror();
alSourcei(src, AL_BUFFER, buf); alSourcei(src, AL_BUFFER, buf);
@ -693,7 +693,7 @@ SoundPtr OpenAL_Output::playSound(const std::string &fname, float volume, float
return sound; return sound;
} }
SoundPtr OpenAL_Output::playSound3D(const std::string &fname, const Ogre::Vector3 &pos, float volume, float pitch, MWBase::SoundPtr OpenAL_Output::playSound3D(const std::string &fname, const Ogre::Vector3 &pos, float volume, float pitch,
float min, float max, int flags) float min, float max, int flags)
{ {
boost::shared_ptr<OpenAL_Sound> sound; boost::shared_ptr<OpenAL_Sound> sound;
@ -726,7 +726,7 @@ SoundPtr OpenAL_Output::playSound3D(const std::string &fname, const Ogre::Vector
alSourcef(src, AL_MAX_DISTANCE, max); alSourcef(src, AL_MAX_DISTANCE, max);
alSourcef(src, AL_ROLLOFF_FACTOR, 1.0f); alSourcef(src, AL_ROLLOFF_FACTOR, 1.0f);
if(!(flags&Play_NoEnv) && mLastEnvironment == Env_Underwater) if(!(flags&MWBase::SoundManager::Play_NoEnv) && mLastEnvironment == Env_Underwater)
{ {
volume *= 0.9f; volume *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;
@ -736,7 +736,7 @@ SoundPtr OpenAL_Output::playSound3D(const std::string &fname, const Ogre::Vector
alSourcef(src, AL_PITCH, pitch); alSourcef(src, AL_PITCH, pitch);
alSourcei(src, AL_SOURCE_RELATIVE, AL_FALSE); alSourcei(src, AL_SOURCE_RELATIVE, AL_FALSE);
alSourcei(src, AL_LOOPING, (flags&Play_Loop) ? AL_TRUE : AL_FALSE); alSourcei(src, AL_LOOPING, (flags&MWBase::SoundManager::Play_Loop) ? AL_TRUE : AL_FALSE);
throwALerror(); throwALerror();
alSourcei(src, AL_BUFFER, buf); alSourcei(src, AL_BUFFER, buf);
@ -747,7 +747,7 @@ SoundPtr OpenAL_Output::playSound3D(const std::string &fname, const Ogre::Vector
} }
SoundPtr OpenAL_Output::streamSound(const std::string &fname, float volume, float pitch, int flags) MWBase::SoundPtr OpenAL_Output::streamSound(const std::string &fname, float volume, float pitch, int flags)
{ {
boost::shared_ptr<OpenAL_SoundStream> sound; boost::shared_ptr<OpenAL_SoundStream> sound;
ALuint src; ALuint src;
@ -759,7 +759,7 @@ SoundPtr OpenAL_Output::streamSound(const std::string &fname, float volume, floa
try try
{ {
if((flags&Play_Loop)) if((flags&MWBase::SoundManager::Play_Loop))
std::cout <<"Warning: cannot loop stream "<<fname<< std::endl; std::cout <<"Warning: cannot loop stream "<<fname<< std::endl;
DecoderPtr decoder = mManager.getDecoder(); DecoderPtr decoder = mManager.getDecoder();
decoder->open(fname); decoder->open(fname);
@ -779,7 +779,7 @@ SoundPtr OpenAL_Output::streamSound(const std::string &fname, float volume, floa
alSourcef(src, AL_MAX_DISTANCE, 1000.0f); alSourcef(src, AL_MAX_DISTANCE, 1000.0f);
alSourcef(src, AL_ROLLOFF_FACTOR, 0.0f); alSourcef(src, AL_ROLLOFF_FACTOR, 0.0f);
if(!(flags&Play_NoEnv) && mLastEnvironment == Env_Underwater) if(!(flags&MWBase::SoundManager::Play_NoEnv) && mLastEnvironment == Env_Underwater)
{ {
volume *= 0.9f; volume *= 0.9f;
pitch *= 0.7f; pitch *= 0.7f;

View file

@ -42,10 +42,10 @@ namespace MWSound
virtual void init(const std::string &devname=""); virtual void init(const std::string &devname="");
virtual void deinit(); virtual void deinit();
virtual SoundPtr playSound(const std::string &fname, float volume, float pitch, int flags); virtual MWBase::SoundPtr playSound(const std::string &fname, float volume, float pitch, int flags);
virtual SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos, virtual MWBase::SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos,
float volume, float pitch, float min, float max, int flags); float volume, float pitch, float min, float max, int flags);
virtual SoundPtr streamSound(const std::string &fname, float volume, float pitch, int flags); virtual MWBase::SoundPtr streamSound(const std::string &fname, float volume, float pitch, int flags);
virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env); virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env);

View file

@ -3,7 +3,7 @@
#include <OgreVector3.h> #include <OgreVector3.h>
#include "soundmanager.hpp" #include "soundmanagerimp.hpp"
namespace MWSound namespace MWSound
{ {
@ -35,7 +35,7 @@ namespace MWSound
, mPitch(1.0f) , mPitch(1.0f)
, mMinDistance(20.0f) /* 1 * min_range_scale */ , mMinDistance(20.0f) /* 1 * min_range_scale */
, mMaxDistance(12750.0f) /* 255 * max_range_scale */ , mMaxDistance(12750.0f) /* 255 * max_range_scale */
, mFlags(Play_Normal) , mFlags(MWBase::SoundManager::Play_Normal)
{ } { }
virtual ~Sound() { } virtual ~Sound() { }

View file

@ -6,7 +6,7 @@
#include <OgreVector3.h> #include <OgreVector3.h>
#include "soundmanager.hpp" #include "soundmanagerimp.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
@ -24,10 +24,10 @@ namespace MWSound
virtual void init(const std::string &devname="") = 0; virtual void init(const std::string &devname="") = 0;
virtual void deinit() = 0; virtual void deinit() = 0;
virtual SoundPtr playSound(const std::string &fname, float volume, float pitch, int flags) = 0; virtual MWBase::SoundPtr playSound(const std::string &fname, float volume, float pitch, int flags) = 0;
virtual SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos, virtual MWBase::SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos,
float volume, float pitch, float min, float max, int flags) = 0; float volume, float pitch, float min, float max, int flags) = 0;
virtual SoundPtr streamSound(const std::string &fname, float volume, float pitch, int flags) = 0; virtual MWBase::SoundPtr streamSound(const std::string &fname, float volume, float pitch, int flags) = 0;
virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env) = 0; virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env) = 0;

View file

@ -1,4 +1,4 @@
#include "soundmanager.hpp" #include "soundmanagerimp.hpp"
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
@ -218,7 +218,7 @@ namespace MWSound
const ESM::Position &pos = ptr.getCellRef().pos; const ESM::Position &pos = ptr.getCellRef().pos;
const Ogre::Vector3 objpos(pos.pos[0], pos.pos[1], pos.pos[2]); const Ogre::Vector3 objpos(pos.pos[0], pos.pos[1], pos.pos[2]);
SoundPtr sound = mOutput->playSound3D(filePath, objpos, basevol, 1.0f, MWBase::SoundPtr sound = mOutput->playSound3D(filePath, objpos, basevol, 1.0f,
20.0f, 12750.0f, Play_Normal); 20.0f, 12750.0f, Play_Normal);
sound->mPos = objpos; sound->mPos = objpos;
sound->mBaseVolume = basevol; sound->mBaseVolume = basevol;
@ -240,7 +240,7 @@ namespace MWSound
float basevol = mMasterVolume * mVoiceVolume; float basevol = mMasterVolume * mVoiceVolume;
std::string filePath = "Sound/"+filename; std::string filePath = "Sound/"+filename;
SoundPtr sound = mOutput->playSound(filePath, basevol, 1.0f, Play_Normal); MWBase::SoundPtr sound = mOutput->playSound(filePath, basevol, 1.0f, Play_Normal);
sound->mBaseVolume = basevol; sound->mBaseVolume = basevol;
mActiveSounds[sound] = std::make_pair(MWWorld::Ptr(), std::string("_say_sound")); mActiveSounds[sound] = std::make_pair(MWWorld::Ptr(), std::string("_say_sound"));
@ -273,9 +273,9 @@ namespace MWSound
SoundPtr SoundManager::playSound(const std::string& soundId, float volume, float pitch, int mode) MWBase::SoundPtr SoundManager::playSound(const std::string& soundId, float volume, float pitch, int mode)
{ {
SoundPtr sound; MWBase::SoundPtr sound;
if(!mOutput->isInitialized()) if(!mOutput->isInitialized())
return sound; return sound;
try try
@ -301,10 +301,10 @@ namespace MWSound
return sound; return sound;
} }
SoundPtr SoundManager::playSound3D(MWWorld::Ptr ptr, const std::string& soundId, MWBase::SoundPtr SoundManager::playSound3D(MWWorld::Ptr ptr, const std::string& soundId,
float volume, float pitch, int mode) float volume, float pitch, int mode)
{ {
SoundPtr sound; MWBase::SoundPtr sound;
if(!mOutput->isInitialized()) if(!mOutput->isInitialized())
return sound; return sound;
try try

View file

@ -12,6 +12,8 @@
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
namespace MWSound namespace MWSound
@ -21,27 +23,13 @@ namespace MWSound
class Sound; class Sound;
typedef boost::shared_ptr<Sound_Decoder> DecoderPtr; typedef boost::shared_ptr<Sound_Decoder> DecoderPtr;
typedef boost::shared_ptr<Sound> SoundPtr;
enum PlayMode {
Play_Normal = 0, /* tracked, non-looping, multi-instance, environment */
Play_Loop = 1<<0, /* Sound will continually loop until explicitly stopped */
Play_NoEnv = 1<<1, /* Do not apply environment effects (eg, underwater filters) */
Play_NoTrack = 1<<2, /* (3D only) Play the sound at the given object's position
* but do not keep it updated (the sound will not move with
* the object and will not stop when the object is deleted. */
};
static inline int operator|(const PlayMode &a, const PlayMode &b)
{ return (int)a | (int)b; }
static inline int operator&(const PlayMode &a, const PlayMode &b)
{ return (int)a & (int)b; }
enum Environment { enum Environment {
Env_Normal, Env_Normal,
Env_Underwater, Env_Underwater,
}; };
class SoundManager class SoundManager : public MWBase::SoundManager
{ {
Ogre::ResourceGroupManager& mResourceMgr; Ogre::ResourceGroupManager& mResourceMgr;
@ -59,7 +47,7 @@ namespace MWSound
std::string mCurrentPlaylist; std::string mCurrentPlaylist;
typedef std::pair<MWWorld::Ptr,std::string> PtrIDPair; typedef std::pair<MWWorld::Ptr,std::string> PtrIDPair;
typedef std::map<SoundPtr,PtrIDPair> SoundMap; typedef std::map<MWBase::SoundPtr,PtrIDPair> SoundMap;
SoundMap mActiveSounds; SoundMap mActiveSounds;
Ogre::Vector3 mListenerPos; Ogre::Vector3 mListenerPos;
@ -81,69 +69,69 @@ namespace MWSound
public: public:
SoundManager(bool useSound); SoundManager(bool useSound);
~SoundManager(); virtual ~SoundManager();
void processChangedSettings(const Settings::CategorySettingVector& settings); virtual void processChangedSettings(const Settings::CategorySettingVector& settings);
void stopMusic(); virtual void stopMusic();
///< Stops music if it's playing ///< Stops music if it's playing
void streamMusic(const std::string& filename); virtual void streamMusic(const std::string& filename);
///< Play a soundifle ///< Play a soundifle
/// \param filename name of a sound file in "Music/" in the data directory. /// \param filename name of a sound file in "Music/" in the data directory.
void startRandomTitle(); virtual void startRandomTitle();
///< Starts a random track from the current playlist ///< Starts a random track from the current playlist
bool isMusicPlaying(); virtual bool isMusicPlaying();
///< Returns true if music is playing ///< Returns true if music is playing
void playPlaylist(const std::string &playlist); virtual void playPlaylist(const std::string &playlist);
///< Start playing music from the selected folder ///< Start playing music from the selected folder
/// \param name of the folder that contains the playlist /// \param name of the folder that contains the playlist
void say(MWWorld::Ptr reference, const std::string& filename); virtual void say(MWWorld::Ptr reference, const std::string& filename);
///< Make an actor say some text. ///< Make an actor say some text.
/// \param filename name of a sound file in "Sound/" in the data directory. /// \param filename name of a sound file in "Sound/" in the data directory.
void say(const std::string& filename); virtual void say(const std::string& filename);
///< Say some text, without an actor ref ///< Say some text, without an actor ref
/// \param filename name of a sound file in "Sound/" in the data directory. /// \param filename name of a sound file in "Sound/" in the data directory.
bool sayDone(MWWorld::Ptr reference=MWWorld::Ptr()) const; virtual bool sayDone(MWWorld::Ptr reference=MWWorld::Ptr()) const;
///< Is actor not speaking? ///< Is actor not speaking?
void stopSay(MWWorld::Ptr reference=MWWorld::Ptr()); virtual void stopSay(MWWorld::Ptr reference=MWWorld::Ptr());
///< Stop an actor speaking ///< Stop an actor speaking
SoundPtr playSound(const std::string& soundId, float volume, float pitch, int mode=Play_Normal); virtual MWBase::SoundPtr playSound(const std::string& soundId, float volume, float pitch, int mode=Play_Normal);
///< Play a sound, independently of 3D-position ///< Play a sound, independently of 3D-position
SoundPtr playSound3D(MWWorld::Ptr reference, const std::string& soundId, virtual MWBase::SoundPtr playSound3D(MWWorld::Ptr reference, const std::string& soundId,
float volume, float pitch, int mode=Play_Normal); float volume, float pitch, int mode=Play_Normal);
///< Play a sound from an object ///< Play a sound from an object
void stopSound3D(MWWorld::Ptr reference, const std::string& soundId); virtual void stopSound3D(MWWorld::Ptr reference, const std::string& soundId);
///< Stop the given object from playing the given sound, ///< Stop the given object from playing the given sound,
void stopSound3D(MWWorld::Ptr reference); virtual void stopSound3D(MWWorld::Ptr reference);
///< Stop the given object from playing all sounds. ///< Stop the given object from playing all sounds.
void stopSound(const MWWorld::CellStore *cell); virtual void stopSound(const MWWorld::CellStore *cell);
///< Stop all sounds for the given cell. ///< Stop all sounds for the given cell.
void stopSound(const std::string& soundId); virtual void stopSound(const std::string& soundId);
///< Stop a non-3d looping sound ///< Stop a non-3d looping sound
bool getSoundPlaying(MWWorld::Ptr reference, const std::string& soundId) const; virtual bool getSoundPlaying(MWWorld::Ptr reference, const std::string& soundId) const;
///< Is the given sound currently playing on the given object? ///< Is the given sound currently playing on the given object?
void updateObject(MWWorld::Ptr reference); virtual void updateObject(MWWorld::Ptr reference);
///< Update the position of all sounds connected to the given object. ///< Update the position of all sounds connected to the given object.
void update(float duration); virtual void update(float duration);
void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir); virtual void setListenerPosDir(const Ogre::Vector3 &pos, const Ogre::Vector3 &dir);
}; };
} }

View file

@ -2,8 +2,7 @@
#include "action.hpp" #include "action.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwsound/soundmanager.hpp"
MWWorld::Action::Action() {} MWWorld::Action::Action() {}
@ -13,7 +12,7 @@ void MWWorld::Action::execute (const Ptr& actor)
{ {
if (!mSoundId.empty()) if (!mSoundId.empty())
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0, MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
MWSound::Play_NoTrack); MWBase::SoundManager::Play_NoTrack);
executeImp (actor); executeImp (actor);
} }

View file

@ -2,8 +2,7 @@
#include "actiontalk.hpp" #include "actiontalk.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwbase/dialoguemanager.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
namespace MWWorld namespace MWWorld
{ {

View file

@ -2,11 +2,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" /// FIXME #include "../mwbase/world.hpp" /// FIXME
#include "../mwbase/soundmanager.hpp"
#include "../mwmechanics/mechanicsmanager.hpp" #include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "player.hpp" #include "player.hpp"
@ -345,7 +344,7 @@ namespace MWWorld
mRendering.addObject(ptr); mRendering.addObject(ptr);
MWWorld::Class::get(ptr).insertObject(ptr, *mPhysics); MWWorld::Class::get(ptr).insertObject(ptr, *mPhysics);
} }
void Scene::removeObjectFromScene (const Ptr& ptr) void Scene::removeObjectFromScene (const Ptr& ptr)
{ {
MWBase::Environment::get().getMechanicsManager()->removeActor (ptr); MWBase::Environment::get().getMechanicsManager()->removeActor (ptr);

View file

@ -9,11 +9,10 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwrender/renderingmanager.hpp" #include "../mwrender/renderingmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "player.hpp" #include "player.hpp"
using namespace Ogre; using namespace Ogre;

View file

@ -4,14 +4,13 @@
#include <components/files/collections.hpp> #include <components/files/collections.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwrender/sky.hpp" #include "../mwrender/sky.hpp"
#include "../mwrender/player.hpp" #include "../mwrender/player.hpp"
#include "../mwmechanics/mechanicsmanager.hpp" #include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwsound/soundmanager.hpp"
#include "../mwgui/window_manager.hpp" #include "../mwgui/window_manager.hpp"
#include "player.hpp" #include "player.hpp"

View file

@ -1,4 +1,5 @@
#include "esm_reader.hpp" #include "esm_reader.hpp"
#include <stdexcept>
namespace ESM namespace ESM
{ {

View file

@ -37,6 +37,8 @@
#include <vector> #include <vector>
#include <cassert> #include <cassert>
#include <libs/platform/stdint.h>
#include "record.hpp" #include "record.hpp"
#include "nif_types.hpp" #include "nif_types.hpp"