From 1f39e0b6c676be72a4171964be770faf0411f9ba Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 5 May 2011 19:35:31 -0400 Subject: MOHAWK: Use new MacCursor code instead of convertCrsrCursor() --- engines/mohawk/cursors.cpp | 69 ++++++++++++++++------------------------------ engines/mohawk/cursors.h | 4 +-- 2 files changed, 25 insertions(+), 48 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index 66669e35c9..3327860913 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -29,9 +29,11 @@ #include "common/macresman.h" #include "common/system.h" +#include "common/textconsole.h" #include "common/winexe_ne.h" #include "common/winexe_pe.h" #include "graphics/cursorman.h" +#include "graphics/maccursor.h" #include "graphics/wincursor.h" #ifdef ENABLE_MYST @@ -41,11 +43,6 @@ namespace Mohawk { -static const byte s_bwPalette[] = { - 0x00, 0x00, 0x00, // Black - 0xFF, 0xFF, 0xFF // White -}; - void CursorManager::showCursor() { CursorMan.showMouse(true); } @@ -78,8 +75,13 @@ void CursorManager::setDefaultCursor() { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 }; + static const byte bwPalette[] = { + 0x00, 0x00, 0x00, // Black + 0xFF, 0xFF, 0xFF // White + }; + CursorMan.replaceCursor(defaultCursor, 12, 20, 0, 0, 0); - CursorMan.replaceCursorPalette(s_bwPalette, 1, 2); + CursorMan.replaceCursorPalette(bwPalette, 1, 2); } void CursorManager::setCursor(uint16 id) { @@ -87,35 +89,24 @@ void CursorManager::setCursor(uint16 id) { setDefaultCursor(); } -void CursorManager::setMacXorCursor(Common::SeekableReadStream *stream) { +void CursorManager::setMacCursor(Common::SeekableReadStream *stream) { assert(stream); - byte cursorBitmap[16 * 16]; + Graphics::MacCursor *macCursor = new Graphics::MacCursor(); - // Get black and white data - for (int i = 0; i < 32; i++) { - byte imageByte = stream->readByte(); - for (int b = 0; b < 8; b++) - cursorBitmap[i * 8 + b] = (imageByte & (0x80 >> b)) ? 1 : 2; - } + if (!macCursor->readFromStream(*stream)) + error("Could not parse Mac cursor"); - // Apply mask data - for (int i = 0; i < 32; i++) { - byte imageByte = stream->readByte(); - for (int b = 0; b < 8; b++) - if ((imageByte & (0x80 >> b)) == 0) - cursorBitmap[i * 8 + b] = 0; - } - - uint16 hotspotY = stream->readUint16BE(); - uint16 hotspotX = stream->readUint16BE(); + CursorMan.replaceCursor(macCursor->getSurface(), macCursor->getWidth(), macCursor->getHeight(), + macCursor->getHotspotX(), macCursor->getHotspotY(), macCursor->getKeyColor()); + CursorMan.replaceCursorPalette(macCursor->getPalette(), 0, 256); - CursorMan.replaceCursor(cursorBitmap, 16, 16, hotspotX, hotspotY, 0); - CursorMan.replaceCursorPalette(s_bwPalette, 1, 2); + delete macCursor; + delete stream; } void DefaultCursorManager::setCursor(uint16 id) { - setMacXorCursor(_vm->getResource(_tag, id)); + setMacCursor(_vm->getResource(_tag, id)); } #ifdef ENABLE_MYST @@ -223,26 +214,12 @@ void MacCursorManager::setCursor(uint16 id) { // Try a color cursor first Common::SeekableReadStream *stream = _resFork->getResource(MKTAG('c','r','s','r'), id); - if (stream) { - byte *cursor, *palette; - int width, height, hotspotX, hotspotY, keyColor, palSize; - - _resFork->convertCrsrCursor(stream, &cursor, width, height, hotspotX, hotspotY, keyColor, true, &palette, palSize); - - CursorMan.replaceCursor(cursor, width, height, hotspotX, hotspotY, keyColor); - CursorMan.replaceCursorPalette(palette, 0, palSize); - - delete[] cursor; - delete[] palette; - delete stream; - return; - } - - // Fall back to b&w cursors - stream = _resFork->getResource(MKTAG('C','U','R','S'), id); + // Fall back to monochrome cursors + if (!stream) + stream = _resFork->getResource(MKTAG('C','U','R','S'), id); if (stream) { - setMacXorCursor(stream); + setMacCursor(stream); delete stream; } else { setDefaultCursor(); @@ -265,7 +242,7 @@ LivingBooksCursorManager_v2::~LivingBooksCursorManager_v2() { void LivingBooksCursorManager_v2::setCursor(uint16 id) { if (_sysArchive && _sysArchive->hasResource(ID_TCUR, id)) { - setMacXorCursor(_sysArchive->getResource(ID_TCUR, id)); + setMacCursor(_sysArchive->getResource(ID_TCUR, id)); } else { // TODO: Handle generated cursors } diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h index 1fb8b35714..ba9700c9f9 100644 --- a/engines/mohawk/cursors.h +++ b/engines/mohawk/cursors.h @@ -63,8 +63,8 @@ public: virtual bool hasSource() const { return false; } protected: - // Set a Mac XOR/AND map cursor to the screen - void setMacXorCursor(Common::SeekableReadStream *stream); + // Set a Mac CURS/crsr cursor to the screen + void setMacCursor(Common::SeekableReadStream *stream); }; // The default Mohawk cursor manager -- cgit v1.2.3 From 69b1485a22dc2b8a2cfe0bd10edcbaad0da0cf6e Mon Sep 17 00:00:00 2001 From: strangerke Date: Thu, 12 May 2011 01:13:57 +0200 Subject: GIT: Clean up: Suppress SVN tags, now useless --- engines/mohawk/bitmap.cpp | 3 --- engines/mohawk/bitmap.h | 3 --- engines/mohawk/console.cpp | 3 --- engines/mohawk/console.h | 3 --- engines/mohawk/cstime.cpp | 3 --- engines/mohawk/cstime.h | 3 --- engines/mohawk/cstime_cases.cpp | 3 --- engines/mohawk/cstime_cases.h | 3 --- engines/mohawk/cstime_game.cpp | 3 --- engines/mohawk/cstime_game.h | 3 --- engines/mohawk/cstime_ui.cpp | 3 --- engines/mohawk/cstime_ui.h | 3 --- engines/mohawk/cstime_view.cpp | 3 --- engines/mohawk/cstime_view.h | 3 --- engines/mohawk/cursors.cpp | 3 --- engines/mohawk/cursors.h | 3 --- engines/mohawk/detection.cpp | 3 --- engines/mohawk/detection_tables.h | 3 --- engines/mohawk/dialogs.cpp | 3 --- engines/mohawk/dialogs.h | 3 --- engines/mohawk/graphics.cpp | 3 --- engines/mohawk/graphics.h | 3 --- engines/mohawk/installer_archive.cpp | 3 --- engines/mohawk/installer_archive.h | 3 --- engines/mohawk/livingbooks.cpp | 3 --- engines/mohawk/livingbooks.h | 3 --- engines/mohawk/livingbooks_code.cpp | 3 --- engines/mohawk/livingbooks_code.h | 3 --- engines/mohawk/mohawk.cpp | 3 --- engines/mohawk/mohawk.h | 3 --- engines/mohawk/myst.cpp | 3 --- engines/mohawk/myst.h | 3 --- engines/mohawk/myst_areas.cpp | 3 --- engines/mohawk/myst_areas.h | 3 --- engines/mohawk/myst_scripts.cpp | 3 --- engines/mohawk/myst_scripts.h | 3 --- engines/mohawk/myst_stacks/channelwood.cpp | 3 --- engines/mohawk/myst_stacks/channelwood.h | 3 --- engines/mohawk/myst_stacks/credits.cpp | 3 --- engines/mohawk/myst_stacks/credits.h | 3 --- engines/mohawk/myst_stacks/demo.cpp | 3 --- engines/mohawk/myst_stacks/demo.h | 3 --- engines/mohawk/myst_stacks/dni.cpp | 3 --- engines/mohawk/myst_stacks/dni.h | 3 --- engines/mohawk/myst_stacks/intro.cpp | 3 --- engines/mohawk/myst_stacks/intro.h | 3 --- engines/mohawk/myst_stacks/makingof.cpp | 3 --- engines/mohawk/myst_stacks/makingof.h | 3 --- engines/mohawk/myst_stacks/mechanical.cpp | 3 --- engines/mohawk/myst_stacks/mechanical.h | 3 --- engines/mohawk/myst_stacks/myst.cpp | 3 --- engines/mohawk/myst_stacks/myst.h | 3 --- engines/mohawk/myst_stacks/preview.cpp | 3 --- engines/mohawk/myst_stacks/preview.h | 3 --- engines/mohawk/myst_stacks/selenitic.cpp | 3 --- engines/mohawk/myst_stacks/selenitic.h | 3 --- engines/mohawk/myst_stacks/slides.cpp | 3 --- engines/mohawk/myst_stacks/slides.h | 3 --- engines/mohawk/myst_stacks/stoneship.cpp | 3 --- engines/mohawk/myst_stacks/stoneship.h | 3 --- engines/mohawk/myst_state.cpp | 3 --- engines/mohawk/myst_state.h | 3 --- engines/mohawk/resource.cpp | 3 --- engines/mohawk/resource.h | 3 --- engines/mohawk/resource_cache.cpp | 3 --- engines/mohawk/resource_cache.h | 3 --- engines/mohawk/riven.cpp | 3 --- engines/mohawk/riven.h | 3 --- engines/mohawk/riven_external.cpp | 3 --- engines/mohawk/riven_external.h | 3 --- engines/mohawk/riven_saveload.cpp | 3 --- engines/mohawk/riven_saveload.h | 3 --- engines/mohawk/riven_scripts.cpp | 3 --- engines/mohawk/riven_scripts.h | 3 --- engines/mohawk/riven_vars.cpp | 3 --- engines/mohawk/sound.cpp | 3 --- engines/mohawk/sound.h | 3 --- engines/mohawk/video.cpp | 3 --- engines/mohawk/video.h | 3 --- engines/mohawk/view.cpp | 3 --- engines/mohawk/view.h | 3 --- 81 files changed, 243 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp index 02548d58fc..d54e2dac6b 100644 --- a/engines/mohawk/bitmap.cpp +++ b/engines/mohawk/bitmap.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/bitmap.h" diff --git a/engines/mohawk/bitmap.h b/engines/mohawk/bitmap.h index ea8a130dfc..74218882e8 100644 --- a/engines/mohawk/bitmap.h +++ b/engines/mohawk/bitmap.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_BITMAP_H diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 93cbe87e55..4e5b7186ff 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/console.h" diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index cb0e8501cd..cdb4e1bedf 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CONSOLE_H diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 46faae08f5..0bc480ec24 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime.h" diff --git a/engines/mohawk/cstime.h b/engines/mohawk/cstime.h index 40293916db..3a1de6a137 100644 --- a/engines/mohawk/cstime.h +++ b/engines/mohawk/cstime.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_H diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp index c4801f822c..c0a8dfc0e3 100644 --- a/engines/mohawk/cstime_cases.cpp +++ b/engines/mohawk/cstime_cases.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_cases.h" diff --git a/engines/mohawk/cstime_cases.h b/engines/mohawk/cstime_cases.h index 6f7630648e..1ac9abf87e 100644 --- a/engines/mohawk/cstime_cases.h +++ b/engines/mohawk/cstime_cases.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_CASES_H diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp index 66dce1da92..2e21111025 100644 --- a/engines/mohawk/cstime_game.cpp +++ b/engines/mohawk/cstime_game.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" diff --git a/engines/mohawk/cstime_game.h b/engines/mohawk/cstime_game.h index 661fdbaa41..88e813c999 100644 --- a/engines/mohawk/cstime_game.h +++ b/engines/mohawk/cstime_game.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_GAME_H diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index 106f7ea319..ee08384590 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" diff --git a/engines/mohawk/cstime_ui.h b/engines/mohawk/cstime_ui.h index 3ec38492d7..27df7cac3e 100644 --- a/engines/mohawk/cstime_ui.h +++ b/engines/mohawk/cstime_ui.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_UI_H diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp index 12d641a9ff..37c418f416 100644 --- a/engines/mohawk/cstime_view.cpp +++ b/engines/mohawk/cstime_view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cstime_game.h" // debugging.. diff --git a/engines/mohawk/cstime_view.h b/engines/mohawk/cstime_view.h index 8db8794ce5..ae3283771d 100644 --- a/engines/mohawk/cstime_view.h +++ b/engines/mohawk/cstime_view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CSTIME_VIEW_H diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index 3327860913..c01aef9581 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h index ba9700c9f9..d92b6b4285 100644 --- a/engines/mohawk/cursors.h +++ b/engines/mohawk/cursors.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_CURSORS_H diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index c14d3327d0..3b7efe714d 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "base/plugins.h" diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index 36dbcbde7b..5510643d04 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ namespace Mohawk { diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 4c7e52f02f..eee5b152ee 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 106a1566fc..5cadf95574 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_DIALOGS_H diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index a1bcb55f7b..9e02e70a22 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index c7e9b98d49..e1f0b50078 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_GRAPHICS_H diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp index 5079375896..83796158a6 100644 --- a/engines/mohawk/installer_archive.cpp +++ b/engines/mohawk/installer_archive.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/installer_archive.h" diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h index d33fbe5bcd..27877d69f9 100644 --- a/engines/mohawk/installer_archive.h +++ b/engines/mohawk/installer_archive.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/archive.h" diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 2475965812..1fb9f4a477 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index cd3b206d57..81a049c5fe 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_H diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 4237c712d9..1cc8aea873 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/livingbooks.h" diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index cd9ac1004a..d64ce5af67 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_LIVINGBOOKS_CODE_H diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp index f63645f1ac..faf52595b7 100644 --- a/engines/mohawk/mohawk.cpp +++ b/engines/mohawk/mohawk.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index 8a853d151e..b189f82040 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_H diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 655a38b578..f7f1edf4e5 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 47e8a6562c..aeb0d4c83e 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_MYST_H diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index dc00bff923..294fcea2f1 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/graphics.h" diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index aa06d1a5b4..136356ea4f 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 71c408ed37..6148c48c60 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index e4f4cc3cfe..c32d6a9266 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_H diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index cba2583a50..2ed651fb9c 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 5eeaa63e23..43820aa125 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CHANNELWOOD_H diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp index bb8397fd09..ad593e3542 100644 --- a/engines/mohawk/myst_stacks/credits.cpp +++ b/engines/mohawk/myst_stacks/credits.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/credits.h b/engines/mohawk/myst_stacks/credits.h index 4f9eaa2944..a1f8b0a7d8 100644 --- a/engines/mohawk/myst_stacks/credits.h +++ b/engines/mohawk/myst_stacks/credits.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_CREDITS_H diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp index a2dd148b22..53d946dd66 100644 --- a/engines/mohawk/myst_stacks/demo.cpp +++ b/engines/mohawk/myst_stacks/demo.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/demo.h b/engines/mohawk/myst_stacks/demo.h index 054dc7befe..4f8d68759b 100644 --- a/engines/mohawk/myst_stacks/demo.h +++ b/engines/mohawk/myst_stacks/demo.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DEMO_H diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp index e2a11eb94f..cf28945c71 100644 --- a/engines/mohawk/myst_stacks/dni.cpp +++ b/engines/mohawk/myst_stacks/dni.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h index b50f018d3e..7f04287082 100644 --- a/engines/mohawk/myst_stacks/dni.h +++ b/engines/mohawk/myst_stacks/dni.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_DNI_H diff --git a/engines/mohawk/myst_stacks/intro.cpp b/engines/mohawk/myst_stacks/intro.cpp index 0d8f67a85b..7d3179fa24 100644 --- a/engines/mohawk/myst_stacks/intro.cpp +++ b/engines/mohawk/myst_stacks/intro.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/intro.h b/engines/mohawk/myst_stacks/intro.h index 0ecd9e6883..9fe3920e53 100644 --- a/engines/mohawk/myst_stacks/intro.h +++ b/engines/mohawk/myst_stacks/intro.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_INTRO_H diff --git a/engines/mohawk/myst_stacks/makingof.cpp b/engines/mohawk/myst_stacks/makingof.cpp index e639092ed4..b5ad647381 100644 --- a/engines/mohawk/myst_stacks/makingof.cpp +++ b/engines/mohawk/myst_stacks/makingof.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/makingof.h b/engines/mohawk/myst_stacks/makingof.h index 3033bb851e..d4bc0fd9f2 100644 --- a/engines/mohawk/myst_stacks/makingof.h +++ b/engines/mohawk/myst_stacks/makingof.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MAKINGOF_H diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index c5c11026f5..452c8c8ed1 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 6a0aa30f5c..60b7d129fc 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MECHANICAL_H diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 2b8ef94442..43cbdc85e4 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index 51dffd0abe..ca546e202b 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_MYST_H diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index fddf6290fb..37b749f100 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/preview.h b/engines/mohawk/myst_stacks/preview.h index 870e4b9272..7e4e418eef 100644 --- a/engines/mohawk/myst_stacks/preview.h +++ b/engines/mohawk/myst_stacks/preview.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_PREVIEW_H diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index c670cb6a48..1473742259 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 4ec92b9869..fd4e937f63 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SELENITIC_H diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp index 4057edd9c9..72b299ee6d 100644 --- a/engines/mohawk/myst_stacks/slides.cpp +++ b/engines/mohawk/myst_stacks/slides.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/myst.h" diff --git a/engines/mohawk/myst_stacks/slides.h b/engines/mohawk/myst_stacks/slides.h index 1e0504a665..8bc61d0e24 100644 --- a/engines/mohawk/myst_stacks/slides.h +++ b/engines/mohawk/myst_stacks/slides.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_SLIDES_H diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index 07701c273e..e0c374a926 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index 091fdcd169..6def83f2ab 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SCRIPTS_STONESHIP_H diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index de71dcf382..fbb8bf0ac2 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index 074c3e5f10..c7a6c0b4ac 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MYST_SAVELOAD_H diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index 62250b75f2..3a95b83199 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/resource.h b/engines/mohawk/resource.h index 07c727951c..cabce04e38 100644 --- a/engines/mohawk/resource.h +++ b/engines/mohawk/resource.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/scummsys.h" diff --git a/engines/mohawk/resource_cache.cpp b/engines/mohawk/resource_cache.cpp index 75f608f5fd..e73d8c43d3 100644 --- a/engines/mohawk/resource_cache.cpp +++ b/engines/mohawk/resource_cache.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" diff --git a/engines/mohawk/resource_cache.h b/engines/mohawk/resource_cache.h index 32e345cf4b..b7eac9ebd7 100644 --- a/engines/mohawk/resource_cache.h +++ b/engines/mohawk/resource_cache.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RESOURCE_CACHE_H diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 3d496d0f38..417a5b5f74 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/config-manager.h" diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 3aba5643db..e01e03895c 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_RIVEN_H diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index dc0d66f19b..8ad05ded13 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_external.h b/engines/mohawk/riven_external.h index 034cd662f6..5f5d0cb0b2 100644 --- a/engines/mohawk/riven_external.h +++ b/engines/mohawk/riven_external.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_EXTERNAL_H diff --git a/engines/mohawk/riven_saveload.cpp b/engines/mohawk/riven_saveload.cpp index 35ce7aad84..35d82d4aa0 100644 --- a/engines/mohawk/riven_saveload.cpp +++ b/engines/mohawk/riven_saveload.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/resource.h" diff --git a/engines/mohawk/riven_saveload.h b/engines/mohawk/riven_saveload.h index fbd9f7cb36..c1b3fc639e 100644 --- a/engines/mohawk/riven_saveload.h +++ b/engines/mohawk/riven_saveload.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SAVELOAD_H diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index b8f86f993a..b3d5369a84 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/cursors.h" diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 2ac805c366..75d4592e55 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef RIVEN_SCRIPTS_H diff --git a/engines/mohawk/riven_vars.cpp b/engines/mohawk/riven_vars.cpp index 7f06a67a1d..946e2e0496 100644 --- a/engines/mohawk/riven_vars.cpp +++ b/engines/mohawk/riven_vars.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/str.h" diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index fba87808d2..2428f1bdb0 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/sound.h" diff --git a/engines/mohawk/sound.h b/engines/mohawk/sound.h index 702c6f61f3..593f2fcd0b 100644 --- a/engines/mohawk/sound.h +++ b/engines/mohawk/sound.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_SOUND_H diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index 8f57d61cc4..0a74d058c9 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/mohawk.h" diff --git a/engines/mohawk/video.h b/engines/mohawk/video.h index e65629a1ec..efa81edfbd 100644 --- a/engines/mohawk/video.h +++ b/engines/mohawk/video.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIDEO_H diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp index e5a44122ea..36e8f8466e 100644 --- a/engines/mohawk/view.cpp +++ b/engines/mohawk/view.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "mohawk/view.h" diff --git a/engines/mohawk/view.h b/engines/mohawk/view.h index 14a47eebe4..06ffe605a3 100644 --- a/engines/mohawk/view.h +++ b/engines/mohawk/view.h @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #ifndef MOHAWK_VIEW_H -- cgit v1.2.3 From 4f5ecc4861f170c4a7881140533846db1095fa5b Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 12 May 2011 20:53:53 +0200 Subject: MOHAWK: Implement Mechanical opcodes 101, 103 and 202. Singing Bird. --- engines/mohawk/myst_stacks/mechanical.cpp | 68 +++++++++++++++++++++++-------- engines/mohawk/myst_stacks/mechanical.h | 13 ++++-- 2 files changed, 60 insertions(+), 21 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index 452c8c8ed1..b8a6b3110e 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -51,6 +51,9 @@ Mechanical::~Mechanical() { void Mechanical::setupOpcodes() { // "Stack-Specific" Opcodes OPCODE(100, o_throneEnablePassage); + OPCODE(101, o_birdCrankStart); + OPCODE(102, NOP); + OPCODE(103, o_birdCrankStop); OPCODE(104, o_snakeBoxTrigger); OPCODE(105, o_fortressStaircaseMovie); OPCODE(106, o_elevatorRotationStart); @@ -72,7 +75,7 @@ void Mechanical::setupOpcodes() { // "Init" Opcodes OPCODE(200, o_throne_init); OPCODE(201, o_fortressStaircase_init); - OPCODE(202, opcode_202); + OPCODE(202, o_bird_init); OPCODE(203, o_snakeBox_init); OPCODE(204, o_elevatorRotation_init); OPCODE(205, opcode_205); @@ -86,15 +89,16 @@ void Mechanical::setupOpcodes() { #undef OPCODE void Mechanical::disablePersistentScripts() { - opcode_202_disable(); opcode_205_disable(); opcode_206_disable(); opcode_209_disable(); _elevatorGoingMiddle = false; + _birdSinging = false; } void Mechanical::runPersistentScripts() { - opcode_202_run(); + if (_birdSinging) + birdSing_run(); if (_elevatorRotationLeverMoving) elevatorRotation_run(); @@ -242,6 +246,38 @@ void Mechanical::o_throneEnablePassage(uint16 op, uint16 var, uint16 argc, uint1 _vm->_resources[argv[0]]->setEnabled(getVar(var)); } +void Mechanical::o_birdCrankStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank start", op); + + MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + + uint16 crankSoundId = crank->getList2(0); + _vm->_sound->replaceSoundMyst(crankSoundId, Audio::Mixer::kMaxChannelVolume, true); + + _birdSingEndTime = 0; + _birdCrankStartTime = _vm->_system->getMillis(); + + MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + crankMovie->playMovie(); +} + +void Mechanical::o_birdCrankStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird crank stop", op); + + MystResourceType11 *crank = static_cast<MystResourceType11 *>(_invokingResource); + + MystResourceType6 *crankMovie = static_cast<MystResourceType6 *>(crank->getSubResource(0)); + crankMovie->pauseMovie(true); + + uint16 crankSoundId = crank->getList2(1); + _vm->_sound->replaceSoundMyst(crankSoundId); + + _birdSingEndTime = 2 * _vm->_system->getMillis() - _birdCrankStartTime; + _birdSinging = true; + + _bird->playMovie(); +} + void Mechanical::o_snakeBoxTrigger(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Trigger Playing Of Snake Movie", op); @@ -512,25 +548,21 @@ void Mechanical::o_fortressStaircase_init(uint16 op, uint16 var, uint16 argc, ui _vm->_resources[argv[2]]->setEnabled(_state.staircaseState); } -static struct { - bool enabled; -} g_opcode202Parameters; - -void Mechanical::opcode_202_run() { +void Mechanical::birdSing_run() { // Used for Card 6220 (Sirrus' Mechanical Bird) - // TODO: Fill in Function + uint32 time = _vm->_system->getMillis(); + if (_birdSingEndTime < time) { + _bird->pauseMovie(true); + _birdSinging = false; + } } -void Mechanical::opcode_202_disable() { - g_opcode202Parameters.enabled = false; -} +void Mechanical::o_bird_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Mechanical bird init", op); -void Mechanical::opcode_202(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - // Used for Card 6220 (Sirrus' Mechanical Bird) - if (argc == 0) - g_opcode202Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _birdSinging = false; + _birdSingEndTime = 0; + _bird = static_cast<MystResourceType6 *>(_invokingResource); } void Mechanical::o_snakeBox_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 60b7d129fc..320fbb77cd 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -49,8 +49,7 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); - void opcode_202_run(); - void opcode_202_disable(); + void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); void opcode_205_run(); @@ -61,6 +60,8 @@ private: void opcode_209_disable(); DECLARE_OPCODE(o_throneEnablePassage); + DECLARE_OPCODE(o_birdCrankStart); + DECLARE_OPCODE(o_birdCrankStop); DECLARE_OPCODE(o_snakeBoxTrigger); DECLARE_OPCODE(o_fortressStaircaseMovie); DECLARE_OPCODE(o_elevatorRotationStart); @@ -81,7 +82,7 @@ private: DECLARE_OPCODE(o_throne_init); DECLARE_OPCODE(o_fortressStaircase_init); - DECLARE_OPCODE(opcode_202); + DECLARE_OPCODE(o_bird_init); DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(o_elevatorRotation_init); DECLARE_OPCODE(opcode_205); @@ -110,6 +111,12 @@ private: uint16 _crystalLit; // 130 + bool _birdSinging; // 144 + uint32 _birdCrankStartTime; // 136 + uint32 _birdSingEndTime; // 140 + MystResourceType6 *_bird; // 152 + + MystResourceType6 *_snakeBox; // 156 }; -- cgit v1.2.3 From 15856a18439fc8652e41c6b7a5ca9d2ab5d0b283 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 13 May 2011 23:02:06 +0200 Subject: MOHAWK: Add basic LBProxyItem support. --- engines/mohawk/livingbooks.cpp | 34 ++++++++++++++++++++++++++++++++++ engines/mohawk/livingbooks.h | 11 +++++++++++ 2 files changed, 45 insertions(+) (limited to 'engines/mohawk') diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 1fb9f4a477..f91711302c 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -743,6 +743,9 @@ void LBPage::loadBITL(uint16 resourceId) { case kLBMiniGameItem: res = new LBMiniGameItem(_vm, this, rect); break; + case kLBProxyItem: + res = new LBProxyItem(_vm, this, rect); + break; default: warning("Unknown item type %04x", type); case 3: // often used for buttons @@ -3745,4 +3748,35 @@ bool LBMiniGameItem::togglePlaying(bool playing, bool restart) { return false; } +LBProxyItem::LBProxyItem(MohawkEngine_LivingBooks *vm, LBPage *page, Common::Rect rect) : LBItem(vm, page, rect) { + debug(3, "new LBProxyItem"); + + _page = NULL; +} + +LBProxyItem::~LBProxyItem() { + delete _page; +} + +void LBProxyItem::init() { + Common::String leftover; + Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover); + if (!leftover.empty()) + error("LBProxyItem tried loading proxy '%s' but got leftover '%s'", _desc.c_str(), leftover.c_str()); + uint16 baseId; + for (uint i = 0; i < filename.size(); i++) { + if (filename[i] == ';') { + baseId = atoi(filename.c_str() + i + 1); + filename = Common::String(filename.c_str(), i); + } + } + + debug(1, "LBProxyItem loading archive '%s' with id %d", filename.c_str(), baseId); + MohawkArchive *pageArchive = _vm->createMohawkArchive(); + if (!pageArchive->open(filename)) + error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str()); + _page = new LBPage(_vm); + _page->open(pageArchive, baseId); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 81a049c5fe..de84b0f13f 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -571,6 +571,17 @@ public: bool togglePlaying(bool playing, bool restart); }; +class LBProxyItem : public LBItem { +public: + LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); + ~LBProxyItem(); + + void init(); + +protected: + class LBPage *_page; +}; + struct NotifyEvent { NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { } uint type; -- cgit v1.2.3 From 80249e34455320afc0ac3db4f8e78c803dd5b5ab Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 13 May 2011 23:02:44 +0200 Subject: MOHAWK: Add/improve LB debug output a little. --- engines/mohawk/livingbooks.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index f91711302c..36d86fb747 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -290,6 +290,15 @@ void MohawkEngine_LivingBooks::loadBookInfo(const Common::String &filename) { // - fUse254ColorPalette (always true?) // - nKBRequired (4096, RAM requirement?) // - fDebugWindow (always 0?) + + if (_bookInfoFile.hasSection("Globals")) { + const Common::ConfigFile::SectionKeyList globals = _bookInfoFile.getKeys("Globals"); + for (Common::ConfigFile::SectionKeyList::const_iterator i = globals.begin(); i != globals.end(); i++) { + Common::String command = Common::String::format("%s = %s", i->key.c_str(), i->value.c_str()); + debug("global: %s", command.c_str()); + // TODO: run command + } + } } Common::String MohawkEngine_LivingBooks::stringForMode(LBMode mode) { @@ -2700,10 +2709,20 @@ int LBItem::runScriptEntry(LBScriptEntry *entry) { break; case kLBOpLoad: + // FIXME + warning("ignoring kLBOpLoad (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpPreload: + // FIXME + warning("ignoring kLBOpPreload (event 0x%04x, param 0x%04x, target '%s')", + entry->event, entry->param, target->_desc.c_str()); + break; + case kLBOpUnload: // FIXME - warning("ignoring kLBOpLoad/Preload/Unload (event 0x%04x, param 0x%04x, target '%s')", + warning("ignoring kLBOpUnload (event 0x%04x, param 0x%04x, target '%s')", entry->event, entry->param, target->_desc.c_str()); break; -- cgit v1.2.3 From 3ed095434f471d1cecde2f8c2c805f7d22aed572 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 13 May 2011 23:03:47 +0200 Subject: MOHAWK: Stub another two LB script functions. --- engines/mohawk/livingbooks_code.cpp | 12 ++++++++++-- engines/mohawk/livingbooks_code.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 1cc8aea873..165ca4a328 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -606,7 +606,7 @@ CodeCommandInfo generalCommandInfo[NUM_GENERAL_COMMANDS] = { { "move", 0 }, { 0, 0 }, { 0, 0 }, - { "setDragParams", 0 }, + { "setDragParams", &LBCode::cmdSetDragParams }, { "resetDragParams", 0 }, { "enableRollover", &LBCode::cmdUnimplemented /* FIXME */ }, { "setCursor", 0 }, @@ -801,6 +801,10 @@ void LBCode::cmdRight(const Common::Array<LBValue> ¶ms) { _stack.push(rect.right); } +void LBCode::cmdSetDragParams(const Common::Array<LBValue> ¶ms) { + warning("ignoring setDragParams"); +} + void LBCode::cmdSetPlayParams(const Common::Array<LBValue> ¶ms) { if (params.size() > 8) error("too many parameters (%d) to setPlayParams", params.size()); @@ -875,7 +879,7 @@ CodeCommandInfo itemCommandInfo[NUM_ITEM_COMMANDS] = { { "isLoaded", 0 }, { "isDragging", 0 }, { "load", 0 }, - { "moveTo", 0 }, + { "moveTo", &LBCode::itemMoveTo }, { "mute", 0 }, { "play", 0 }, { "seek", 0 }, @@ -910,6 +914,10 @@ void LBCode::itemIsPlaying(const Common::Array<LBValue> ¶ms) { _stack.push(0); } +void LBCode::itemMoveTo(const Common::Array<LBValue> ¶ms) { + warning("ignoring moveTo"); +} + void LBCode::itemSetParent(const Common::Array<LBValue> ¶ms) { if (params.size() > 2) error("incorrect number of parameters (%d) to setParent", params.size()); diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h index d64ce5af67..9602e2d22d 100644 --- a/engines/mohawk/livingbooks_code.h +++ b/engines/mohawk/livingbooks_code.h @@ -222,12 +222,14 @@ public: void cmdLeft(const Common::Array<LBValue> ¶ms); void cmdBottom(const Common::Array<LBValue> ¶ms); void cmdRight(const Common::Array<LBValue> ¶ms); + void cmdSetDragParams(const Common::Array<LBValue> ¶ms); void cmdSetPlayParams(const Common::Array<LBValue> ¶ms); void cmdSetKeyEvent(const Common::Array<LBValue> ¶ms); void cmdSetHitTest(const Common::Array<LBValue> ¶ms); void cmdKey(const Common::Array<LBValue> ¶ms); void itemSetParent(const Common::Array<LBValue> ¶ms); + void itemMoveTo(const Common::Array<LBValue> ¶ms); void itemIsPlaying(const Common::Array<LBValue> ¶ms); }; -- cgit v1.2.3 From 3537456eb51ed65b67c888ef01a0638719410fdb Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 10:47:42 +0200 Subject: MOHAWK: Implement Mechanical opcodes 109, 110, 111, 112, 113 and 114. Fortress rotation controls. QuickTime Custom framerate and backwards playback is required for the actual rotation to be implemented (opcode 205). --- engines/mohawk/myst_stacks/mechanical.cpp | 125 ++++++++++++++++++++++++------ engines/mohawk/myst_stacks/mechanical.h | 16 +++- 2 files changed, 114 insertions(+), 27 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index b8a6b3110e..dbb1aeae69 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -59,6 +59,12 @@ void Mechanical::setupOpcodes() { OPCODE(106, o_elevatorRotationStart); OPCODE(107, o_elevatorRotationMove); OPCODE(108, o_elevatorRotationStop); + OPCODE(109, o_fortressRotationSpeedStart); + OPCODE(110, o_fortressRotationSpeedMove); + OPCODE(111, o_fortressRotationSpeedStop); + OPCODE(112, o_fortressRotationBrakeStart); + OPCODE(113, o_fortressRotationBrakeMove); + OPCODE(114, o_fortressRotationBrakeStop); OPCODE(121, o_elevatorWindowMovie); OPCODE(122, o_elevatorGoMiddle); OPCODE(123, o_elevatorTopMovie); @@ -78,7 +84,7 @@ void Mechanical::setupOpcodes() { OPCODE(202, o_bird_init); OPCODE(203, o_snakeBox_init); OPCODE(204, o_elevatorRotation_init); - OPCODE(205, opcode_205); + OPCODE(205, o_fortressRotation_init); OPCODE(206, opcode_206); OPCODE(209, opcode_209); @@ -89,11 +95,11 @@ void Mechanical::setupOpcodes() { #undef OPCODE void Mechanical::disablePersistentScripts() { - opcode_205_disable(); opcode_206_disable(); opcode_209_disable(); _elevatorGoingMiddle = false; _birdSinging = false; + _fortressRotationRunning = false; } void Mechanical::runPersistentScripts() { @@ -106,7 +112,9 @@ void Mechanical::runPersistentScripts() { if (_elevatorGoingMiddle) elevatorGoMiddle_run(); - opcode_205_run(); + if (_fortressRotationRunning) + fortressRotation_run(); + opcode_206_run(); opcode_209_run(); } @@ -379,6 +387,85 @@ void Mechanical::o_elevatorRotationStop(uint16 op, uint16 var, uint16 argc, uint _vm->checkCursorHints(); } +void Mechanical::o_fortressRotationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressRotationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP<int16>(step, 0, maxStep); + + _fortressRotationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation speed lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Release lever + for (int i = _fortressRotationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressRotationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressRotationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressRotationBrake); +} + +void Mechanical::o_fortressRotationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.top + 65 - mouse.y) * lever->getNumFrames()) / 65; + step = CLIP<int16>(step, 0, maxStep); + + _fortressRotationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation brake lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressRotationBrake); + + _vm->checkCursorHints(); +} + void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 startTime = argv[0]; uint16 endTime = argv[1]; @@ -596,36 +683,24 @@ void Mechanical::o_elevatorRotation_init(uint16 op, uint16 var, uint16 argc, uin _elevatorRotationLeverMoving = false; } -static struct { - uint16 soundIdPosition[4]; - - bool enabled; -} g_opcode205Parameters; - -void Mechanical::opcode_205_run() { +void Mechanical::fortressRotation_run() { // Used for Card 6156 (Fortress Rotation Controls) // TODO: Fill in function... - // g_opcode205Parameters.soundIdPosition[4] } -void Mechanical::opcode_205_disable() { - g_opcode205Parameters.enabled = false; -} +void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation init", op); -void Mechanical::opcode_205(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); + _fortressRotationGears = static_cast<MystResourceType6 *>(_invokingResource); - // Used for Card 6156 (Fortress Rotation Controls) + _fortressRotationSounds[0] = argv[0]; + _fortressRotationSounds[1] = argv[1]; + _fortressRotationSounds[2] = argv[2]; + _fortressRotationSounds[3] = argv[3]; - if (argc == 4) { - g_opcode205Parameters.soundIdPosition[0] = argv[0]; - g_opcode205Parameters.soundIdPosition[1] = argv[1]; - g_opcode205Parameters.soundIdPosition[2] = argv[2]; - g_opcode205Parameters.soundIdPosition[3] = argv[3]; + _fortressRotationBrake = 0; - g_opcode205Parameters.enabled = true; - } else - unknown(op, var, argc, argv); + _fortressRotationRunning = true; } static struct { diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 320fbb77cd..9b383fe435 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -52,7 +52,7 @@ private: void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); - void opcode_205_run(); + void fortressRotation_run(); void opcode_205_disable(); void opcode_206_run(); void opcode_206_disable(); @@ -67,6 +67,12 @@ private: DECLARE_OPCODE(o_elevatorRotationStart); DECLARE_OPCODE(o_elevatorRotationMove); DECLARE_OPCODE(o_elevatorRotationStop); + DECLARE_OPCODE(o_fortressRotationSpeedStart); + DECLARE_OPCODE(o_fortressRotationSpeedMove); + DECLARE_OPCODE(o_fortressRotationSpeedStop); + DECLARE_OPCODE(o_fortressRotationBrakeStart); + DECLARE_OPCODE(o_fortressRotationBrakeMove); + DECLARE_OPCODE(o_fortressRotationBrakeStop); DECLARE_OPCODE(o_elevatorWindowMovie); DECLARE_OPCODE(o_elevatorGoMiddle); DECLARE_OPCODE(o_elevatorTopMovie); @@ -85,7 +91,7 @@ private: DECLARE_OPCODE(o_bird_init); DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(o_elevatorRotation_init); - DECLARE_OPCODE(opcode_205); + DECLARE_OPCODE(o_fortressRotation_init); DECLARE_OPCODE(opcode_206); DECLARE_OPCODE(opcode_209); @@ -93,7 +99,13 @@ private: bool _mystStaircaseState; // 76 + bool _fortressRotationRunning; + uint16 _fortressRotationSpeed; // 78 + uint16 _fortressRotationBrake; // 80 uint16 _fortressPosition; // 82 + uint16 _fortressRotationSounds[4]; // 86 to 92 + MystResourceType6 *_fortressRotationGears; // 172 + uint16 _elevatorGoingDown; // 112 -- cgit v1.2.3 From 8db0bb927421622a5496c78351c1230584a17a97 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 11:37:36 +0200 Subject: MOHAWK: Implement Mechanical opcodes 115, 116, 117, 118, 119 and 120. Fortress rotation simulator controls. QuickTime Custom framerate and backwards playback is required for the actual simulation to be implemented (opcode 206).--- engines/mohawk/myst_stacks/mechanical.cpp | 166 +++++++++++++++++++----------- engines/mohawk/myst_stacks/mechanical.h | 23 +++-- 2 files changed, 123 insertions(+), 66 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index dbb1aeae69..d6dd1b5407 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -65,6 +65,12 @@ void Mechanical::setupOpcodes() { OPCODE(112, o_fortressRotationBrakeStart); OPCODE(113, o_fortressRotationBrakeMove); OPCODE(114, o_fortressRotationBrakeStop); + OPCODE(115, o_fortressSimulationSpeedStart); + OPCODE(116, o_fortressSimulationSpeedMove); + OPCODE(117, o_fortressSimulationSpeedStop); + OPCODE(118, o_fortressSimulationBrakeStart); + OPCODE(119, o_fortressSimulationBrakeMove); + OPCODE(120, o_fortressSimulationBrakeStop); OPCODE(121, o_elevatorWindowMovie); OPCODE(122, o_elevatorGoMiddle); OPCODE(123, o_elevatorTopMovie); @@ -85,8 +91,8 @@ void Mechanical::setupOpcodes() { OPCODE(203, o_snakeBox_init); OPCODE(204, o_elevatorRotation_init); OPCODE(205, o_fortressRotation_init); - OPCODE(206, opcode_206); - OPCODE(209, opcode_209); + OPCODE(206, o_fortressSimulation_init); + OPCODE(209, o_fortressSimulationStartup_init); // "Exit" Opcodes OPCODE(300, NOP); @@ -95,8 +101,7 @@ void Mechanical::setupOpcodes() { #undef OPCODE void Mechanical::disablePersistentScripts() { - opcode_206_disable(); - opcode_209_disable(); + _fortressSimulationRunning = false; _elevatorGoingMiddle = false; _birdSinging = false; _fortressRotationRunning = false; @@ -115,8 +120,8 @@ void Mechanical::runPersistentScripts() { if (_fortressRotationRunning) fortressRotation_run(); - opcode_206_run(); - opcode_209_run(); + if (_fortressSimulationRunning) + fortressSimulation_run(); } uint16 Mechanical::getVar(uint16 var) { @@ -466,6 +471,85 @@ void Mechanical::o_fortressRotationBrakeStop(uint16 op, uint16 var, uint16 argc, _vm->checkCursorHints(); } +void Mechanical::o_fortressSimulationSpeedStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(0); +} + +void Mechanical::o_fortressSimulationSpeedMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP<int16>(step, 0, maxStep); + + _fortressSimulationSpeed = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationSpeedStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator speed lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Release lever + for (int i = _fortressSimulationSpeed; i >= 0; i--) { + lever->drawFrame(i); + _vm->_system->delayMillis(10); + } + + _fortressSimulationSpeed = 0; + + _vm->checkCursorHints(); +} + +void Mechanical::o_fortressSimulationBrakeStart(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever start", op); + + _vm->_cursor->setCursor(700); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); +} + +void Mechanical::o_fortressSimulationBrakeMove(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever move", op); + + const Common::Point &mouse = _vm->_system->getEventManager()->getMousePos(); + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + + // Make the handle follow the mouse + int16 maxStep = lever->getNumFrames() - 1; + Common::Rect rect = lever->getRect(); + int16 step = ((rect.bottom - mouse.y) * lever->getNumFrames()) / rect.height(); + step = CLIP<int16>(step, 0, maxStep); + + _fortressSimulationBrake = step; + + // Draw current frame + lever->drawFrame(step); +} + +void Mechanical::o_fortressSimulationBrakeStop(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d Fortress rotation simulator brake lever stop", op); + + MystResourceType12 *lever = static_cast<MystResourceType12 *>(_invokingResource); + lever->drawFrame(_fortressSimulationBrake); + + _vm->checkCursorHints(); +} + void Mechanical::o_elevatorWindowMovie(uint16 op, uint16 var, uint16 argc, uint16 *argv) { uint16 startTime = argv[0]; uint16 endTime = argv[1]; @@ -703,69 +787,33 @@ void Mechanical::o_fortressRotation_init(uint16 op, uint16 var, uint16 argc, uin _fortressRotationRunning = true; } -static struct { - uint16 soundIdStart[2]; - uint16 soundIdPosition[4]; - - bool enabled; -} g_opcode206Parameters; - -void Mechanical::opcode_206_run() { - if (g_opcode206Parameters.enabled) { - // Used for Card 6044 (Fortress Rotation Simulator) - - // g_opcode206Parameters.soundIdStart[2] - // g_opcode206Parameters.soundIdPosition[4] - - // TODO: Fill in function... - } -} - -void Mechanical::opcode_206_disable() { - g_opcode206Parameters.enabled = false; -} - -void Mechanical::opcode_206(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); - +void Mechanical::fortressSimulation_run() { // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 6) { - g_opcode206Parameters.soundIdStart[0] = argv[0]; - g_opcode206Parameters.soundIdStart[1] = argv[1]; - g_opcode206Parameters.soundIdPosition[0] = argv[2]; - g_opcode206Parameters.soundIdPosition[1] = argv[3]; - g_opcode206Parameters.soundIdPosition[2] = argv[4]; - g_opcode206Parameters.soundIdPosition[3] = argv[5]; - - g_opcode206Parameters.enabled = true; - } else - unknown(op, var, argc, argv); + // TODO: Fill in function... } +void Mechanical::o_fortressSimulation_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator init", op); -static struct { - bool enabled; -} g_opcode209Parameters; + _fortressSimulationHolo = static_cast<MystResourceType6 *>(_invokingResource); -void Mechanical::opcode_209_run() { - // Used for Card 6044 (Fortress Rotation Simulator) + _fortressSimulationStartSound1 = argv[0]; + _fortressSimulationStartSound2 = argv[1]; - // TODO: Implement Function For Secret Panel State as - // per Opcode 200 function (Mechanical) -} + _fortressRotationSounds[0] = argv[2]; + _fortressRotationSounds[1] = argv[3]; + _fortressRotationSounds[2] = argv[4]; + _fortressRotationSounds[3] = argv[5]; + + _fortressSimulationBrake = 0; -void Mechanical::opcode_209_disable() { - g_opcode209Parameters.enabled = false; + _fortressSimulationRunning = true; } -void Mechanical::opcode_209(uint16 op, uint16 var, uint16 argc, uint16 *argv) { - varUnusedCheck(op, var); +void Mechanical::o_fortressSimulationStartup_init(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + debugC(kDebugScript, "Opcode %d: Fortress rotation simulator startup init", op); - // Used for Card 6044 (Fortress Rotation Simulator) - if (argc == 0) - g_opcode209Parameters.enabled = true; - else - unknown(op, var, argc, argv); + _fortressSimulationStartup = static_cast<MystResourceType6 *>(_invokingResource); } } // End of namespace MystStacks diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 9b383fe435..112d28eea9 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -53,11 +53,7 @@ private: void elevatorRotation_run(); void elevatorGoMiddle_run(); void fortressRotation_run(); - void opcode_205_disable(); - void opcode_206_run(); - void opcode_206_disable(); - void opcode_209_run(); - void opcode_209_disable(); + void fortressSimulation_run(); DECLARE_OPCODE(o_throneEnablePassage); DECLARE_OPCODE(o_birdCrankStart); @@ -73,6 +69,12 @@ private: DECLARE_OPCODE(o_fortressRotationBrakeStart); DECLARE_OPCODE(o_fortressRotationBrakeMove); DECLARE_OPCODE(o_fortressRotationBrakeStop); + DECLARE_OPCODE(o_fortressSimulationSpeedStart); + DECLARE_OPCODE(o_fortressSimulationSpeedMove); + DECLARE_OPCODE(o_fortressSimulationSpeedStop); + DECLARE_OPCODE(o_fortressSimulationBrakeStart); + DECLARE_OPCODE(o_fortressSimulationBrakeMove); + DECLARE_OPCODE(o_fortressSimulationBrakeStop); DECLARE_OPCODE(o_elevatorWindowMovie); DECLARE_OPCODE(o_elevatorGoMiddle); DECLARE_OPCODE(o_elevatorTopMovie); @@ -92,8 +94,8 @@ private: DECLARE_OPCODE(o_snakeBox_init); DECLARE_OPCODE(o_elevatorRotation_init); DECLARE_OPCODE(o_fortressRotation_init); - DECLARE_OPCODE(opcode_206); - DECLARE_OPCODE(opcode_209); + DECLARE_OPCODE(o_fortressSimulation_init); + DECLARE_OPCODE(o_fortressSimulationStartup_init); MystGameState::Mechanical &_state; @@ -106,6 +108,13 @@ private: uint16 _fortressRotationSounds[4]; // 86 to 92 MystResourceType6 *_fortressRotationGears; // 172 + bool _fortressSimulationRunning; + uint16 _fortressSimulationSpeed; // 96 + uint16 _fortressSimulationBrake; // 98 + uint16 _fortressSimulationStartSound1; // 102 + uint16 _fortressSimulationStartSound2; // 100 + MystResourceType6 *_fortressSimulationHolo; // 160 + MystResourceType6 *_fortressSimulationStartup; // 164 uint16 _elevatorGoingDown; // 112 -- cgit v1.2.3 From 7cc82487d368fb94fc4e9e9ad16a80eb4536beda Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 14:10:05 +0200 Subject: MOHAWK: When running scripts in Myst, add delays when necessary between draws to mimic older hardware. --- engines/mohawk/graphics.cpp | 43 ++++++++++++++++++++++++++++++ engines/mohawk/graphics.h | 7 +++++ engines/mohawk/myst_scripts.cpp | 7 +++++ engines/mohawk/myst_stacks/channelwood.cpp | 4 +-- engines/mohawk/myst_stacks/myst.cpp | 2 -- 5 files changed, 58 insertions(+), 5 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 9e02e70a22..b3653b1fdf 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -293,6 +293,9 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { // Initialize our buffer _backBuffer = new Graphics::Surface(); _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat); + + _nextAllowedDrawTime = _vm->_system->getMillis(); + _enableDrawingTimeSimulation = 0; } MystGraphics::~MystGraphics() { @@ -444,6 +447,8 @@ void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Comm debug(3, "\twidth: %d", width); debug(3, "\theight: %d", height); + simulatePreviousDrawDelay(dest); + _vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, top), surface->pitch, dest.left, dest.top, width, height); } @@ -499,10 +504,18 @@ void MystGraphics::copyImageToBackBuffer(uint16 image, Common::Rect dest) { void MystGraphics::copyBackBufferToScreen(Common::Rect r) { r.clip(_viewport); + + simulatePreviousDrawDelay(r); + _vm->_system->copyRectToScreen((byte *)_backBuffer->getBasePtr(r.left, r.top), _backBuffer->pitch, r.left, r.top, r.width(), r.height()); } void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay) { + + // Do not artificially delay during transitions + int oldEnableDrawingTimeSimulation = _enableDrawingTimeSimulation; + _enableDrawingTimeSimulation = 0; + switch (type) { case 0: { debugC(kDebugScript, "Left to Right"); @@ -604,6 +617,8 @@ void MystGraphics::runTransition(uint16 type, Common::Rect rect, uint16 steps, u _vm->_system->updateScreen(); break; } + + _enableDrawingTimeSimulation = oldEnableDrawingTimeSimulation; } void MystGraphics::drawRect(Common::Rect rect, RectState state) { @@ -629,6 +644,34 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui _backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color); } +void MystGraphics::enableDrawingTimeSimulation(bool enable) { + if (enable) + _enableDrawingTimeSimulation++; + else + _enableDrawingTimeSimulation--; + + if (_enableDrawingTimeSimulation < 0) + _enableDrawingTimeSimulation = 0; +} + +void MystGraphics::simulatePreviousDrawDelay(const Common::Rect &dest) { + uint32 time = 0; + + if (_enableDrawingTimeSimulation) { + time = _vm->_system->getMillis(); + + // Do not draw anything new too quickly after the previous draw call + // so that images stay at least a little while on screen + // This is enabled only for scripted draw calls + if (time < _nextAllowedDrawTime) + _vm->_system->delayMillis(_nextAllowedDrawTime - time); + } + + // Next draw call allowed at DELAY + AERA * COEFF milliseconds from now + time = _vm->_system->getMillis(); + _nextAllowedDrawTime = time + _constantDrawDelay + dest.height() * dest.width() / _proportionalDrawDelay; +} + #endif // ENABLE_MYST #ifdef ENABLE_RIVEN diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index e1f0b50078..d7057f48cf 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -128,10 +128,12 @@ public: void runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay); void drawRect(Common::Rect rect, RectState state); void drawLine(const Common::Point &p1, const Common::Point &p2, uint32 color); + void enableDrawingTimeSimulation(bool enable); protected: MohawkSurface *decodeImage(uint16 id); MohawkEngine *getVM() { return (MohawkEngine *)_vm; } + void simulatePreviousDrawDelay(const Common::Rect &dest); private: MohawkEngine_Myst *_vm; @@ -156,6 +158,11 @@ private: Graphics::Surface *_backBuffer; Graphics::PixelFormat _pixelFormat; Common::Rect _viewport; + + int _enableDrawingTimeSimulation; + uint32 _nextAllowedDrawTime; + static const uint _constantDrawDelay = 10; // ms + static const uint _proportionalDrawDelay = 500; // pixels per ms }; #endif // ENABLE_MYST diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 6148c48c60..a6351449b0 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -154,6 +154,11 @@ void MystScriptParser::setupCommonOpcodes() { void MystScriptParser::runScript(MystScript script, MystResource *invokingResource) { debugC(kDebugScript, "Script Size: %d", script->size()); + + // Scripted drawing takes more time to simulate older hardware + // This way opcodes can't overwrite what the previous ones drew too quickly + _vm->_gfx->enableDrawingTimeSimulation(true); + for (uint16 i = 0; i < script->size(); i++) { MystScriptEntry &entry = script->operator[](i); debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode); @@ -165,6 +170,8 @@ void MystScriptParser::runScript(MystScript script, MystResource *invokingResour runOpcode(entry.opcode, entry.var, entry.argc, entry.argv); } + + _vm->_gfx->enableDrawingTimeSimulation(false); } void MystScriptParser::runOpcode(uint16 op, uint16 var, uint16 argc, uint16 *argv) { diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 2ed651fb9c..0dd69a673a 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -330,7 +330,7 @@ void Channelwood::o_drawImageChangeCardAndVolume(uint16 op, uint16 var, uint16 a _vm->_gfx->copyImageToScreen(imageId, Common::Rect(0, 0, 544, 333)); _vm->_system->updateScreen(); - _vm->_system->delayMillis(10); + _vm->changeToCard(cardId, true); if (argc == 3) { @@ -348,7 +348,6 @@ void Channelwood::o_waterTankValveOpen(uint16 op, uint16 var, uint16 argc, uint1 for (uint16 imageId = 3601; imageId >= 3595; imageId--) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(true, 0x80); @@ -663,7 +662,6 @@ void Channelwood::o_waterTankValveClose(uint16 op, uint16 var, uint16 argc, uint for (uint16 imageId = 3595; imageId <= 3601; imageId++) { _vm->_gfx->copyImageToScreen(imageId, rect); _vm->_system->updateScreen(); - _vm->_system->delayMillis(5); } pipeChangeValve(false, 0x80); diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 43cbdc85e4..f77ae753d9 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -859,7 +859,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4795; i >= 4779; i--) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] &= ~bitmask; } else { @@ -867,7 +866,6 @@ void Myst::o_fireplaceToggleButton(uint16 op, uint16 var, uint16 argc, uint16 *a for (uint i = 4779; i <= 4795; i++) { _vm->_gfx->copyImageToScreen(i, _invokingResource->getRect()); _vm->_system->updateScreen(); - _vm->_system->delayMillis(1); } _fireplaceLines[var - 17] |= bitmask; } -- cgit v1.2.3 From 0127a888fb821a6d9ef761b460cbb541bbfc2650 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 17:31:22 +0200 Subject: MOHAWK: Fix Myst backgrounds being draw one pixel too low on some cards. Happened in Myst's Generator cave.--- engines/mohawk/myst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index f7f1edf4e5..44bfd16e12 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -550,7 +550,7 @@ uint16 MohawkEngine_Myst::getCardBackgroundId() { } void MohawkEngine_Myst::drawCardBackground() { - _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 333)); + _gfx->copyImageToBackBuffer(getCardBackgroundId(), Common::Rect(0, 0, 544, 332)); } void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { -- cgit v1.2.3 From c7f3a4f578b86b54572500322cc55cf0893634c9 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 19:26:33 +0200 Subject: MOHAWK: Implement page drop button for Myst --- engines/mohawk/dialogs.cpp | 10 +++++++++- engines/mohawk/dialogs.h | 1 + engines/mohawk/myst.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ engines/mohawk/myst.h | 3 +++ 4 files changed, 54 insertions(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index eee5b152ee..22a9d2d6c6 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -79,7 +79,8 @@ void PauseDialog::handleKeyDown(Common::KeyState state) { enum { kZipCmd = 'ZIPM', kTransCmd = 'TRAN', - kWaterCmd = 'WATR' + kWaterCmd = 'WATR', + kDropCmd = 'DROP' }; #ifdef ENABLE_MYST @@ -87,6 +88,7 @@ enum { MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) { _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); + _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); @@ -98,6 +100,8 @@ MystOptionsDialog::~MystOptionsDialog() { void MystOptionsDialog::open() { Dialog::open(); + _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + _zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode); _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } @@ -110,6 +114,10 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui case kTransCmd: _vm->_gameState->_globals.transitions = _transitionsCheckbox->getState(); break; + case kDropCmd: + _vm->_needsPageDrop = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 5cadf95574..8aa9d0fbee 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -81,6 +81,7 @@ private: MohawkEngine_Myst *_vm; GUI::CheckboxWidget *_zipModeCheckbox; GUI::CheckboxWidget *_transitionsCheckbox; + GUI::ButtonWidget *_dropPageButton; }; #endif diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 44bfd16e12..4ee078cfc1 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -340,7 +340,13 @@ Common::Error MohawkEngine_Myst::run() { drawResourceRects(); break; case Common::KEYCODE_F5: + _needsPageDrop = false; runDialog(*_optionsDialog); + + if (_needsPageDrop) { + dropPage(); + _needsPageDrop = false; + } break; default: break; @@ -1178,4 +1184,39 @@ bool MohawkEngine_Myst::canSaveGameStateCurrently() { return false; } +void MohawkEngine_Myst::dropPage() { + uint16 page = _gameState->_globals.heldPage; + bool whitePage = page == 13; + bool bluePage = page - 1 < 6; + bool redPage = page - 7 < 6; + + // Drop page + _gameState->_globals.heldPage = 0; + + // Redraw page area + if (whitePage && _gameState->_globals.currentAge == 2) { + redrawArea(41); + } else if (bluePage) { + if (page == 6) { + if (_gameState->_globals.currentAge == 2) + redrawArea(24); + } else { + redrawArea(103); + } + } else if (redPage) { + if (page == 12) { + if (_gameState->_globals.currentAge == 2) + redrawArea(25); + } else if (page == 10) { + if (_gameState->_globals.currentAge == 1) + redrawArea(35); + } else { + redrawArea(102); + } + } + + setMainCursor(kDefaultMystCursor); + checkCursorHints(); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index aeb0d4c83e..e12388373e 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -165,6 +165,7 @@ public: bool _tweaksEnabled; bool _needsUpdate; + bool _needsPageDrop; MystView _view; MystGraphics *_gfx; @@ -207,6 +208,8 @@ private: bool _runExitScript; + void dropPage(); + void loadCard(); void unloadCard(); void runInitScript(); -- cgit v1.2.3 From efac5c42d7d6ec91440e7c03e8205ce474e5437d Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 14 May 2011 19:53:41 +0200 Subject: MOHAWK: Fix background music restarting when changing cards in original Myst --- engines/mohawk/sound.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 2428f1bdb0..6144c89e21 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -616,9 +616,16 @@ Audio::SoundHandle *Sound::replaceBackgroundMyst(uint16 id, uint16 volume) { Common::String name = _vm->getResourceName(ID_MSND, convertMystID(id)); + // Only the first eight characters need to be the same to have a match + Common::String prefix; + if (name.size() >= 8) + prefix = Common::String(name.c_str(), name.c_str() + 8); + else + prefix = name; + // Check if sound is already playing if (_mystBackgroundSound.type == kUsedHandle && _vm->_mixer->isSoundHandleActive(_mystBackgroundSound.handle) - && name.equals(_vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)))) + && _vm->getResourceName(ID_MSND, convertMystID(_mystBackgroundSound.id)).hasPrefix(prefix)) return &_mystBackgroundSound.handle; // Stop old background sound -- cgit v1.2.3 From d72037fb72b876b9cc0ca80d585a1a4939a68bd9 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 15 May 2011 13:24:32 +0200 Subject: MOHAWK: Play a sound when dropping a page --- engines/mohawk/myst.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 4ee078cfc1..eedaa249ff 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -1190,6 +1190,9 @@ void MohawkEngine_Myst::dropPage() { bool bluePage = page - 1 < 6; bool redPage = page - 7 < 6; + // Play drop page sound + _sound->replaceSoundMyst(800); + // Drop page _gameState->_globals.heldPage = 0; -- cgit v1.2.3 From e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 15 May 2011 14:53:05 +0200 Subject: MOHAWK: Implement "Show Map" feature for Myst ME --- engines/mohawk/dialogs.cpp | 17 ++++++++++++++++- engines/mohawk/dialogs.h | 1 + engines/mohawk/myst.cpp | 7 +++++++ engines/mohawk/myst.h | 1 + engines/mohawk/myst_scripts.cpp | 12 ++++++++++++ engines/mohawk/myst_scripts.h | 5 +++++ engines/mohawk/myst_stacks/channelwood.h | 2 ++ engines/mohawk/myst_stacks/mechanical.h | 2 ++ engines/mohawk/myst_stacks/myst.h | 2 ++ engines/mohawk/myst_stacks/selenitic.h | 2 ++ engines/mohawk/myst_stacks/stoneship.h | 2 ++ 11 files changed, 52 insertions(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 22a9d2d6c6..6cb455917e 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -80,7 +80,8 @@ enum { kZipCmd = 'ZIPM', kTransCmd = 'TRAN', kWaterCmd = 'WATR', - kDropCmd = 'DROP' + kDropCmd = 'DROP', + kMapCmd = 'SMAP' }; #ifdef ENABLE_MYST @@ -90,6 +91,12 @@ MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); + // Myst ME only has maps + if (_vm->getFeatures() & GF_ME) + _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~S~how Map"), 0, kMapCmd); + else + _showMapButton = 0; + new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); } @@ -102,6 +109,10 @@ void MystOptionsDialog::open() { _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + if (_showMapButton) + _showMapButton->setEnabled(_vm->_scriptParser && + _vm->_scriptParser->getMap()); + _zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode); _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } @@ -118,6 +129,10 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui _vm->_needsPageDrop = true; close(); break; + case kMapCmd: + _vm->_needsShowMap = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 8aa9d0fbee..853ff30813 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -82,6 +82,7 @@ private: GUI::CheckboxWidget *_zipModeCheckbox; GUI::CheckboxWidget *_transitionsCheckbox; GUI::ButtonWidget *_dropPageButton; + GUI::ButtonWidget *_showMapButton; }; #endif diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index eedaa249ff..57d52d8394 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -341,12 +341,19 @@ Common::Error MohawkEngine_Myst::run() { break; case Common::KEYCODE_F5: _needsPageDrop = false; + _needsShowMap = false; + runDialog(*_optionsDialog); if (_needsPageDrop) { dropPage(); _needsPageDrop = false; } + + if (_needsShowMap) { + _scriptParser->showMap(); + _needsShowMap = false; + } break; default: break; diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index e12388373e..5edf774ed0 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -166,6 +166,7 @@ public: bool _tweaksEnabled; bool _needsUpdate; bool _needsPageDrop; + bool _needsShowMap; MystView _view; MystGraphics *_gfx; diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index a6351449b0..be5b7e1c76 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -145,6 +145,7 @@ void MystScriptParser::setupCommonOpcodes() { OPCODE(44, o_restoreMainCursor); // Opcode 45 Not Present OPCODE(46, o_soundWaitStop); + OPCODE(51, o_exitMap); // Opcodes 47 to 99 Not Present OPCODE(0xFFFF, NOP); @@ -922,4 +923,15 @@ void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv) _vm->quitGame(); } +void MystScriptParser::showMap() { + if (_vm->getCurCard() != getMap()) { + _savedMapCardId = _vm->getCurCard(); + _vm->changeToCard(getMap(), true); + } +} + +void MystScriptParser::o_exitMap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + _vm->changeToCard(_savedMapCardId, true); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index c32d6a9266..18f5b27a6d 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -76,6 +76,9 @@ public: virtual void toggleVar(uint16 var); virtual bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 0; } + void showMap(); + void animatedUpdate(uint16 argc, uint16 *argv, uint16 delay); DECLARE_OPCODE(unknown); @@ -119,6 +122,7 @@ public: DECLARE_OPCODE(o_saveMainCursor); DECLARE_OPCODE(o_restoreMainCursor); DECLARE_OPCODE(o_soundWaitStop); + DECLARE_OPCODE(o_exitMap); // Used in multiple stacks DECLARE_OPCODE(o_quit); @@ -144,6 +148,7 @@ protected: MystResource *_invokingResource; uint16 _savedCardId; + uint16 _savedMapCardId; uint16 _savedCursorId; int16 _tempVar; // Generic temp var used by the scripts uint32 _startTime; // Generic start time used by the scripts diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 43820aa125..a3ea406003 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9932; } + DECLARE_OPCODE(o_bridgeToggle); DECLARE_OPCODE(o_pipeExtend); DECLARE_OPCODE(o_drawImageChangeCardAndVolume); diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 112d28eea9..3bd7f2d71b 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9931; } + void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index ca546e202b..9510d371d7 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9934; } + void towerRotationMap_run(); void libraryBookcaseTransform_run(); void generatorControlRoom_run(); diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index fd4e937f63..d314c4d810 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -50,6 +50,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9930; } + DECLARE_OPCODE(o_mazeRunnerMove); DECLARE_OPCODE(o_mazeRunnerSoundRepeat); DECLARE_OPCODE(o_soundReceiverSigma); diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index 6def83f2ab..4125412b4d 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9933; } + DECLARE_OPCODE(o_pumpTurnOff); DECLARE_OPCODE(o_brotherDoorOpen); DECLARE_OPCODE(o_cabinBookMovie); -- cgit v1.2.3 From af9dc7a29cd982f73fb425776e6c5c0071df6912 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 15 May 2011 17:22:09 +0200 Subject: MOHAWK: Display a black screen while changing stack. Default to an empty cursor. --- engines/mohawk/cursors.cpp | 7 +++++++ engines/mohawk/myst.cpp | 20 +++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index c01aef9581..f95084de8e 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -127,6 +127,13 @@ void MystCursorManager::hideCursor() { } void MystCursorManager::setCursor(uint16 id) { + // Zero means empty cursor + if (id == 0) { + static const byte emptyCursor = 0; + CursorMan.replaceCursor(&emptyCursor, 1, 1, 0, 0, 0); + return; + } + // Both Myst and Myst ME use the "MystBitmap" format for cursor images. MohawkSurface *mhkSurface = _bmpDecoder->decodeImage(_vm->getResource(ID_WDIB, id)); Graphics::Surface *surface = mhkSurface->getSurface(); diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 57d52d8394..5a39b933e7 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -71,7 +71,8 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription // original, including bugs, missing bits etc. :) _tweaksEnabled = true; - _currentCursor = _mainCursor = kDefaultMystCursor; + _currentCursor = 0; + _mainCursor = kDefaultMystCursor; _showResourceRects = false; _curCard = 0; _needsUpdate = false; @@ -415,6 +416,11 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS _curStack = stack; + // Fill screen with black and empty cursor + _cursor->setCursor(0); + _system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0)); + _system->updateScreen(); + _sound->stopSound(); _sound->stopBackgroundMyst(); if (linkSrcSound) @@ -641,18 +647,18 @@ void MohawkEngine_Myst::changeToCard(uint16 card, bool updateScreen) { // TODO: Handle Script Resources - // Make sure we have the right cursor showing - _dragResource = 0; - _hoverResource = 0; - _curResource = -1; - checkCurrentResource(); - // Make sure the screen is updated if (updateScreen) { _gfx->copyBackBufferToScreen(Common::Rect(544, 333)); _system->updateScreen(); } + // Make sure we have the right cursor showing + _dragResource = 0; + _hoverResource = 0; + _curResource = -1; + checkCurrentResource(); + // Debug: Show resource rects if (_showResourceRects) drawResourceRects(); -- cgit v1.2.3 From 9f05f8805dfda0892b809e268c2c4869ca33d4ff Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 15 May 2011 17:38:47 +0200 Subject: MOHAWK: Fix loading a Myst savegame from the launcher. --- engines/mohawk/myst.cpp | 6 +++--- engines/mohawk/myst_state.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 5a39b933e7..432d1113b3 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -258,6 +258,9 @@ Common::Error MohawkEngine_Myst::run() { _cursor = new MystCursorManager(this); _rnd = new Common::RandomSource(); + // Cursor is visible by default + _cursor->showCursor(); + // Load game from launcher/command line if requested if (ConfMan.hasKey("save_slot") && canLoadGameStateCurrently()) { uint32 gameToLoad = ConfMan.getInt("save_slot"); @@ -286,9 +289,6 @@ Common::Error MohawkEngine_Myst::run() { // Test Load Function... loadHelp(10000); - // Set the cursor - _cursor->setCursor(_currentCursor); - Common::Event event; while (!shouldQuit()) { // Update any background videos diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index fbb8bf0ac2..bab4b8dd51 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -100,6 +100,9 @@ bool MystGameState::load(const Common::String &filename) { syncGameState(s, size == 664); delete loadFile; + // Switch us back to the intro stack, to the linking book + _vm->changeToStack(kIntroStack, 5, 0, 0); + // Set our default cursor if (_globals.heldPage == 0 || _globals.heldPage > 13) _vm->setMainCursor(kDefaultMystCursor); @@ -110,9 +113,6 @@ bool MystGameState::load(const Common::String &filename) { else // if (globals.heldPage == 13) _vm->setMainCursor(kWhitePageCursor); - // Switch us back to the intro stack, to the linking book - _vm->changeToStack(kIntroStack, 5, 0, 0); - return true; } -- cgit v1.2.3 From 3c59e37035742ce843f3e12039b5169e4bdd0168 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sun, 15 May 2011 15:50:09 +0100 Subject: ENGINES: Unify engine names This unifies the engine names in MetaEngine::getName() and the credits. In particular drop "Engine" or "engine" from the names when it was present and use expanded names in credits when the MetaEngine uses it (e.g. "Beneath a Steel Sky" instead of "BASS"). --- engines/mohawk/detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index 3b7efe714d..6a73b28246 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -188,7 +188,7 @@ public: MohawkMetaEngine() : AdvancedMetaEngine(detectionParams) {} virtual const char *getName() const { - return "Mohawk Engine"; + return "Mohawk"; } virtual const char *getOriginalCopyright() const { -- cgit v1.2.3 From 4cbe4ede66e65ec9289811eca2f5f62285174c8d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 16 May 2011 16:35:10 +0200 Subject: COMMON: Registers RandomSources in constructor with the event recorder This also removes the dependency of engines on the event recorder header and API, and will make it easier to RandomSources that are not properly registered. --- engines/mohawk/cstime.cpp | 5 ++--- engines/mohawk/livingbooks.cpp | 5 ++--- engines/mohawk/riven.cpp | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 0bc480ec24..59bc5ad661 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -32,15 +32,14 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/textconsole.h" +#include "common/system.h" namespace Mohawk { MohawkEngine_CSTime::MohawkEngine_CSTime(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) { - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "cstime"); + _rnd = new Common::RandomSource("cstime"); // If the user just copied the CD contents, the fonts are in a subdirectory. const Common::FSNode gameDataDir(ConfMan.get("path")); diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 36d86fb747..a4e7f0349c 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -28,10 +28,10 @@ #include "common/config-manager.h" #include "common/error.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/fs.h" #include "common/archive.h" #include "common/textconsole.h" +#include "common/system.h" #include "graphics/palette.h" @@ -125,8 +125,7 @@ MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGa _alreadyShowedIntro = false; - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "livingbooks"); + _rnd = new Common::RandomSource("livingbooks"); _page = NULL; diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp index 417a5b5f74..f407e650f6 100644 --- a/engines/mohawk/riven.cpp +++ b/engines/mohawk/riven.cpp @@ -22,9 +22,9 @@ #include "common/config-manager.h" #include "common/events.h" -#include "common/EventRecorder.h" #include "common/keyboard.h" #include "common/translation.h" +#include "common/system.h" #include "mohawk/cursors.h" #include "mohawk/graphics.h" @@ -118,8 +118,7 @@ Common::Error MohawkEngine_Riven::run() { _optionsDialog = new RivenOptionsDialog(this); _scriptMan = new RivenScriptManager(this); - _rnd = new Common::RandomSource(); - g_eventRec.registerRandomSource(*_rnd, "riven"); + _rnd = new Common::RandomSource("riven"); // Create the cursor manager if (Common::File::exists("rivendmo.exe")) -- cgit v1.2.3 From 9ac184bfba36ff35191abb39fa0481f528ae7edb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 17 May 2011 12:02:53 +0200 Subject: MOHAWK: Name the RandomSource used for myst --- engines/mohawk/myst.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/mohawk') diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 432d1113b3..4f9c3a893e 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -256,7 +256,7 @@ Common::Error MohawkEngine_Myst::run() { _loadDialog->setSaveMode(false); _optionsDialog = new MystOptionsDialog(this); _cursor = new MystCursorManager(this); - _rnd = new Common::RandomSource(); + _rnd = new Common::RandomSource("myst"); // Cursor is visible by default _cursor->showCursor(); -- cgit v1.2.3