diff options
author | Matthew Hoops | 2011-05-11 00:30:02 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-11 00:30:28 -0400 |
commit | a1d41da096c0bcf502a85919cb1cb1ee471719c5 (patch) | |
tree | 8c51419daa486f1d4833757db4715dadab6c3497 /engines/groovie | |
parent | accb0c2a5d0c9e7b353cda4b74f511a498ed8073 (diff) | |
parent | 33c3e19cea2a08fbf26ecbe940763e8ee1c37d28 (diff) | |
download | scummvm-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/groovie')
-rw-r--r-- | engines/groovie/cursor.cpp | 3 | ||||
-rw-r--r-- | engines/groovie/cursor.h | 2 | ||||
-rw-r--r-- | engines/groovie/debug.cpp | 2 | ||||
-rw-r--r-- | engines/groovie/font.cpp | 4 | ||||
-rw-r--r-- | engines/groovie/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/groovie/groovie.cpp | 2 | ||||
-rw-r--r-- | engines/groovie/groovie.h | 2 | ||||
-rw-r--r-- | engines/groovie/music.cpp | 3 | ||||
-rw-r--r-- | engines/groovie/player.cpp | 2 | ||||
-rw-r--r-- | engines/groovie/resource.cpp | 47 | ||||
-rw-r--r-- | engines/groovie/resource.h | 9 | ||||
-rw-r--r-- | engines/groovie/roq.cpp | 17 | ||||
-rw-r--r-- | engines/groovie/script.cpp | 22 | ||||
-rw-r--r-- | engines/groovie/script.h | 4 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 91 | ||||
-rw-r--r-- | engines/groovie/vdx.h | 8 |
16 files changed, 155 insertions, 71 deletions
diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index db4134ccb0..8b62b829e1 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -26,8 +26,11 @@ #include "groovie/cursor.h" #include "groovie/groovie.h" +#include "common/debug.h" #include "common/archive.h" +#include "common/file.h" #include "common/macresman.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" namespace Groovie { diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h index 7a1f3ccc0e..e40dc0c486 100644 --- a/engines/groovie/cursor.h +++ b/engines/groovie/cursor.h @@ -30,7 +30,7 @@ #include "common/system.h" namespace Common { - class MacResManager; +class MacResManager; } namespace Groovie { diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index bd4b671e11..0b70e4f83a 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -31,6 +31,8 @@ #include "common/debug-channels.h" #include "common/system.h" +#include "graphics/palette.h" + namespace Groovie { Debugger::Debugger(GroovieEngine *vm) : diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index 92ebcce298..13d0df0005 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -23,6 +23,10 @@ * */ +#include "common/array.h" +#include "common/textconsole.h" +#include "graphics/surface.h" + #include "groovie/font.h" namespace Groovie { diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 3ceeeb6018..71ee231b80 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -25,15 +25,19 @@ #include "groovie/graphics.h" #include "groovie/groovie.h" + +#include "common/rect.h" #include "common/system.h" +#include "graphics/palette.h" + namespace Groovie { GraphicsMan::GraphicsMan(GroovieEngine *vm) : _vm(vm), _changed(false), _fading(0) { // Create the game surfaces - _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel); - _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel); + _foreground.create(640, 320, _vm->_pixelFormat); + _background.create(640, 320, _vm->_pixelFormat); } GraphicsMan::~GraphicsMan() { diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 552aec6128..71b83b9baa 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -35,7 +35,9 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" +#include "common/file.h" #include "common/macresman.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" #include "engines/util.h" diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index bd376db0d2..6f1e5bb52e 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -33,7 +33,7 @@ #include "graphics/pixelformat.h" namespace Common { - class MacResManager; +class MacResManager; } /** diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index b6ef5d277c..20353f4276 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -29,8 +29,11 @@ #include "backends/audiocd/audiocd.h" #include "common/config-manager.h" +#include "common/debug.h" +#include "common/file.h" #include "common/macresman.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "audio/audiostream.h" #include "audio/midiparser.h" #include "audio/decoders/mp3.h" diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 92590d420c..090d99e768 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "groovie/player.h" #include "groovie/groovie.h" diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 2cb571b4cc..5701f3a73d 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -24,8 +24,11 @@ */ #include "common/archive.h" +#include "common/debug.h" +#include "common/file.h" #include "common/macresman.h" #include "common/substream.h" +#include "common/textconsole.h" #include "groovie/resource.h" #include "groovie/groovie.h" @@ -92,7 +95,7 @@ ResMan_t7g::ResMan_t7g(Common::MacResManager *macResFork) : _macResFork(macResFo } } -uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { +uint32 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { // Get the name of the RL file Common::String rlFileName(t7g_gjds[_lastGjd]); rlFileName += ".rl"; @@ -110,7 +113,7 @@ uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { if (!rlFile) error("Groovie::Resource: Couldn't open %s", rlFileName.c_str()); - uint16 resNum; + uint32 resNum; bool found = false; for (resNum = 0; !found && !rlFile->err() && !rlFile->eos(); resNum++) { // Read the resource name @@ -134,7 +137,7 @@ uint16 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { // Verify we really found the resource if (!found) { error("Groovie::Resource: Couldn't find resource %s in %s", name.c_str(), rlFileName.c_str()); - return (uint16)-1; + return (uint32)-1; } return (_lastGjd << 10) | (resNum - 1); @@ -218,8 +221,42 @@ ResMan_v2::ResMan_v2() { indexfile.close(); } -uint16 ResMan_v2::getRef(Common::String name, Common::String scriptname) { - return 0; +uint32 ResMan_v2::getRef(Common::String name, Common::String scriptname) { + // Open the RL file + Common::File rlFile; + if (!rlFile.open("dir.rl")) { + error("Groovie::Resource: Couldn't open dir.rl"); + return false; + } + + uint32 resNum; + bool found = false; + for (resNum = 0; !found && !rlFile.err() && !rlFile.eos(); resNum++) { + // Seek past metadata + rlFile.seek(14, SEEK_CUR); + + // Read the resource name + char readname[18]; + rlFile.read(readname, 18); + + // Test whether it's the resource we're searching + Common::String resname(readname, 18); + if (resname.hasPrefix(name.c_str())) { + debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); + found = true; + } + } + + // Close the RL file + rlFile.close(); + + // Verify we really found the resource + if (!found) { + error("Groovie::Resource: Couldn't find resource %s", name.c_str()); + return (uint32)-1; + } + + return resNum; } bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) { diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index c87658999a..0a9a03b42c 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -27,7 +27,7 @@ #define GROOVIE_RESOURCE_H namespace Common { - class MacResManager; +class MacResManager; } namespace Groovie { @@ -44,7 +44,8 @@ public: virtual ~ResMan() {} Common::SeekableReadStream *open(uint32 fileRef); - virtual uint16 getRef(Common::String name, Common::String scriptname = "") = 0; + + virtual uint32 getRef(Common::String name, Common::String scriptname = "") = 0; virtual bool getResInfo(uint32 fileRef, ResInfo &resInfo) = 0; protected: @@ -58,7 +59,7 @@ public: ResMan_t7g(Common::MacResManager *macResFork = 0); ~ResMan_t7g() {} - uint16 getRef(Common::String name, Common::String scriptname); + uint32 getRef(Common::String name, Common::String scriptname); bool getResInfo(uint32 fileRef, ResInfo &resInfo); private: @@ -70,7 +71,7 @@ public: ResMan_v2(); ~ResMan_v2() {} - uint16 getRef(Common::String name, Common::String scriptname); + uint32 getRef(Common::String name, Common::String scriptname); bool getResInfo(uint32 fileRef, ResInfo &resInfo); }; diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 4d7157c797..be9c4f6921 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -30,7 +30,11 @@ #include "groovie/graphics.h" #include "groovie/groovie.h" +#include "common/debug.h" +#include "common/textconsole.h" + #include "graphics/jpeg.h" +#include "graphics/palette.h" #ifdef USE_RGB_COLOR // Required for the YUV to RGB conversion @@ -175,7 +179,7 @@ void ROQPlayer::buildShowBuf() { // Skip to the next pixel out += _vm->_pixelFormat.bytesPerPixel; if (!(x % _scaleX)) - in += _currBuf->bytesPerPixel; + in += _currBuf->format.bytesPerPixel; } #ifdef DITHER _dither->nextLine(); @@ -328,8 +332,13 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { _prevBuf->free(); // Allocate new buffers - _currBuf->create(width, height, 3); - _prevBuf->create(width, height, 3); + // These buffers use YUV data, since we can not describe it with a + // PixelFormat struct we just add some dummy PixelFormat with the + // correct bytes per pixel value. Since the surfaces are only used + // internally and no code assuming RGB data is present is used on + // them it should be just fine. + _currBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); + _prevBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); // Clear the buffers with black YUV values byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0); @@ -697,7 +706,7 @@ void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) { for (int i = 0; i < size; i++) { // Copy the current line - memcpy(dst, src, size * _currBuf->bytesPerPixel); + memcpy(dst, src, size * _currBuf->format.bytesPerPixel); // Move to the beginning of the next line dst += _currBuf->pitch; diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index e68003f72e..5c9f119d81 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -37,8 +37,11 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/EventRecorder.h" +#include "common/file.h" #include "common/macresman.h" +#include "gui/message.h" + #define NUM_OPCODES 90 namespace Groovie { @@ -65,7 +68,9 @@ static void debugScript(int level, bool nl, const char *s, ...) { Script::Script(GroovieEngine *vm, EngineVersion version) : _code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm), - _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff) { + _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff), + _version(version) { + // Initialize the opcode set depending on the engine version switch (version) { case kGroovieT7G: @@ -320,7 +325,7 @@ uint8 Script::readScriptChar(bool allow7C, bool limitVal, bool limitVar) { return result; } -uint16 Script::getVideoRefString() { +uint32 Script::getVideoRefString() { Common::String str; byte c; @@ -412,6 +417,13 @@ void Script::savegame(uint slot) { char newchar; Common::OutSaveFile *file = SaveLoad::openForSaving(ConfMan.getActiveDomainName(), slot); + if (!file) { + debugC(9, kGroovieDebugScript, "Save file pointer is null"); + GUI::MessageDialog dialog("Failed to save game", "OK"); + dialog.runModal(); + return; + } + // Saving the variables. It is endian safe because they're byte variables file->write(_variables, 0x400); delete file; @@ -722,7 +734,7 @@ void Script::o_hotspot_center() { debugScript(5, true, "HOTSPOT-CENTER @0x%04X", address); - // Mark the centremost 240 pixels of the game area + // Mark the centermost 240 pixels of the game area Common::Rect rect(200, 80, 440, 400); hotspot(rect, address, 0); } @@ -1020,7 +1032,7 @@ void Script::o_add() { void Script::o_videofromstring1() { uint16 instStart = _currentInstruction; - uint16 fileref = getVideoRefString(); + uint32 fileref = getVideoRefString(); // Show the debug information just when starting the playback if (fileref != _videoRef) { @@ -1036,7 +1048,7 @@ void Script::o_videofromstring1() { void Script::o_videofromstring2() { uint16 instStart = _currentInstruction; - uint16 fileref = getVideoRefString(); + uint32 fileref = getVideoRefString(); // Show the debug information just when starting the playback if (fileref != _videoRef) { diff --git a/engines/groovie/script.h b/engines/groovie/script.h index 2360d45744..c5ad6da78b 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -77,6 +77,8 @@ private: bool _firstbit; uint8 _lastCursor; + EngineVersion _version; + // Script filename (for debugging purposes) Common::String _scriptFile; Common::String _savedScriptFile; @@ -138,7 +140,7 @@ private: uint16 readScript8or16bits(); uint8 readScriptChar(bool allow7C, bool limitVal, bool limitVar); uint8 readScriptVar(); - uint16 getVideoRefString(); + uint32 getVideoRefString(); bool hotspot(Common::Rect rect, uint16 addr, uint8 cursor); diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 61e5e3f6d7..b6f06d7011 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -28,9 +28,12 @@ #include "groovie/groovie.h" #include "groovie/lzss.h" +#include "common/debug.h" #include "common/debug-channels.h" +#include "common/textconsole.h" #include "audio/mixer.h" #include "audio/decoders/raw.h" +#include "graphics/palette.h" #define TILE_SIZE 4 // Size of each tile on the image: only ever seen 4 so far #define VDX_IDENT 0x9267 // 37479 @@ -70,7 +73,7 @@ uint16 VDXPlayer::loadInternal() { } // Flags: // - 1 Puzzle piece? Skip palette, don't redraw full screen, draw still to b/ack buffer - // - 2 Transparent colour is 0xFF + // - 2 Transparent color is 0xFF // - 5 Skip still chunks // - 7 // - 8 Just show the first frame @@ -256,26 +259,26 @@ void VDXPlayer::getDelta(Common::ReadStream *in) { uint16 currentLine = 0; uint32 offset = 0; while (!in->eos()) { - byte colours[16]; + byte colors[16]; if (currOpCode < 0x60) { param1 = in->readByte(); param2 = in->readByte(); - expandColourMap(colours, vdxBlockMapLookup[currOpCode], param1, param2); - decodeBlockDelta(offset, colours, 640); + expandColorMap(colors, vdxBlockMapLookup[currOpCode], param1, param2); + decodeBlockDelta(offset, colors, 640); offset += TILE_SIZE; } else if (currOpCode > 0x7f) { param1 = in->readByte(); param2 = in->readByte(); param3 = in->readByte(); - expandColourMap(colours, (param1 << 8) + currOpCode, param2, param3); - decodeBlockDelta(offset, colours, 640); + expandColorMap(colors, (param1 << 8) + currOpCode, param2, param3); + decodeBlockDelta(offset, colors, 640); offset += TILE_SIZE; } else switch (currOpCode) { - case 0x60: /* Fill tile with the 16 colours given as parameters */ + case 0x60: /* Fill tile with the 16 colors given as parameters */ for (l = 0; l < 16; l++) { - colours[l] = in->readByte(); + colors[l] = in->readByte(); } - decodeBlockDelta(offset, colours, 640); + decodeBlockDelta(offset, colors, 640); offset += TILE_SIZE; break; case 0x61: /* Skip to the end of this line, next block is start of next */ @@ -304,14 +307,14 @@ void VDXPlayer::getDelta(Common::ReadStream *in) { case 0x72: case 0x73: case 0x74: - case 0x75: /* Next param1 blocks are filled with colour param2 */ + case 0x75: /* Next param1 blocks are filled with color param2 */ param1 = currOpCode - 0x6b; param2 = in->readByte(); for (l = 0; l < 16; l++) { - colours[l] = param2; + colors[l] = param2; } for (k = 0; k < param1; k++) { - decodeBlockDelta(offset, colours, 640); + decodeBlockDelta(offset, colors, 640); offset += TILE_SIZE; } break; @@ -324,14 +327,14 @@ void VDXPlayer::getDelta(Common::ReadStream *in) { case 0x7c: case 0x7d: case 0x7e: - case 0x7f: /* Next bytes contain colours to fill the next param1 blocks in the current line*/ + case 0x7f: /* Next bytes contain colors to fill the next param1 blocks in the current line*/ param1 = currOpCode - 0x75; for (k = 0; k < param1; k++) { param2 = in->readByte(); for (l = 0; l < 16; l++) { - colours[l] = param2; + colors[l] = param2; } - decodeBlockDelta(offset, colours, 640); + decodeBlockDelta(offset, colors, 640); offset += TILE_SIZE; } break; @@ -349,8 +352,8 @@ void VDXPlayer::getStill(Common::ReadStream *in) { debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numYTiles=%d", numYTiles); // It's skipped in the original: - uint16 colourDepth = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colourDepth=%d", colourDepth); + uint16 colorDepth = in->readUint16LE(); + debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colorDepth=%d", colorDepth); uint16 imageWidth = TILE_SIZE * numXTiles; @@ -383,15 +386,15 @@ void VDXPlayer::getStill(Common::ReadStream *in) { // Skip the frame when flag 5 is set, unless flag 1 is set if (!_flagFive || _flagOne) { - byte colours[16]; + byte colors[16]; for (uint16 j = 0; j < numYTiles; j++) { byte *currentTile = buf + j * TILE_SIZE * imageWidth; for (uint16 i = numXTiles; i; i--) { - uint8 colour1 = in->readByte(); - uint8 colour0 = in->readByte(); - uint16 colourMap = in->readUint16LE(); - expandColourMap(colours, colourMap, colour1, colour0); - decodeBlockStill(currentTile, colours, 640, mask); + uint8 color1 = in->readByte(); + uint8 color0 = in->readByte(); + uint16 colorMap = in->readUint16LE(); + expandColorMap(colors, colorMap, color1, color0); + decodeBlockStill(currentTile, colors, 640, mask); currentTile += TILE_SIZE; } @@ -430,22 +433,22 @@ void VDXPlayer::getStill(Common::ReadStream *in) { } } -void VDXPlayer::expandColourMap(byte *out, uint16 colourMap, uint8 colour1, uint8 colour0) { +void VDXPlayer::expandColorMap(byte *out, uint16 colorMap, uint8 color1, uint8 color0) { // It's a bit faster to start from the end out += 16; for (int i = 16; i; i--) { - // Set the corresponding colour + // Set the corresponding color // The following is an optimized version of: - // *--out = (colourMap & 1) ? colour1 : colour0; - uint8 selector = -(colourMap & 1); - *--out = (selector & colour1) | (~selector & colour0); + // *--out = (colorMap & 1) ? color1 : color0; + uint8 selector = -(colorMap & 1); + *--out = (selector & color1) | (~selector & color0); - // Update the flag map to test the next colour - colourMap >>= 1; + // Update the flag map to test the next color + colorMap >>= 1; } } -void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, uint8 mask) { +void VDXPlayer::decodeBlockStill(byte *buf, byte *colors, uint16 imageWidth, uint8 mask) { assert(TILE_SIZE == 4); for (int y = TILE_SIZE; y; y--) { @@ -453,15 +456,15 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui // TODO: optimize with bit logic? for (int x = 0; x < TILE_SIZE; x++) { // 0xff pixels don't modify the buffer - if (*colours != 0xff) { - // Write the colour - *buf = *colours | mask; + if (*colors != 0xff) { + // Write the color + *buf = *colors | mask; // Note: if the mask is 0, it paints the image // else, it paints the image's mask using 0xff } - // Point to the next colour - colours++; + // Point to the next color + colors++; // Point to the next pixel buf++; @@ -470,8 +473,8 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui // Point to the start of the next line buf += imageWidth - TILE_SIZE; } else { - *((uint32 *)buf) = *((uint32 *)colours); - colours += 4; + *((uint32 *)buf) = *((uint32 *)colors); + colors += 4; // Point to the start of the next line buf += imageWidth; @@ -479,7 +482,7 @@ void VDXPlayer::decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, ui } } -void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth) { +void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth) { assert(TILE_SIZE == 4); byte *dest; @@ -506,19 +509,19 @@ void VDXPlayer::decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth for (int x = 0; x < TILE_SIZE; x++) { // TODO: this can probably be optimized with bit logic if (fgBuf[x] != 0xff) { - if (*colours == 0xff) { + if (*colors == 0xff) { dest[x] = fgBuf[x]; } else { - dest[x] = *colours; + dest[x] = *colors; } } - colours++; + colors++; } fgBuf += imageWidth; } else { // Paint directly - *((uint32 *)dest) = *((uint32 *)colours); - colours += 4; + *((uint32 *)dest) = *((uint32 *)colors); + colors += 4; } // Move to the next line diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index 0b29493108..31c7606cb7 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -29,7 +29,7 @@ #include "groovie/player.h" namespace Common { - class ReadStream; +class ReadStream; } namespace Groovie { @@ -73,9 +73,9 @@ private: void getStill(Common::ReadStream *in); void getDelta(Common::ReadStream *in); - void expandColourMap(byte *out, uint16 colourMap, uint8 colour1, uint8 colour0); - void decodeBlockStill(byte *buf, byte *colours, uint16 imageWidth, uint8 mask); - void decodeBlockDelta(uint32 offset, byte *colours, uint16 imageWidth); + void expandColorMap(byte *out, uint16 colorMap, uint8 color1, uint8 color0); + void decodeBlockStill(byte *buf, byte *colors, uint16 imageWidth, uint8 mask); + void decodeBlockDelta(uint32 offset, byte *colors, uint16 imageWidth); void chunkSound(Common::ReadStream *in); void setPalette(uint8 *palette); void fadeIn(uint8 *palette); |