Merge branch 'decouple' into player_control
Conflicts: apps/openmw/mwsound/soundmanagerimp.hppactorid
commit
aca08eb4c2
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -1,5 +1,5 @@
|
||||
|
||||
#include "journal.hpp"
|
||||
#include "journalimp.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
Loading…
Reference in New Issue