diff options
author | Paul Gilbert | 2010-07-15 10:51:11 +0000 |
---|---|---|
committer | Paul Gilbert | 2010-07-15 10:51:11 +0000 |
commit | 43662625111838729d776cd13708382d9ac6b270 (patch) | |
tree | 23f8c2d5225921805fa50e58a57d6a6e39e86193 /engines/m4 | |
parent | 13eb510baf70be80afbad8473c6992b5a5119e99 (diff) | |
download | scummvm-rg350-43662625111838729d776cd13708382d9ac6b270.tar.gz scummvm-rg350-43662625111838729d776cd13708382d9ac6b270.tar.bz2 scummvm-rg350-43662625111838729d776cd13708382d9ac6b270.zip |
Implemented the original game cheat key for displaying the current mouse cursor position
svn-id: r50913
Diffstat (limited to 'engines/m4')
-rw-r--r-- | engines/m4/mads_scene.cpp | 21 | ||||
-rw-r--r-- | engines/m4/mads_scene.h | 2 |
2 files changed, 21 insertions, 2 deletions
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index ba2bbc07e2..3f4b0df1ff 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -66,6 +66,8 @@ MadsScene::MadsScene(MadsEngine *vm): _sceneResources(), Scene(vm, &_sceneResour MadsView::_bgSurface = Scene::_backgroundSurface; MadsView::_depthSurface = Scene::_walkSurface; _interfaceSurface = new MadsInterfaceView(vm); + _showMousePos = false; + _mouseMsgIndex = -1; } MadsScene::~MadsScene() { @@ -349,6 +351,16 @@ void MadsScene::update() { void MadsScene::updateState() { _madsVm->_player.update(); + // Handle refreshing the mouse position display + if (_mouseMsgIndex != -1) + _madsVm->scene()->_kernelMessages.remove(_mouseMsgIndex); + if (_showMousePos) { + char buffer[20]; + sprintf(buffer, "(%d,%d)", _madsVm->_mouse->currentPos().x, _madsVm->_mouse->currentPos().y); + + _mouseMsgIndex = _madsVm->scene()->_kernelMessages.add(Common::Point(5, 5), 0x203, 0, 0, 1, buffer); + } + // Step through the scene _sceneLogic.sceneStep(); @@ -1158,8 +1170,13 @@ bool MadsInterfaceView::handleCheatKey(int32 keycode) { // TODO: Move player to current destination return true; - case Common::KEYCODE_t | (Common::KEYCODE_LALT): - case Common::KEYCODE_t | (Common::KEYCODE_RALT): + case Common::KEYCODE_c | (Common::KBD_CTRL << 24): + // Toggle display of mouse position + _madsVm->scene()->_showMousePos = !_madsVm->scene()->_showMousePos; + break; + + case Common::KEYCODE_t | (Common::KEYCODE_LALT << 24): + case Common::KEYCODE_t | (Common::KEYCODE_RALT << 24): { // Teleport to room //Scene *sceneView = (Scene *)vm->_viewManager->getView(VIEWID_SCENE); diff --git a/engines/m4/mads_scene.h b/engines/m4/mads_scene.h index 5a8897802a..66fefcb0c0 100644 --- a/engines/m4/mads_scene.h +++ b/engines/m4/mads_scene.h @@ -109,6 +109,7 @@ private: MadsSceneLogic _sceneLogic; SpriteAsset *_playerSprites; + int _mouseMsgIndex; void drawElements(); void loadScene2(const char *aaName, int sceneNumber); @@ -119,6 +120,7 @@ private: void setAction(); public: char _aaName[100]; + bool _showMousePos; public: MadsScene(MadsEngine *vm); virtual ~MadsScene(); |