diff options
author | Sven Hesse | 2007-07-30 23:22:09 +0000 |
---|---|---|
committer | Sven Hesse | 2007-07-30 23:22:09 +0000 |
commit | f77195a5cc319fead3821aba7fdcb16543b8fb98 (patch) | |
tree | 3a9cbfd13b46478b92e981808b9d881cf2ce144e /engines | |
parent | 6f1baac2cda438dbcb6401382dbf64f1a1e9e8bf (diff) | |
download | scummvm-rg350-f77195a5cc319fead3821aba7fdcb16543b8fb98.tar.gz scummvm-rg350-f77195a5cc319fead3821aba7fdcb16543b8fb98.tar.bz2 scummvm-rg350-f77195a5cc319fead3821aba7fdcb16543b8fb98.zip |
- Removed left-over, commented-out code
- Added support for palette changing within the frame data (haven't seen any IMD that actually does that, though)
svn-id: r28342
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/coktelvideo.cpp | 30 | ||||
-rw-r--r-- | engines/gob/coktelvideo.h | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp index 8f17810430..e7eebe602a 100644 --- a/engines/gob/coktelvideo.cpp +++ b/engines/gob/coktelvideo.cpp @@ -450,9 +450,6 @@ CoktelVideo::State Imd::processFrame(int16 frame) { state.right += state.left - 1; state.bottom += state.top - 1; -/* if ((frame == 0) && (_features & 0x8)) - _vm->_video->setPalette(_palette);*/ - do { if (frame != 0) { if (_stdX != -1) { @@ -505,9 +502,6 @@ CoktelVideo::State Imd::processFrame(int16 frame) { if (_soundStage != 0) { byte *soundBuf; -/* if (!hasNextCmd) - waitEndSoundSlice();*/ - // Next sound slice data if (cmd == 0xFF00) { @@ -606,8 +600,7 @@ CoktelVideo::State Imd::processFrame(int16 frame) { _height = bottom - top; _width = right - left; - renderFrame(); - + state.flags |= renderFrame(); state.flags |= _frameData[0]; // Frame video data @@ -615,8 +608,7 @@ CoktelVideo::State Imd::processFrame(int16 frame) { _stream->read(_frameData, cmd + 2); - renderFrame(); - + state.flags |= renderFrame(); state.flags |= _frameData[0]; } else @@ -737,9 +729,9 @@ CoktelVideo::State Imd::peekFrame(int16 frame) { return state; } -void Imd::renderFrame() { +uint32 Imd::renderFrame() { if (!_frameData || (_width <= 0) || (_height <= 0)) - return; + return 0; if (!_vidMem) setVideoMemory(); @@ -753,11 +745,17 @@ void Imd::renderFrame() { byte *imdVidMem = _vidMem + sW * imdY + imdX; uint8 type = *dataPtr++; byte *srcPtr = dataPtr; - + uint32 retVal = 0; if (type & 0x10) { // Palette data + // One byte index + int index = *dataPtr++; + // 16 entries with each 3 bytes (RGB) + memcpy(_palette + index * 3, dataPtr, MIN((255 - index) * 3, 48)); + + retVal = kStatePalette; + dataPtr += 48; type ^= 0x10; - dataPtr += 49; } srcPtr = dataPtr; @@ -766,7 +764,7 @@ void Imd::renderFrame() { type &= 0x7F; if ((type == 2) && (imdW == sW)) { frameUncompressor(imdVidMem, dataPtr); - return; + return retVal; } else frameUncompressor(srcPtr, dataPtr); } @@ -843,6 +841,8 @@ void Imd::renderFrame() { imdVidMem = imdVidMemBak; } } + + return retVal; } void Imd::frameUncompressor(byte *dest, byte *src) { diff --git a/engines/gob/coktelvideo.h b/engines/gob/coktelvideo.h index 4e7512eb8b..5788d024af 100644 --- a/engines/gob/coktelvideo.h +++ b/engines/gob/coktelvideo.h @@ -239,7 +239,7 @@ protected: void clear(bool del = true); State processFrame(int16 frame); - void renderFrame(); + uint32 renderFrame(); void frameUncompressor(byte *dest, byte *src); }; |