aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-11 00:30:02 -0400
committerMatthew Hoops2011-05-11 00:30:28 -0400
commita1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch)
tree8c51419daa486f1d4833757db4715dadab6c3497 /engines/mohawk
parentaccb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff)
parent33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff)
downloadscummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.gz
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.tar.bz2
scummvm-rg350-a1d41da096c0bcf502a85919cb1cb1ee471719c5.zip
Merge remote branch 'upstream/master' into t7g-ios
Conflicts: audio/decoders/qdm2.h common/util.cpp engines/groovie/music.cpp engines/groovie/resource.h video/qt_decoder.cpp video/qt_decoder.h
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/bitmap.cpp22
-rw-r--r--engines/mohawk/console.cpp3
-rw-r--r--engines/mohawk/cstime.cpp5
-rw-r--r--engines/mohawk/cstime_cases.cpp2
-rw-r--r--engines/mohawk/cstime_game.cpp2
-rw-r--r--engines/mohawk/cstime_ui.cpp2
-rw-r--r--engines/mohawk/cstime_view.cpp2
-rw-r--r--engines/mohawk/cursors.cpp71
-rw-r--r--engines/mohawk/cursors.h14
-rw-r--r--engines/mohawk/detection.cpp5
-rw-r--r--engines/mohawk/detection_tables.h97
-rw-r--r--engines/mohawk/dialogs.cpp4
-rw-r--r--engines/mohawk/graphics.cpp17
-rw-r--r--engines/mohawk/graphics.h2
-rw-r--r--engines/mohawk/installer_archive.cpp2
-rw-r--r--engines/mohawk/installer_archive.h2
-rw-r--r--engines/mohawk/livingbooks.cpp8
-rw-r--r--engines/mohawk/livingbooks_code.cpp3
-rw-r--r--engines/mohawk/mohawk.cpp10
-rw-r--r--engines/mohawk/mohawk.h2
-rw-r--r--engines/mohawk/myst.cpp2
-rw-r--r--engines/mohawk/myst_areas.cpp4
-rw-r--r--engines/mohawk/myst_scripts.cpp2
-rw-r--r--engines/mohawk/myst_stacks/channelwood.cpp4
-rw-r--r--engines/mohawk/myst_stacks/credits.cpp1
-rw-r--r--engines/mohawk/myst_stacks/dni.cpp2
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp3
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp2
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp1
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp7
-rw-r--r--engines/mohawk/myst_stacks/slides.cpp1
-rw-r--r--engines/mohawk/myst_stacks/stoneship.cpp4
-rw-r--r--engines/mohawk/myst_state.cpp2
-rw-r--r--engines/mohawk/myst_state.h2
-rw-r--r--engines/mohawk/resource.cpp1
-rw-r--r--engines/mohawk/riven.h1
-rw-r--r--engines/mohawk/riven_external.cpp1
-rw-r--r--engines/mohawk/riven_scripts.cpp1
-rw-r--r--engines/mohawk/riven_scripts.h1
-rw-r--r--engines/mohawk/sound.cpp3
-rw-r--r--engines/mohawk/video.cpp11
-rw-r--r--engines/mohawk/view.cpp2
42 files changed, 237 insertions, 96 deletions
diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp
index c8111fa91b..02548d58fc 100644
--- a/engines/mohawk/bitmap.cpp
+++ b/engines/mohawk/bitmap.cpp
@@ -31,6 +31,7 @@
#include "common/memstream.h"
#include "common/substream.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
@@ -135,8 +136,12 @@ Common::Array<MohawkSurface *> MohawkBitmap::decodeImages(Common::SeekableReadSt
Graphics::Surface *MohawkBitmap::createSurface(uint16 width, uint16 height) {
Graphics::Surface *surface = new Graphics::Surface();
- byte bytesPerPixel = (getBitsPerPixel() <= 8) ? 1 : g_system->getScreenFormat().bytesPerPixel;
- surface->create(width, height, bytesPerPixel);
+ Graphics::PixelFormat format;
+ if (getBitsPerPixel() <= 8)
+ format = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ format = g_system->getScreenFormat();
+ surface->create(width, height, format);
return surface;
}
@@ -569,7 +574,7 @@ void MohawkBitmap::drawRaw(Graphics::Surface *surface) {
byte b = _data->readByte();
byte g = _data->readByte();
byte r = _data->readByte();
- if (surface->bytesPerPixel == 2)
+ if (surface->format.bytesPerPixel == 2)
*((uint16 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b);
else
*((uint32 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b);
@@ -608,13 +613,12 @@ void MohawkBitmap::drawRLE8(Graphics::Surface *surface, bool isLE) {
if (code & 0x80) {
byte val = _data->readByte();
- for (uint16 j = 0; j < runLen; j++)
- *dst++ = val;
+ memset(dst, val, runLen);
} else {
- for (uint16 j = 0; j < runLen; j++)
- *dst++ = _data->readByte();
+ _data->read(dst, runLen);
}
+ dst += runLen;
remaining -= runLen;
}
@@ -857,7 +861,7 @@ MohawkSurface *DOSBitmap::decodeImage(Common::SeekableReadStream *stream) {
}
void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) {
- assert(surface->bytesPerPixel == 1);
+ assert(surface->format.bytesPerPixel == 1);
byte *dst = (byte *)surface->pixels;
@@ -883,7 +887,7 @@ void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::Seekab
*(dst + j * 4 + dstPixel) = (*(dst + j * 4 + dstPixel) >> 1) | (((temp >> srcBit) & 1) << 3)
void DOSBitmap::expandEGAPlanes(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) {
- assert(surface->bytesPerPixel == 1);
+ assert(surface->format.bytesPerPixel == 1);
// Note that the image is in EGA planar form and not just standard 4bpp
// This seems to contradict the PoP specs which seem to do
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index ee67c9f23c..93cbe87e55 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -29,6 +29,9 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
#ifdef ENABLE_CSTIME
#include "mohawk/cstime.h"
#endif
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index 955e0e5af6..46faae08f5 100644
--- a/engines/mohawk/cstime.cpp
+++ b/engines/mohawk/cstime.cpp
@@ -30,15 +30,14 @@
#include "mohawk/cstime_view.h"
#include "mohawk/resource.h"
#include "mohawk/cursors.h"
-#include "mohawk/sound.h"
#include "mohawk/video.h"
#include "common/config-manager.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/fs.h"
-
-#include "engines/util.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp
index 408f1c9d9a..c4801f822c 100644
--- a/engines/mohawk/cstime_cases.cpp
+++ b/engines/mohawk/cstime_cases.cpp
@@ -26,6 +26,8 @@
#include "mohawk/cstime_cases.h"
#include "mohawk/cstime_ui.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
CSTimeCase1::CSTimeCase1(MohawkEngine_CSTime *vm) : CSTimeCase(vm, 1) {
diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp
index 14e5d99e51..66dce1da92 100644
--- a/engines/mohawk/cstime_game.cpp
+++ b/engines/mohawk/cstime_game.cpp
@@ -29,6 +29,8 @@
#include "mohawk/resource.h"
#include "mohawk/sound.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp
index 935b0321da..106f7ea319 100644
--- a/engines/mohawk/cstime_ui.cpp
+++ b/engines/mohawk/cstime_ui.cpp
@@ -29,6 +29,8 @@
#include "mohawk/resource.h"
#include "common/algorithm.h" // find
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/fontman.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp
index 115b363b6e..12d641a9ff 100644
--- a/engines/mohawk/cstime_view.cpp
+++ b/engines/mohawk/cstime_view.cpp
@@ -30,6 +30,8 @@
#include "mohawk/cursors.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index b4969f990a..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
@@ -148,7 +139,7 @@ void MystCursorManager::setCursor(uint16 id) {
delete clrcStream;
// Myst ME stores some cursors as 24bpp images instead of 8bpp
- if (surface->bytesPerPixel == 1) {
+ if (surface->format.bytesPerPixel == 1) {
CursorMan.replaceCursor((byte *)surface->pixels, surface->w, surface->h, hotspotX, hotspotY, 0);
CursorMan.replaceCursorPalette(mhkSurface->getPalette(), 0, 256);
} else {
@@ -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 f8a9429689..ba9700c9f9 100644
--- a/engines/mohawk/cursors.h
+++ b/engines/mohawk/cursors.h
@@ -29,11 +29,11 @@
#include "common/scummsys.h"
namespace Common {
- class MacResManager;
- class NEResources;
- class PEResources;
- class SeekableReadStream;
- class String;
+class MacResManager;
+class NEResources;
+class PEResources;
+class SeekableReadStream;
+class String;
}
#include "mohawk/resource.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
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index cad24b55f1..c14d3327d0 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -26,9 +26,9 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
-#include "common/config-manager.h"
-#include "common/file.h"
#include "common/savefile.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "mohawk/livingbooks.h"
@@ -141,6 +141,7 @@ static const PlainGameDescriptor mohawkGames[] = {
{"rugrats", "Rugrats Adventure Game"},
{"lbsampler", "Living Books Sampler"},
{"bearfight", "The Berenstain Bears Get in a Fight"},
+ {"beardark", "The Berenstain Bears In The Dark"},
{"arthurcomp", "Arthur's Computer Adventure"},
{"harryhh","Harry and the Haunted House"},
{"stellaluna", "Stellaluna"},
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index a8f9ee557b..36dbcbde7b 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -793,6 +793,21 @@ static const MohawkGameDescription gameDescriptions[] = {
{
{
+ "seussabc",
+ "Demo",
+ AD_ENTRY1("BookOutline", "17d72660680ae32cd7c560d0cf04d2ef"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_DEMO,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV2,
+ GF_DEMO,
+ 0
+ },
+
+ {
+ {
"1stdegree",
"",
AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"),
@@ -1023,6 +1038,23 @@ static const MohawkGameDescription gameDescriptions[] = {
0
},
+ // Just Grandma and Me 1.0
+ // From scoriae
+ {
+ {
+ "grandma",
+ "v1.0",
+ AD_ENTRY1("PAGES.512", "e694ac10f957dd2e20611350bf968da3"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV1,
+ GF_LB_10,
+ "GRANDMA.EXE"
+ },
+
{
{
"grandma",
@@ -1254,6 +1286,22 @@ static const MohawkGameDescription gameDescriptions[] = {
0
},
+ // From zerep in bug #3287894
+ {
+ {
+ "arthurbday",
+ "",
+ AD_ENTRY1("BIRTHDAY.512", "874f80ff363214d63593864e58c4a130"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV1,
+ 0,
+ "BIRTHDAY.EXE"
+ },
+
{
{
"arthurbday",
@@ -1545,6 +1593,55 @@ static const MohawkGameDescription gameDescriptions[] = {
"Bears Get in a Fight"
},
+ // From bkennimer in bug #3284930
+ {
+ {
+ "beardark",
+ "",
+ AD_ENTRY1("DARK.LB", "81d1e6eaf88d54bd29836a133935c0d4"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV3,
+ 0,
+ 0
+ },
+
+ // From bkennimer in bug #3284930
+ // 32-bit version of the previous entry
+ {
+ {
+ "beardark",
+ "",
+ AD_ENTRY1("DARK32.LB", "28abbf5498aeb29e78e5e0dec969ebe2"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV3,
+ 0,
+ 0
+ },
+
+ // From bkennimer in bug #3284930
+ {
+ {
+ "beardark",
+ "",
+ AD_ENTRY1("BookOutline", "95b2e43778ca9cfaee37bdde843e7681"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV3,
+ 0,
+ 0
+ },
+
{
{
"arthurcomp",
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index c5a0c7e86d..4c7e52f02f 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -27,7 +27,9 @@
#include "mohawk/dialogs.h"
#include "gui/gui-manager.h"
-#include "common/savefile.h"
+#include "gui/ThemeEngine.h"
+#include "gui/widget.h"
+#include "common/system.h"
#include "common/translation.h"
#ifdef ENABLE_MYST
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index 81d2b6f019..a1bcb55f7b 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -28,7 +28,10 @@
#include "mohawk/livingbooks.h"
#include "common/substream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/util.h"
+#include "graphics/palette.h"
#include "graphics/primitives.h"
#include "gui/message.h"
@@ -70,14 +73,14 @@ MohawkSurface::~MohawkSurface() {
void MohawkSurface::convertToTrueColor() {
assert(_surface);
- if (_surface->bytesPerPixel > 1)
+ if (_surface->format.bytesPerPixel > 1)
return;
assert(_palette);
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();
Graphics::Surface *surface = new Graphics::Surface();
- surface->create(_surface->w, _surface->h, pixelFormat.bytesPerPixel);
+ surface->create(_surface->w, _surface->h, pixelFormat);
for (uint16 i = 0; i < _surface->h; i++) {
for (uint16 j = 0; j < _surface->w; j++) {
@@ -292,7 +295,7 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
// Initialize our buffer
_backBuffer = new Graphics::Surface();
- _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat.bytesPerPixel);
+ _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat);
}
MystGraphics::~MystGraphics() {
@@ -486,7 +489,7 @@ void MystGraphics::copyImageSectionToBackBuffer(uint16 image, Common::Rect src,
debug(3, "\theight: %d", height);
for (uint16 i = 0; i < height; i++)
- memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->bytesPerPixel);
+ memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->format.bytesPerPixel);
}
void MystGraphics::copyImageToScreen(uint16 image, Common::Rect dest) {
@@ -646,7 +649,7 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm
// The actual game graphics only take up the first 392 rows. The inventory
// occupies the rest of the screen and we don't use the buffer to hold that.
_mainScreen = new Graphics::Surface();
- _mainScreen->create(608, 392, _pixelFormat.bytesPerPixel);
+ _mainScreen->create(608, 392, _pixelFormat);
_updatesEnabled = true;
_scheduledTransition = -1; // no transition
@@ -677,7 +680,7 @@ void RivenGraphics::copyImageToScreen(uint16 image, uint32 left, uint32 top, uin
surface->w = 608 - left;
for (uint16 i = 0; i < surface->h; i++)
- memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->bytesPerPixel);
+ memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->format.bytesPerPixel);
_dirtyScreen = true;
}
@@ -972,7 +975,7 @@ void RivenGraphics::drawImageRect(uint16 id, Common::Rect srcRect, Common::Rect
assert(srcRect.width() == dstRect.width() && srcRect.height() == dstRect.height());
for (uint16 i = 0; i < srcRect.height(); i++)
- memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->bytesPerPixel);
+ memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->format.bytesPerPixel);
_dirtyScreen = true;
}
diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h
index 5cac68c510..c7e9b98d49 100644
--- a/engines/mohawk/graphics.h
+++ b/engines/mohawk/graphics.h
@@ -33,7 +33,7 @@
#include "graphics/pict.h"
namespace Graphics {
- class JPEG;
+class JPEG;
}
namespace Mohawk {
diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp
index 4ea742dff6..5079375896 100644
--- a/engines/mohawk/installer_archive.cpp
+++ b/engines/mohawk/installer_archive.cpp
@@ -27,8 +27,6 @@
#include "common/dcl.h"
#include "common/debug.h"
-#include "common/substream.h"
-#include "common/util.h"
namespace Mohawk {
diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h
index 565b363be3..d33fbe5bcd 100644
--- a/engines/mohawk/installer_archive.h
+++ b/engines/mohawk/installer_archive.h
@@ -27,6 +27,8 @@
#include "common/scummsys.h"
#include "common/endian.h"
#include "common/file.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
#include "common/str.h"
#ifndef MOHAWK_INSTALLER_ARCHIVE_H
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 7f6c3cc43a..2475965812 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -26,13 +26,17 @@
#include "mohawk/livingbooks.h"
#include "mohawk/resource.h"
#include "mohawk/cursors.h"
-#include "mohawk/sound.h"
#include "mohawk/video.h"
+#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 "graphics/palette.h"
#include "engines/util.h"
@@ -2004,7 +2008,7 @@ LBScriptEntry *LBItem::parseScriptEntry(uint16 type, uint16 &size, Common::Seeka
size -= target.size() + 1;
}
- if (size % 2 != oldAlign) {
+ if ((uint)(size % 2) != oldAlign) {
stream->skip(1);
size--;
}
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 84f69af2ac..4237c712d9 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -26,6 +26,9 @@
#include "mohawk/livingbooks.h"
#include "mohawk/resource.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
bool LBValue::operator==(const LBValue &x) const {
diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp
index 015cbffb26..f63645f1ac 100644
--- a/engines/mohawk/mohawk.cpp
+++ b/engines/mohawk/mohawk.cpp
@@ -24,13 +24,9 @@
*/
#include "common/scummsys.h"
-#include "common/config-manager.h"
-#include "common/file.h"
-#include "common/events.h"
-#include "common/keyboard.h"
-
-#include "base/plugins.h"
-#include "base/version.h"
+#include "common/error.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "mohawk/mohawk.h"
#include "mohawk/cursors.h"
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index 1bad8a08ce..8a853d151e 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -34,7 +34,7 @@
class OSystem;
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
/**
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 1aba820fed..655a38b578 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -25,7 +25,9 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/system.h"
#include "common/translation.h"
+#include "common/textconsole.h"
#include "mohawk/cursors.h"
#include "mohawk/graphics.h"
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 21f6627f60..dc00bff923 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -29,6 +29,10 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
MystResource::MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) {
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 17a2c66091..71c408ed37 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -31,6 +31,8 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp
index 26267cfbda..cba2583a50 100644
--- a/engines/mohawk/myst_stacks/channelwood.cpp
+++ b/engines/mohawk/myst_stacks/channelwood.cpp
@@ -32,7 +32,9 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/channelwood.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp
index 61772eda4d..bb8397fd09 100644
--- a/engines/mohawk/myst_stacks/credits.cpp
+++ b/engines/mohawk/myst_stacks/credits.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/credits.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp
index ffbf9c991f..e2a11eb94f 100644
--- a/engines/mohawk/myst_stacks/dni.cpp
+++ b/engines/mohawk/myst_stacks/dni.cpp
@@ -31,6 +31,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/dni.h"
+#include "common/system.h"
+
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index 3dab2f7939..c5c11026f5 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -32,7 +32,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/mechanical.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 5d070322ca..2b8ef94442 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -33,6 +33,8 @@
#include "mohawk/myst_stacks/myst.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index dc491c7573..fddf6290fb 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/preview.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index f485bab2f9..c670cb6a48 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -32,6 +32,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/selenitic.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
namespace Mohawk {
@@ -816,7 +818,7 @@ void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *a
debugC(kDebugScript, "Opcode %d: Sound lock end move", op);
MystResourceType10 *slider = soundLockSliderFromVar(var);
- uint16 *value = 0;
+ uint16 *value = &_state.soundLockSliderPositions[0];
switch (var) {
case 20: // Sound lock sliders
@@ -834,6 +836,9 @@ void Selenitic::o_soundLockEndMove(uint16 op, uint16 var, uint16 argc, uint16 *a
case 24:
value = &_state.soundLockSliderPositions[4];
break;
+ default:
+ error("Incorrect var value for Selenitic opcode 114");
+ break;
}
uint16 stepped = 12 * (*value / 12) + 6;
diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp
index e664081c96..4057edd9c9 100644
--- a/engines/mohawk/myst_stacks/slides.cpp
+++ b/engines/mohawk/myst_stacks/slides.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/slides.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp
index b5b403dad8..07701c273e 100644
--- a/engines/mohawk/myst_stacks/stoneship.cpp
+++ b/engines/mohawk/myst_stacks/stoneship.cpp
@@ -32,7 +32,9 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/stoneship.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp
index 968bb422be..de71dcf382 100644
--- a/engines/mohawk/myst_state.cpp
+++ b/engines/mohawk/myst_state.cpp
@@ -27,7 +27,9 @@
#include "mohawk/myst.h"
#include "mohawk/myst_state.h"
+#include "common/debug.h"
#include "common/serializer.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h
index a543cb1c4f..074c3e5f10 100644
--- a/engines/mohawk/myst_state.h
+++ b/engines/mohawk/myst_state.h
@@ -31,7 +31,7 @@
#include "common/str.h"
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Mohawk {
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp
index de1513b237..62250b75f2 100644
--- a/engines/mohawk/resource.cpp
+++ b/engines/mohawk/resource.cpp
@@ -28,6 +28,7 @@
#include "common/debug.h"
#include "common/substream.h"
#include "common/util.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index 88927884a2..3aba5643db 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -35,6 +35,7 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/random.h"
+#include "common/rect.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index 7c453dec48..dc0d66f19b 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -32,6 +32,7 @@
#include "gui/message.h"
#include "common/events.h"
+#include "common/system.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 35f38c4069..b8f86f993a 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -33,6 +33,7 @@
#include "common/memstream.h"
#include "common/stream.h"
+#include "common/system.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h
index 46cd965f40..2ac805c366 100644
--- a/engines/mohawk/riven_scripts.h
+++ b/engines/mohawk/riven_scripts.h
@@ -28,6 +28,7 @@
#include "common/str-array.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
class MohawkEngine_Riven;
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 9759f14699..fba87808d2 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -25,7 +25,10 @@
#include "mohawk/sound.h"
+#include "common/debug.h"
+#include "common/system.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "audio/musicplugin.h"
#include "audio/audiostream.h"
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index f481b5ceb2..8f57d61cc4 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -27,9 +27,16 @@
#include "mohawk/resource.h"
#include "mohawk/video.h"
+#include "common/debug.h"
#include "common/events.h"
+#include "common/textconsole.h"
+#include "common/system.h"
+
+#include "graphics/surface.h"
+
#include "video/qt_decoder.h"
+
namespace Mohawk {
void VideoEntry::clear() {
@@ -219,7 +226,7 @@ bool VideoManager::updateMovies() {
// Convert from 8bpp to the current screen format if necessary
Graphics::PixelFormat pixelFormat = _vm->_system->getScreenFormat();
- if (frame->bytesPerPixel == 1) {
+ if (frame->format.bytesPerPixel == 1) {
if (pixelFormat.bytesPerPixel == 1) {
if (_videoStreams[i]->hasDirtyPalette())
_videoStreams[i]->setSystemPalette();
@@ -228,7 +235,7 @@ bool VideoManager::updateMovies() {
const byte *palette = _videoStreams[i]->getPalette();
assert(palette);
- convertedFrame->create(frame->w, frame->h, pixelFormat.bytesPerPixel);
+ convertedFrame->create(frame->w, frame->h, pixelFormat);
for (uint16 j = 0; j < frame->h; j++) {
for (uint16 k = 0; k < frame->w; k++) {
diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp
index 837d386b58..e5a44122ea 100644
--- a/engines/mohawk/view.cpp
+++ b/engines/mohawk/view.cpp
@@ -28,6 +28,8 @@
#include "mohawk/graphics.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
+#include "graphics/palette.h"
namespace Mohawk {