From 2c63d67ceb831f39000cebcdebccf7e1a6281f63 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 7 Jul 2010 18:48:06 +0200 Subject: [PATCH] added gui manager skeleton and a cmake fix --- CMakeLists.txt | 21 ++++----- apps/openmw/engine.cpp | 5 +++ apps/openmw/mwgui/guimanager.cpp | 67 +++++++++++++++++++++++++++++ apps/openmw/mwgui/guimanager.hpp | 48 +++++++++++++++++++++ apps/openmw/mwworld/environment.hpp | 10 ++++- 5 files changed, 137 insertions(+), 14 deletions(-) create mode 100644 apps/openmw/mwgui/guimanager.cpp create mode 100644 apps/openmw/mwgui/guimanager.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 0865ee20f6..e318271ef2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,12 @@ set(GAMESOUND_HEADER apps/openmw/mwsound/extensions.hpp) source_group(apps\\openmw\\mwsound FILES ${GAMESOUND} ${GAMESOUND_HEADER}) +set(GAMEGUI + apps/openmw/mwgui/guimanager.cpp) +set(GAMEGUI_HEADER + apps/openmw/mwgui/guimanager.hpp) +source_group(apps\\openmw\\mwgui FILES ${GAMEGUI} ${GAMEGUI_HEADER}) + set(GAMEWORLD apps/openmw/mwworld/world.cpp) set(GAMEWORLD_HEADER @@ -74,9 +80,9 @@ set(GAMEWORLD_HEADER source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER}) -set(APPS ${GAME} ${GAMEREND} ${GAMEINPUT} ${GAMESCRIPT} ${GAMESOUND} ${GAMEWORLD}) +set(APPS ${GAME} ${GAMEREND} ${GAMEINPUT} ${GAMESCRIPT} ${GAMESOUND} ${GAMEGUI} ${GAMEWORLD}) set(APPS_HEADER ${GAME_HEADER} ${GAMEREND_HEADER} ${GAMEINPUT_HEADER} ${GAMESCRIPT_HEADER} - ${GAMESOUND_HEADER} ${GAMEWORLD_HEADER}) + ${GAMESOUND_HEADER} ${GAMEGUI_HEADER} ${GAMEWORLD_HEADER}) # source directory: components @@ -231,22 +237,11 @@ endif (CMAKE_COMPILER_IS_GNUCC) # Main executable add_executable(openmw - ${BSA} ${BSA_HEADER} - ${TOOLS} ${TOOLS_HEADER} - ${OGRE} ${OGRE_HEADER} - ${INPUT} ${INPUT_HEADER} - ${NIF} ${NIF_HEADER} - ${NIFOGRE} ${NIFOGRE_HEADER} - ${MANGLE_VFS} - ${GAME} - ${ESM_STORE} ${ESM_STORE_HEADER} - ${GAMEREND} ${GAMEREND_HEADER} # ??? # MACOSX_BUNDLE ${COMPONENTS} ${COMPONENTS_HEADER} ${OPENMW_LIBS} ${OPENMW_LIBS_HEADER} ${APPS} ${APPS_HEADER} - ${ESM_HEADER} ${APPLE_BUNDLE_RESOURCES} ) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 8ceeedd995..a56c7838d5 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -17,6 +17,8 @@ #include "mwsound/soundmanager.hpp" +#include "mwgui/guimanager.hpp" + #include "mwworld/world.hpp" #include "mwworld/ptr.hpp" #include "mwworld/environment.hpp" @@ -80,6 +82,7 @@ OMW::Engine::~Engine() mspCommandServer->stop(); delete mEnvironment.mWorld; + delete mEnvironment.mGuiManager; delete mEnvironment.mSoundManager; delete mEnvironment.mGlobalScripts; delete mScriptManager; @@ -192,6 +195,8 @@ void OMW::Engine::go() // Create the world mEnvironment.mWorld = new MWWorld::World (mOgre, mDataDir, mMaster, mCellName, mNewGame); + mEnvironment.mGuiManager = new MWGui::GuiManager; + mEnvironment.mSoundManager = new MWSound::SoundManager; MWScript::registerExtensions (mExtensions); diff --git a/apps/openmw/mwgui/guimanager.cpp b/apps/openmw/mwgui/guimanager.cpp new file mode 100644 index 0000000000..3ce17260f1 --- /dev/null +++ b/apps/openmw/mwgui/guimanager.cpp @@ -0,0 +1,67 @@ + +#include "guimanager.hpp" + +#include + +namespace MWGui +{ + void GuiManager::showBirthDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::showClassDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::showNameDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::showRaceDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::showReviewDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::enableInventoryWindow() + { + std::cout << "" << std::endl; + } + + void GuiManager::enableMagicWindow() + { + std::cout << "" << std::endl; + } + + void GuiManager::enableMapWindow() + { + std::cout << "" << std::endl; + } + + void GuiManager::enableStatsMenu() + { + std::cout << "" << std::endl; + } + + void GuiManager::enableLevelUpDialogue() + { + std::cout << "" << std::endl; + } + + void GuiManager::showRestDialogue() + { + std::cout << "" << std::endl; + } + + bool GuiManager::isGuiActive() const + { + return false; + } +} diff --git a/apps/openmw/mwgui/guimanager.hpp b/apps/openmw/mwgui/guimanager.hpp new file mode 100644 index 0000000000..c20aeae35a --- /dev/null +++ b/apps/openmw/mwgui/guimanager.hpp @@ -0,0 +1,48 @@ +#ifndef GAME_SOUND_GUIMANAGER_H +#define GAME_SOUND_GUIMANAGER_H + +namespace MWGui +{ + class GuiManager + { + public: + + void showBirthDialogue(); + ///< Birthsign (part of the character generation process) + + void showClassDialogue(); + ///< Class selection (part of the character generation process) + + void showNameDialogue(); + ///< Enter character name (part of the character generation process) + + void showRaceDialogue(); + ///< Race selection (part of the character generation process) + + void showReviewDialogue(); + ///< Character generation review (final part of the character generation process) + + void enableInventoryWindow(); + ///< Initially disabled. + + void enableMagicWindow(); + ///< Initially disabled. + + void enableMapWindow(); + ///< Initially disabled. + + void enableStatsMenu(); + ///< Initially disabled. + + void enableLevelUpDialogue(); + ///< Rest/Level-up. Initially disabled. + + void showRestDialogue(); + ///< Rest dialogue: ask player how many hours he wants to sleep. + + bool isGuiActive() const; + ///< Any non-HUD GUI element active (dialogues and windows)? + }; +} + +#endif diff --git a/apps/openmw/mwworld/environment.hpp b/apps/openmw/mwworld/environment.hpp index fe0fa47e75..cfcd7d6bdc 100644 --- a/apps/openmw/mwworld/environment.hpp +++ b/apps/openmw/mwworld/environment.hpp @@ -11,6 +11,11 @@ namespace MWScript class GlobalScripts; } +namespace MWGui +{ + class GuiManager; +} + namespace MWWorld { class World; @@ -19,11 +24,14 @@ namespace MWWorld class Environment { public: - Environment() : mWorld (0), mSoundManager (0), mGlobalScripts (0), mFrameDuration (0) {} + Environment() + : mWorld (0), mSoundManager (0), mGlobalScripts (0), mGuiManager (0), mFrameDuration (0) + {} World *mWorld; MWSound::SoundManager *mSoundManager; MWScript::GlobalScripts *mGlobalScripts; + MWGui::GuiManager *mGuiManager; float mFrameDuration; }; }