mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 09:15:38 +00:00
routed activate signal from input sub-system to engine-class
This commit is contained in:
parent
87c84e6fcd
commit
2d695cc806
4 changed files with 27 additions and 7 deletions
|
@ -253,7 +253,7 @@ void OMW::Engine::go()
|
|||
|
||||
// Sets up the input system
|
||||
MWInput::MWInputManager input(mOgre, mEnvironment.mWorld->getPlayerPos(),
|
||||
*mEnvironment.mWindowManager, mDebug);
|
||||
*mEnvironment.mWindowManager, mDebug, *this);
|
||||
|
||||
focusFrameCounter = 0;
|
||||
|
||||
|
@ -266,3 +266,8 @@ void OMW::Engine::go()
|
|||
|
||||
std::cout << "Quitting peacefully.\n";
|
||||
}
|
||||
|
||||
void OMW::Engine::activate()
|
||||
{
|
||||
std::cout << "activate" << std::endl;
|
||||
}
|
||||
|
|
|
@ -111,12 +111,15 @@ namespace OMW
|
|||
|
||||
/// Enable verbose script output
|
||||
void enableVerboseScripts();
|
||||
|
||||
|
||||
/// Start as a new game.
|
||||
void setNewGame();
|
||||
|
||||
/// Initialise and enter main loop.
|
||||
void go();
|
||||
|
||||
/// Activate the focussed object.
|
||||
void activate();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include <libs/platform/strings.h>
|
||||
#include "../mwrender/playerpos.hpp"
|
||||
|
||||
#include "../engine.hpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <OgreRoot.h>
|
||||
|
@ -58,6 +60,7 @@ namespace MWInput
|
|||
OEngine::GUI::EventInjectorPtr guiEvents;
|
||||
MWRender::PlayerPos &player;
|
||||
MWGui::WindowManager &windows;
|
||||
OMW::Engine& mEngine;
|
||||
|
||||
// Count screenshots.
|
||||
int shotCount;
|
||||
|
@ -137,7 +140,7 @@ namespace MWInput
|
|||
|
||||
void activate()
|
||||
{
|
||||
|
||||
mEngine.activate();
|
||||
}
|
||||
|
||||
// Exit program now button (which is disabled in GUI mode)
|
||||
|
@ -151,13 +154,15 @@ namespace MWInput
|
|||
InputImpl(OEngine::Render::OgreRenderer &_ogre,
|
||||
MWRender::PlayerPos &_player,
|
||||
MWGui::WindowManager &_windows,
|
||||
bool debug)
|
||||
bool debug,
|
||||
OMW::Engine& engine)
|
||||
: ogre(_ogre),
|
||||
exit(ogre.getWindow()),
|
||||
input(ogre.getWindow(), !debug),
|
||||
poller(input),
|
||||
player(_player),
|
||||
windows(_windows),
|
||||
mEngine (engine),
|
||||
shotCount(0)
|
||||
{
|
||||
using namespace OEngine::Input;
|
||||
|
@ -275,9 +280,10 @@ namespace MWInput
|
|||
MWInputManager::MWInputManager(OEngine::Render::OgreRenderer &ogre,
|
||||
MWRender::PlayerPos &player,
|
||||
MWGui::WindowManager &windows,
|
||||
bool debug)
|
||||
bool debug,
|
||||
OMW::Engine& engine)
|
||||
{
|
||||
impl = new InputImpl(ogre,player,windows,debug);
|
||||
impl = new InputImpl(ogre,player,windows,debug, engine);
|
||||
}
|
||||
|
||||
MWInputManager::~MWInputManager()
|
||||
|
|
|
@ -19,6 +19,11 @@ namespace MWGui
|
|||
class WindowManager;
|
||||
}
|
||||
|
||||
namespace OMW
|
||||
{
|
||||
class Engine;
|
||||
}
|
||||
|
||||
namespace MWInput
|
||||
{
|
||||
// Forward declaration of the real implementation.
|
||||
|
@ -37,7 +42,8 @@ namespace MWInput
|
|||
MWInputManager(OEngine::Render::OgreRenderer &_ogre,
|
||||
MWRender::PlayerPos &_player,
|
||||
MWGui::WindowManager &_windows,
|
||||
bool debug);
|
||||
bool debug,
|
||||
OMW::Engine& engine);
|
||||
~MWInputManager();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue