diff options
-rw-r--r-- | engines/cge2/console.cpp | 17 | ||||
-rw-r--r-- | engines/cge2/console.h | 5 |
2 files changed, 21 insertions, 1 deletions
diff --git a/engines/cge2/console.cpp b/engines/cge2/console.cpp index c67c7ab788..9bf22ebb89 100644 --- a/engines/cge2/console.cpp +++ b/engines/cge2/console.cpp @@ -22,12 +22,27 @@ #include "cge2/console.h" +#include "cge2/vga13h.h" + namespace CGE2 { -CGE2Console::CGE2Console(CGE2Engine *vm) : GUI::Debugger() { +CGE2Console::CGE2Console(CGE2Engine *vm) : _vm(vm), GUI::Debugger() { + registerCmd("do_carpet_workaround", WRAP_METHOD(CGE2Console, doCarpetWorkaround)); } CGE2Console::~CGE2Console() { } +bool CGE2Console::doCarpetWorkaround(int argc, const char **argv) { + Sprite *spr = _vm->_vga->_showQ->locate(1537); // 1537 is Carpet + + if (spr) { + if (spr->_actionCtrl[1]._ptr == 26) { + spr->_actionCtrl[1]._ptr = 8; + } + } + + return true; +} + } // End of namespace CGE diff --git a/engines/cge2/console.h b/engines/cge2/console.h index 15956bf728..8e8b6835ab 100644 --- a/engines/cge2/console.h +++ b/engines/cge2/console.h @@ -33,6 +33,11 @@ class CGE2Console : public GUI::Debugger { public: CGE2Console(CGE2Engine *vm); virtual ~CGE2Console(); + +private: + bool doCarpetWorkaround(int argc, const char **argv); + + CGE2Engine *_vm; }; } // End of namespace CGE |