diff options
Diffstat (limited to 'engines/cge')
-rw-r--r-- | engines/cge/bitmap.cpp | 7 | ||||
-rw-r--r-- | engines/cge/cge.cpp | 16 | ||||
-rw-r--r-- | engines/cge/cge.h | 5 | ||||
-rw-r--r-- | engines/cge/cge_main.cpp | 62 | ||||
-rw-r--r-- | engines/cge/cge_main.h | 6 | ||||
-rw-r--r-- | engines/cge/detection.cpp | 8 | ||||
-rw-r--r-- | engines/cge/events.cpp | 47 | ||||
-rw-r--r-- | engines/cge/events.h | 3 | ||||
-rw-r--r-- | engines/cge/fileio.cpp | 27 | ||||
-rw-r--r-- | engines/cge/sound.cpp | 6 | ||||
-rw-r--r-- | engines/cge/text.cpp | 2 | ||||
-rw-r--r-- | engines/cge/vga13h.cpp | 11 | ||||
-rw-r--r-- | engines/cge/vga13h.h | 3 | ||||
-rw-r--r-- | engines/cge/vmenu.cpp | 6 | ||||
-rw-r--r-- | engines/cge/vmenu.h | 2 |
15 files changed, 121 insertions, 90 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp index 309b89bdda..7089c8e0d1 100644 --- a/engines/cge/bitmap.cpp +++ b/engines/cge/bitmap.cpp @@ -94,7 +94,7 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill) // Replicate across the entire table for (HideDesc *hdP = b + 1; hdP < (b + _h); hdP++) *hdP = *b; - + b->_skip = 0; // fix the first entry _v = v; _b = b; @@ -123,12 +123,15 @@ Bitmap::~Bitmap() { Bitmap &Bitmap::operator=(const Bitmap &bmp) { debugC(1, kCGEDebugBitmap, "&Bitmap::operator ="); + if (this == &bmp) + return *this; uint8 *v0 = bmp._v; _w = bmp._w; _h = bmp._h; _m = NULL; _map = 0; + _vm = bmp._vm; delete[] _v; if (v0 == NULL) { @@ -354,7 +357,7 @@ bool Bitmap::loadVBM(EncryptedStream *f) { // Read in the palette byte palData[kPalSize]; f->read(palData, kPalSize); - + const byte *srcP = palData; for (int idx = 0; idx < kPalCount; idx++, srcP += 3) { _vm->_bitmapPalette[idx]._r = *srcP; diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp index 875ac34cd0..6cc0c45963 100644 --- a/engines/cge/cge.cpp +++ b/engines/cge/cge.cpp @@ -30,6 +30,8 @@ #include "common/fs.h" #include "engines/advancedDetector.h" #include "engines/util.h" +#include "gui/message.h" + #include "cge/cge.h" #include "cge/vga13h.h" #include "cge/cge_main.h" @@ -50,7 +52,6 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription) DebugMan.addDebugChannel(kCGEDebugEngine, "engine", "CGE Engine debug channel"); _startupMode = 1; - _demoText = kDemo; _oldLev = 0; _pocPtr = 0; _bitmapPalette = NULL; @@ -122,7 +123,7 @@ void CGEEngine::init() { _maxScene = 0; _dark = false; _game = false; - _finis = false; + _endGame = false; _now = 1; _lev = -1; _recentStep = -2; @@ -134,7 +135,6 @@ void CGEEngine::init() { _soundOk = 1; _sprTv = NULL; _gameCase2Cpt = 0; - _offUseCount = 0; _startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1; } @@ -196,6 +196,16 @@ Common::Error CGEEngine::run() { // Run the game cge_main(); + // If game is finished, display ending message + if (_flag[3]) { + Common::String msg = Common::String(_text->getText(kSayTheEnd)); + if (msg.size() != 0) { + g_system->delayMillis(10); + GUI::MessageDialog dialog(msg, "OK"); + dialog.runModal(); + } + } + // Remove game objects deinit(); diff --git a/engines/cge/cge.h b/engines/cge/cge.h index 4ebc836ee0..0e8c5a05bb 100644 --- a/engines/cge/cge.h +++ b/engines/cge/cge.h @@ -78,6 +78,8 @@ class Talk; #define kMapZCnt 20 #define kMapTop 80 +#define kSayTheEnd 41 + // our engine debug channels enum { kCGEDebugBitmap = 1 << 0, @@ -147,7 +149,6 @@ public: const ADGameDescription *_gameDescription; int _startupMode; - int _demoText; int _oldLev; int _pocPtr; bool _music; @@ -157,7 +158,7 @@ public: bool _flag[4]; bool _dark; bool _game; - bool _finis; + bool _endGame; int _now; int _lev; int _mode; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 05a94df606..f4f1cd3e0b 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -150,11 +150,11 @@ void CGEEngine::sndSetVolume() { void CGEEngine::syncHeader(Common::Serializer &s) { debugC(1, kCGEDebugEngine, "CGEEngine::syncHeader(s)"); - int i; + int i = kDemo; s.syncAsUint16LE(_now); s.syncAsUint16LE(_oldLev); - s.syncAsUint16LE(_demoText); + s.syncAsUint16LE(i); // unused Demo string id for (i = 0; i < 5; i++) s.syncAsUint16LE(_game); s.syncAsSint16LE(i); // unused VGA::Mono variable @@ -207,7 +207,7 @@ bool CGEEngine::loadGame(int slotNumber, SavegameHeader *header, bool tiny) { readStream = new Common::MemoryReadStream(dataBuffer, size, DisposeAfterUse::YES); } else { - // Open up the savgame file + // Open up the savegame file Common::String slotName = generateSaveName(slotNumber); Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(slotName); @@ -280,7 +280,7 @@ Common::Error CGEEngine::loadGameState(int slot) { sceneDown(); _hero->park(); resetGame(); - + // If music is playing, kill it. if (_music) _midiPlayer->killMidi(); @@ -305,12 +305,21 @@ Common::Error CGEEngine::saveGameState(int slot, const Common::String &desc) { _hero->park(); _oldLev = _lev; + int x = _hero->_x; + int y = _hero->_y; + int z = _hero->_z; + // Write out the user's progress saveGame(slot, desc); + _commandHandler->addCommand(kCmdLevel, -1, _oldLev, &_sceneLight); // Reload the scene sceneUp(); + // Restore player position + _hero->gotoxy(x, y); + _hero->_z = z; + return Common::kNoError; } @@ -499,7 +508,7 @@ void CGEEngine::loadMapping() { if (!cf.err()) { // Move to the data for the given room cf.seek((_now - 1) * kMapArrSize); - + // Read in the data for (int z = 0; z < kMapZCnt; ++z) { cf.read(&_clusterMap[z][0], kMapXCnt); @@ -518,8 +527,8 @@ Square::Square(CGEEngine *vm) : Sprite(vm, NULL), _vm(vm) { setShapeList(MB); } -void Square::touch(uint16 mask, int x, int y) { - Sprite::touch(mask, x, y); +void Square::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) { + Sprite::touch(mask, x, y, keyCode); if (mask & kMouseLeftUp) { _vm->XZ(_x + x, _y + y).cell() = 0; _vm->_commandHandlerTurbo->addCommand(kCmdKill, -1, 0, this); @@ -706,7 +715,7 @@ void CGEEngine::qGame() { saveGame(0, Common::String("Automatic Savegame")); _vga->sunset(); - _finis = true; + _endGame = true; } void CGEEngine::switchScene(int newScene) { @@ -758,12 +767,12 @@ void System::funTouch() { _funDel = n; } -void System::touch(uint16 mask, int x, int y) { +void System::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) { funTouch(); if (mask & kEventKeyb) { - if (x == Common::KEYCODE_ESCAPE) { - // The original was calling keyClick() + if (keyCode == Common::KEYCODE_ESCAPE) { + // The original was calling keyClick() // The sound is uselessly annoying and noisy, so it has been removed _vm->killText(); if (_vm->_startupMode == 1) { @@ -926,7 +935,7 @@ void CGEEngine::optionTouch(int opt, uint16 mask) { } #pragma argsused -void Sprite::touch(uint16 mask, int x, int y) { +void Sprite::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) { _vm->_sys->funTouch(); if ((mask & kEventAttn) != 0) @@ -1035,7 +1044,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i uint16 len; for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { - len = line.size(); + len = line.size(); lcnt++; strcpy(tmpStr, line.c_str()); if (len == 0 || *tmpStr == '.') @@ -1312,7 +1321,7 @@ void CGEEngine::runGame() { _sceneLight->_flags._tran = true; _vga->_showQ->append(_sceneLight); - _sceneLight->_flags._hide = true; + _sceneLight->_flags._hide = false; const Seq pocSeq[] = { { 0, 0, 0, 0, 20 }, @@ -1403,14 +1412,14 @@ void CGEEngine::runGame() { _keyboard->setClient(_sys); // main loop - while (!_finis && !_quitFlag) { - if (_flag[3]) + while (!_endGame && !_quitFlag) { + if (_flag[3]) // Flag FINIS _commandHandler->addCallback(kCmdExec, -1, 0, kQGame); mainLoop(); } // If finishing game due to closing ScummVM window, explicitly save the game - if (!_finis && canSaveGameStateCurrently()) + if (!_endGame && canSaveGameStateCurrently()) qGame(); _keyboard->setClient(NULL); @@ -1507,22 +1516,9 @@ bool CGEEngine::showTitle(const char *name) { _vga->_showQ->clear(); _vga->copyPage(0, 2); - if (_mode == 0) { -// The auto-load of savegame #0 is currently disabled -#if 0 - if (savegameExists(0)) { - // Load the savegame - loadGame(0, NULL, true); // only system vars - _vga->setColors(_vga->_sysPal, 64); - _vga->update(); - if (_flag[3]) { //flag FINIS - _mode++; - _flag[3] = false; - } - } else -#endif - _mode++; - } + // The original was automatically loading the savegame when available + if (_mode == 0) + _mode++; } if (_mode < 2) diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h index 87199ee524..bde8306f36 100644 --- a/engines/cge/cge_main.h +++ b/engines/cge/cge_main.h @@ -78,7 +78,7 @@ namespace CGE { #define kScrHeight 200 #define kWorldHeight (kScrHeight - kPanHeight) #define kStackSize 2048 -#define kSavegameCheckSum (1956 + _now + _oldLev + _game + _music + _demoText) +#define kSavegameCheckSum (1956 + _now + _oldLev + _game + _music + kDemo) #define kSavegame0Name ("{{INIT}}" kSvgExt) #define kSavegameStrSize 11 #define kGameFrameDelay (1000 / 50) @@ -92,7 +92,7 @@ public: void setPal(); void funTouch(); - virtual void touch(uint16 mask, int x, int y); + virtual void touch(uint16 mask, int x, int y, Common::KeyCode keyCode); void tick(); private: CGEEngine *_vm; @@ -101,7 +101,7 @@ private: class Square : public Sprite { public: Square(CGEEngine *vm); - virtual void touch(uint16 mask, int x, int y); + virtual void touch(uint16 mask, int x, int y, Common::KeyCode keyCode); private: CGEEngine *_vm; }; diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index f723ec8fbd..3d6c24d68b 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -108,7 +108,7 @@ public: } virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { - return detectGameFilebased(allFiles, CGE::fileBasedFallback); + return detectGameFilebased(allFiles, fslist, CGE::fileBasedFallback); } virtual const char *getName() const { @@ -198,7 +198,7 @@ SaveStateList CGEMetaEngine::listSaves(const char *target) const { SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName); - + if (f) { CGE::SavegameHeader header; @@ -217,8 +217,6 @@ SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int sl } else { // Create the return descriptor SaveStateDescriptor desc(slot, header.saveName); - desc.setDeletableFlag(true); - desc.setWriteProtectedFlag(false); desc.setThumbnail(header.thumbnail); desc.setSaveDate(header.saveYear, header.saveMonth, header.saveDay); desc.setSaveTime(header.saveHour, header.saveMinutes); @@ -231,7 +229,7 @@ SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int sl return desc; } } - + return SaveStateDescriptor(); } diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp index 3c561c5659..1530c870ef 100644 --- a/engines/cge/events.cpp +++ b/engines/cge/events.cpp @@ -55,7 +55,7 @@ Sprite *Keyboard::setClient(Sprite *spr) { bool Keyboard::getKey(Common::Event &event) { Common::KeyCode keycode = event.kbd.keycode; - if ((keycode == Common::KEYCODE_LALT) || (keycode == Common::KEYCODE_RALT)) + if (((keycode == Common::KEYCODE_LALT) || (keycode == Common::KEYCODE_RALT)) && event.type == Common::EVENT_KEYDOWN) _keyAlt = true; else _keyAlt = false; @@ -70,12 +70,8 @@ bool Keyboard::getKey(Common::Event &event) { return false; case Common::KEYCODE_F5: if (_vm->canSaveGameStateCurrently()) { - const EnginePlugin *plugin = NULL; - EngineMan.findGame(_vm->_gameDescription->gameid, &plugin); - - GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save"); - dialog->setSaveMode(true); - int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save", true); + int16 savegameId = dialog->runModalWithCurrentTarget(); Common::String savegameDescription = dialog->getResultString(); delete dialog; @@ -85,12 +81,8 @@ bool Keyboard::getKey(Common::Event &event) { return false; case Common::KEYCODE_F7: if (_vm->canLoadGameStateCurrently()) { - const EnginePlugin *plugin = NULL; - EngineMan.findGame(_vm->_gameDescription->gameid, &plugin); - - GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore"); - dialog->setSaveMode(false); - int16 savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore", false); + int16 savegameId = dialog->runModalWithCurrentTarget(); delete dialog; if (savegameId != -1) @@ -117,9 +109,19 @@ bool Keyboard::getKey(Common::Event &event) { case Common::KEYCODE_3: case Common::KEYCODE_4: if (event.kbd.flags & Common::KBD_ALT) { - _vm->_commandHandler->addCommand(kCmdLevel, -1, keycode - '0', NULL); + _vm->_commandHandler->addCommand(kCmdLevel, -1, keycode - Common::KEYCODE_0, NULL); return false; } + // Fallthrough intended + case Common::KEYCODE_5: + case Common::KEYCODE_6: + case Common::KEYCODE_7: + case Common::KEYCODE_8: + if (event.type == Common::EVENT_KEYDOWN && !(event.kbd.flags & Common::KBD_ALT) && keycode != Common::KEYCODE_0) { + _vm->selectPocket(keycode - Common::KEYCODE_1); + return false; + } + break; default: break; } @@ -133,9 +135,11 @@ void Keyboard::newKeyboard(Common::Event &event) { if ((event.type == Common::EVENT_KEYDOWN) && (_client)) { CGEEvent &evt = _vm->_eventManager->getNextEvent(); - evt._x = event.kbd.keycode; // Keycode - evt._mask = kEventKeyb; // Event mask - evt._spritePtr = _client; // Sprite pointer + evt._x = 0; + evt._y = 0; + evt._keyCode = event.kbd.keycode; // Keycode + evt._mask = kEventKeyb; // Event mask + evt._spritePtr = _client; // Sprite pointer } } @@ -202,6 +206,7 @@ void Mouse::newMouse(Common::Event &event) { CGEEvent &evt = _vm->_eventManager->getNextEvent(); evt._x = event.mouse.x; evt._y = event.mouse.y; + evt._keyCode = Common::KEYCODE_INVALID; evt._spritePtr = _vm->spriteAt(evt._x, evt._y); switch (event.type) { @@ -267,7 +272,7 @@ void EventManager::handleEvents() { CGEEvent e = _eventQueue[_eventQueueTail]; if (e._mask) { if (_vm->_mouse->_hold && e._spritePtr != _vm->_mouse->_hold) - _vm->_mouse->_hold->touch(e._mask | kEventAttn, e._x - _vm->_mouse->_hold->_x, e._y - _vm->_mouse->_hold->_y); + _vm->_mouse->_hold->touch(e._mask | kEventAttn, e._x - _vm->_mouse->_hold->_x, e._y - _vm->_mouse->_hold->_y, e._keyCode); // update mouse cursor position if (e._mask & kMouseRoll) @@ -276,11 +281,11 @@ void EventManager::handleEvents() { // activate current touched SPRITE if (e._spritePtr) { if (e._mask & kEventKeyb) - e._spritePtr->touch(e._mask, e._x, e._y); + e._spritePtr->touch(e._mask, e._x, e._y, e._keyCode); else - e._spritePtr->touch(e._mask, e._x - e._spritePtr->_x, e._y - e._spritePtr->_y); + e._spritePtr->touch(e._mask, e._x - e._spritePtr->_x, e._y - e._spritePtr->_y, e._keyCode); } else if (_vm->_sys) - _vm->_sys->touch(e._mask, e._x, e._y); + _vm->_sys->touch(e._mask, e._x, e._y, e._keyCode); if (e._mask & kMouseLeftDown) { _vm->_mouse->_hold = e._spritePtr; diff --git a/engines/cge/events.h b/engines/cge/events.h index 6bbd52e4a5..ab8d87212d 100644 --- a/engines/cge/events.h +++ b/engines/cge/events.h @@ -70,6 +70,7 @@ struct CGEEvent { uint16 _mask; uint16 _x; uint16 _y; + Common::KeyCode _keyCode; Sprite *_spritePtr; }; @@ -104,7 +105,7 @@ private: void handleEvents(); public: EventManager(CGEEngine *vm); - void poll(); + void poll(); void clearEvent(Sprite *spr); CGEEvent &getNextEvent(); diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp index c50db4e929..609d5e86aa 100644 --- a/engines/cge/fileio.cpp +++ b/engines/cge/fileio.cpp @@ -98,7 +98,7 @@ uint16 ResourceManager::XCrypt(void *buf, uint16 length) { for (uint16 i = 0; i < length; i++) *b++ ^= kCryptSeed; - + return kCryptSeed; } @@ -201,9 +201,28 @@ EncryptedStream::EncryptedStream(CGEEngine *vm, const char *name) : _vm(vm) { _error = true; _vm->_resman->seek(kp->_pos); - byte *dataBuffer = (byte *)malloc(kp->_size); - _vm->_resman->read(dataBuffer, kp->_size); - _readStream = new Common::MemoryReadStream(dataBuffer, kp->_size, DisposeAfterUse::YES); + byte *dataBuffer; + int bufSize; + + if ((strlen(name) > 4) && (scumm_stricmp(name + strlen(name) - 4, ".SPR") == 0)) { + // SPR files have some inconsistencies. Some have extra 0x1A at the end, some others + // do not have a carriage return at the end of the last line + // Therefore, we remove this ending 0x1A and add extra new lines. + // This fixes bug #3537527 + dataBuffer = (byte *)malloc(kp->_size + 2); + _vm->_resman->read(dataBuffer, kp->_size); + if (dataBuffer[kp->_size - 1] == 0x1A) + dataBuffer[kp->_size - 1] = '\n'; + dataBuffer[kp->_size] = '\n'; + dataBuffer[kp->_size + 1] = '\n'; + bufSize = kp->_size + 2; + } else { + dataBuffer = (byte *)malloc(kp->_size); + _vm->_resman->read(dataBuffer, kp->_size); + bufSize = kp->_size; + } + + _readStream = new Common::MemoryReadStream(dataBuffer, bufSize, DisposeAfterUse::YES); } uint32 EncryptedStream::read(void *dataPtr, uint32 dataSize) { diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp index 7f74794474..b378898955 100644 --- a/engines/cge/sound.cpp +++ b/engines/cge/sound.cpp @@ -91,6 +91,12 @@ void Sound::sndDigiStart(SmpInfo *PSmpInfo) { // Start the new sound _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, Audio::makeLoopingAudioStream(_audioStream, (uint)PSmpInfo->_counter)); + + // CGE pan: + // 8 = Center + // Less = Left + // More = Right + _vm->_mixer->setChannelBalance(_soundHandle, (int8)CLIP(((PSmpInfo->_span - 8) * 16), -127, 127)); } void Sound::stop() { diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp index fd4120d49d..a8ce8777c5 100644 --- a/engines/cge/text.cpp +++ b/engines/cge/text.cpp @@ -63,7 +63,7 @@ int16 Text::count() { Common::String line; char tmpStr[kLineMax + 1]; - + int counter = 0; for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) { diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp index 186de24036..e178795b7c 100644 --- a/engines/cge/vga13h.cpp +++ b/engines/cge/vga13h.cpp @@ -637,15 +637,6 @@ Vga::Vga(CGEEngine *vm) : _frmCnt(0), _msg(NULL), _name(NULL), _setPal(false), _ _page[idx]->create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } -#if 0 - // This part was used to display credits at the beginning of the game - for (int i = 10; i < 20; i++) { - char *text = _text->getText(i); - if (text) { - debugN(1, "%s\n", text); - } - } -#endif _oldColors = (Dac *)malloc(sizeof(Dac) * kPalCount); _newColors = (Dac *)malloc(sizeof(Dac) * kPalCount); getColors(_oldColors); @@ -834,7 +825,7 @@ void Vga::update() { } } - g_system->copyRectToScreen((const byte *)Vga::_page[0]->getBasePtr(0, 0), kScrWidth, 0, 0, kScrWidth, kScrHeight); + g_system->copyRectToScreen(Vga::_page[0]->getBasePtr(0, 0), kScrWidth, 0, 0, kScrWidth, kScrHeight); g_system->updateScreen(); } diff --git a/engines/cge/vga13h.h b/engines/cge/vga13h.h index beca19f667..a816f7756f 100644 --- a/engines/cge/vga13h.h +++ b/engines/cge/vga13h.h @@ -29,6 +29,7 @@ #define CGE_VGA13H_H #include "common/serializer.h" +#include "common/events.h" #include "graphics/surface.h" #include "cge/general.h" #include "cge/bitmap.h" @@ -146,7 +147,7 @@ public: void step(int nr = -1); Seq *setSeq(Seq *seq); CommandHandler::Command *snList(SnList type); - virtual void touch(uint16 mask, int x, int y); + virtual void touch(uint16 mask, int x, int y, Common::KeyCode keyCode); virtual void tick(); void sync(Common::Serializer &s); private: diff --git a/engines/cge/vmenu.cpp b/engines/cge/vmenu.cpp index a317a765d4..910e54d267 100644 --- a/engines/cge/vmenu.cpp +++ b/engines/cge/vmenu.cpp @@ -63,7 +63,7 @@ Vmenu *Vmenu::_addr = NULL; int Vmenu::_recent = -1; Vmenu::Vmenu(CGEEngine *vm, Choice *list, int x, int y) - : Talk(vm, VMGather(list), kTBRect), _menu(list), _bar(NULL), _vm(vm) { + : Talk(vm, VMGather(list), kTBRect), _menu(list), _bar(NULL), _vmgt(NULL), _vm(vm) { Choice *cp; _addr = this; @@ -89,11 +89,11 @@ Vmenu::~Vmenu() { #define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember)) -void Vmenu::touch(uint16 mask, int x, int y) { +void Vmenu::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) { if (!_items) return; - Sprite::touch(mask, x, y); + Sprite::touch(mask, x, y, keyCode); y -= kTextVMargin - 1; int n = 0; diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 89ef7a9484..928b48f11c 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -58,7 +58,7 @@ public: MenuBar *_bar; Vmenu(CGEEngine *vm, Choice *list, int x, int y); ~Vmenu(); - virtual void touch(uint16 mask, int x, int y); + virtual void touch(uint16 mask, int x, int y, Common::KeyCode keyCode); private: char *_vmgt; CGEEngine *_vm; |