From 190f77f6c9711582afa282a37983777b9dbd18da Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 4 Apr 2011 11:16:56 +0200 Subject: [PATCH] added journal class --- apps/openmw/CMakeLists.txt | 2 ++ apps/openmw/engine.cpp | 3 +++ apps/openmw/mwdialogue/journal.cpp | 10 ++++++++++ apps/openmw/mwdialogue/journal.hpp | 21 +++++++++++++++++++++ apps/openmw/mwworld/environment.hpp | 4 +++- 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 apps/openmw/mwdialogue/journal.cpp create mode 100644 apps/openmw/mwdialogue/journal.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 0fa027f0c6..bdc018c108 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -70,9 +70,11 @@ source_group(apps\\openmw\\mwgui FILES ${GAMEGUI_HEADER} ${GAMEGUI}) set(GAMEDIALOGUE_HEADER mwdialogue/dialoguemanager.hpp + mwdialogue/journal.hpp ) set(GAMEDIALOGUE mwdialogue/dialoguemanager.cpp + mwdialogue/journal.cpp ) source_group(apps\\openmw\\mwdialogue FILES ${GAMEDIALOGUE_HEADER} ${GAMEDIALOGUE}) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 78ddffbe8c..dd556ba495 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -36,6 +36,7 @@ #include "mwclass/classes.hpp" #include "mwdialogue/dialoguemanager.hpp" +#include "mwdialogue/journal.hpp" #include "mwmechanics/mechanicsmanager.hpp" @@ -228,6 +229,7 @@ OMW::Engine::~Engine() delete mEnvironment.mGlobalScripts; delete mEnvironment.mMechanicsManager; delete mEnvironment.mDialogueManager; + delete mEnvironment.mJournal; delete mScriptManager; delete mScriptContext; delete mPhysicEngine; @@ -396,6 +398,7 @@ void OMW::Engine::go() mEnvironment.mMechanicsManager = new MWMechanics::MechanicsManager (mEnvironment); // Create dialog system + mEnvironment.mJournal = new MWDialogue::Journal (mEnvironment); mEnvironment.mDialogueManager = new MWDialogue::DialogueManager (mEnvironment); // load cell diff --git a/apps/openmw/mwdialogue/journal.cpp b/apps/openmw/mwdialogue/journal.cpp new file mode 100644 index 0000000000..3b674a53e2 --- /dev/null +++ b/apps/openmw/mwdialogue/journal.cpp @@ -0,0 +1,10 @@ + +#include "journal.hpp" + +namespace MWDialogue +{ + MWDialogue::Journal::Journal (MWWorld::Environment& environment) + : mEnvironment (environment) + {} + +} diff --git a/apps/openmw/mwdialogue/journal.hpp b/apps/openmw/mwdialogue/journal.hpp new file mode 100644 index 0000000000..1988e230d7 --- /dev/null +++ b/apps/openmw/mwdialogue/journal.hpp @@ -0,0 +1,21 @@ +#ifndef GAME_MMDIALOG_JOURNAL_H +#define GAME_MWDIALOG_JOURNAL_H + +namespace MWWorld +{ + struct Environment; +} + +namespace MWDialogue +{ + class Journal + { + MWWorld::Environment& mEnvironment; + + public: + + Journal (MWWorld::Environment& environment); + }; +} + +#endif diff --git a/apps/openmw/mwworld/environment.hpp b/apps/openmw/mwworld/environment.hpp index c04dfcbf10..a403ee1657 100644 --- a/apps/openmw/mwworld/environment.hpp +++ b/apps/openmw/mwworld/environment.hpp @@ -24,6 +24,7 @@ namespace MWMechanics namespace MWDialogue { class DialogueManager; + class Journal; } namespace MWInput @@ -41,7 +42,7 @@ namespace MWWorld public: Environment() : mWorld (0), mSoundManager (0), mGlobalScripts (0), mWindowManager (0), - mMechanicsManager (0), mDialogueManager (0), mFrameDuration (0), + mMechanicsManager (0), mDialogueManager (0), mJournal (0), mFrameDuration (0), mInputManager (0) {} @@ -51,6 +52,7 @@ namespace MWWorld MWGui::WindowManager *mWindowManager; MWMechanics::MechanicsManager *mMechanicsManager; MWDialogue::DialogueManager *mDialogueManager; + MWDialogue::Journal *mJournal; float mFrameDuration; // For setting GUI mode