Move action inits to engineInit and engineDone callbacks.

svn-id: r42007
This commit is contained in:
Lars Persson 2009-07-01 20:02:33 +00:00
parent f9298ff403
commit 4b850a2c03
3 changed files with 28 additions and 1 deletions

View File

@ -102,8 +102,15 @@ SymbianActions::SymbianActions()
}
void SymbianActions::initInstanceMain(OSystem *mainSystem) {
int i;
Actions::initInstanceMain(mainSystem);
// Disable all mappings before setting main mappings again
for (i = 0; i < ACTION_LAST; i++) {
_action_enabled[i] = false;
}
// Mouse Up
_action_enabled[ACTION_UP] = true;

View File

@ -471,8 +471,16 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Common::Event &event) {
void OSystem_SDL_Symbian::setWindowCaption(const char *caption) {
OSystem_SDL::setWindowCaption(caption);
}
void OSystem_SDL_Symbian::engineInit() {
// Check mappings for the engine just started
check_mappings();
FIXME: move check_mappings() call to engineInit() & engineDone()
}
void OSystem_SDL_Symbian::engineDone() {
// Need to reset engine to basic state after an engine has been running
GUI::Actions::Instance()->initInstanceMain(this);
}
void OSystem_SDL_Symbian::check_mappings() {

View File

@ -107,6 +107,18 @@ protected:
void setWindowCaption(const char *caption);
/**
* Allows the backend to perform engine specific init.
* Called just before the engine is run.
*/
virtual void engineInit();
/**
* Allows the backend to perform engine specific de-init.
* Called after the engine finishes.
*/
virtual void engineDone();
//
// Used to intialized special game mappings
//