diff options
author | Nicola Mettifogo | 2007-03-28 20:12:00 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-28 20:12:00 +0000 |
commit | 3903309af338a1cedab353367a459ecd5f0250d8 (patch) | |
tree | 63aed0b2310a045267ee7e5845e90b360f413517 /engines/parallaction | |
parent | ac1e6c9b75beff06f41302fb76cdaffce1125201 (diff) | |
download | scummvm-rg350-3903309af338a1cedab353367a459ecd5f0250d8.tar.gz scummvm-rg350-3903309af338a1cedab353367a459ecd5f0250d8.tar.bz2 scummvm-rg350-3903309af338a1cedab353367a459ecd5f0250d8.zip |
Overhaul of palette management to bring it back to its original form. Gfx palette code has been updated, and _c_endComment (callable from scripts) has been implemented. As a by-product, palette cycling now finally works!
svn-id: r26314
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/callables.cpp | 120 | ||||
-rw-r--r-- | engines/parallaction/disk.cpp | 25 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 168 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 32 | ||||
-rw-r--r-- | engines/parallaction/location.cpp | 26 | ||||
-rw-r--r-- | engines/parallaction/menu.cpp | 16 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 5 |
7 files changed, 222 insertions, 170 deletions
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp index f7ab236453..760c633204 100644 --- a/engines/parallaction/callables.cpp +++ b/engines/parallaction/callables.cpp @@ -63,15 +63,14 @@ void _c_score(void *parm) { } void _c_fade(void *parm) { - byte palette[PALETTE_SIZE]; - _vm->_gfx->getBlackPalette(palette); - _vm->_gfx->setPalette(palette); + _vm->_gfx->setBlackPalette(); _vm->_gfx->swapBuffers(); + Gfx::Palette pal; for (uint16 _di = 0; _di < 64; _di++) { - _vm->_gfx->fadePalette(palette); - _vm->_gfx->setPalette(palette); + _vm->_gfx->fadePalette(pal); + _vm->_gfx->setPalette(pal); } _vm->waitTime( 1 ); @@ -202,26 +201,113 @@ void _c_setMask(void *parm) { return; } -void _c_endComment(void *parm) { +void _c_endComment(void *param) { -} + byte* _enginePal = _vm->_gfx->_palette; + Gfx::Palette pal; -void _c_frankenstein(void *parm) { - byte pal0[PALETTE_SIZE], pal1[PALETTE_SIZE]; + uint32 si; + for (si = 0; si < 32; si++) { + + byte al = _enginePal[si*3+1]; + if (al > _enginePal[si*3+2]) { + al = _enginePal[si*3+1]; + } else { + al = _enginePal[si*3+2]; + } + + if (al < _enginePal[si*3]) { + al = _enginePal[si*3]; + } else { + al = _enginePal[si*3+1]; + } + + if (al > _enginePal[si*3+2]) { + al = _enginePal[si*3+1]; + } else { + al = _enginePal[si*3+2]; + } + + pal[si*3] = al; + pal[si*3+2] = al; + pal[si*3+1] = al; + + } + + int16 w = 0, h = 0; + _vm->_gfx->getStringExtent(_vm->_location._endComment, 130, &w, &h); + + Common::Rect r(w+5, h+5); + r.moveTo(5, 5); + _vm->_gfx->floodFill(Gfx::kBitFront, r, 0); + + r.setWidth(w+3); + r.setHeight(w+4); + r.moveTo(7, 7); + _vm->_gfx->floodFill(Gfx::kBitFront, r, 1); - for (uint16 i = 0; i <= PALETTE_COLORS; i++) { - pal0[i] = _vm->_gfx->_palette[i]; - pal0[i*3+1] = 0; - pal0[i*3+2] = 0; + _vm->_gfx->setFont("comic"); + _vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 130, 0); + + uint32 di = 0; + for (di = 0; di < PALETTE_COLORS; di++) { + for (si = 0; si <= 93; si +=3) { + + char al; + + if (_enginePal[si] != pal[si]) { + al = _enginePal[si]; + if (al > pal[si]) + al = 1; + else + al = -1; + _enginePal[si] += al; + } + + if (_enginePal[si+1] != pal[si+1]) { + al = _enginePal[si+1]; + if (al > pal[si+1]) + al = 1; + else + al = -1; + _enginePal[si+1] += al; + } + + if (_enginePal[si+2] != pal[si+2]) { + al = _enginePal[si+2]; + if (al > pal[si+2]) + al = 1; + else + al = -1; + _enginePal[si+2] += al; + } + + } + + _vm->_gfx->setPalette(_enginePal); } - _vm->_gfx->getBlackPalette(pal1); + waitUntilLeftClick(); + + return; +} + +void _c_frankenstein(void *parm) { + Gfx::Palette pal0; + + for (uint16 i = 0; i <= BASE_PALETTE_COLORS; i++) { + pal0[(i+FIRST_BASE_COLOR)] = _vm->_gfx->_palette[i]; + pal0[(i+FIRST_BASE_COLOR)*3+1] = 0; + pal0[(i+FIRST_BASE_COLOR)*3+2] = 0; + pal0[(i+FIRST_EHB_COLOR)*3+1] = 0; + pal0[(i+FIRST_EHB_COLOR)*3+2] = 0; + } for (uint16 _di = 0; _di < 30; _di++) { g_system->delayMillis(20); - _vm->_gfx->setPalette(pal0); + _vm->_gfx->setPalette(pal0, FIRST_BASE_COLOR, BASE_PALETTE_COLORS); g_system->delayMillis(20); - _vm->_gfx->setPalette(pal1); + _vm->_gfx->setPalette(pal0, FIRST_EHB_COLOR, EHB_PALETTE_COLORS); } _vm->_gfx->setPalette(_vm->_gfx->_palette); @@ -272,7 +358,7 @@ void _c_finito(void *parm) { cleanInventory(); refreshInventory(_vm->_characterName); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); if (gameCompleted) { _vm->_gfx->setFont("slide"); diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index f8ec678ed6..01e2132a5d 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -428,9 +428,8 @@ void DosDisk::parseDepths(Common::SeekableReadStream &stream) { void DosDisk::parseBackground(Common::SeekableReadStream &stream) { - byte pal[96]; - stream.read(pal, PALETTE_SIZE); - _vm->_gfx->setPalette(pal); + stream.read(_vm->_gfx->_palette, BASE_PALETTE_SIZE); + _vm->_gfx->setPalette(_vm->_gfx->_palette); parseDepths(stream); @@ -442,14 +441,6 @@ void DosDisk::parseBackground(Common::SeekableReadStream &stream) { _vm->_gfx->_palettefx[_si]._last = stream.readByte(); } -#if 0 - uint16 v147; - for (v147 = 0; v147 < PALETTE_SIZE; v147++) { - byte _al = _vm->_gfx->_palette[v147]; - _vm->_gfx->_palette[PALETTE_SIZE+v147] = _al / 2; - } -#endif - } void DosDisk::loadBackground(const char *filename) { @@ -744,7 +735,7 @@ Cnv* AmigaDisk::loadTalk(const char *name) { } Cnv* AmigaDisk::loadObjects(const char *name) { - debugC(1, kDebugDisk, "AmigaDisk::loadObjects '%s'", name); + debugC(1, kDebugDisk, "AmigaDisk::loadObjects"); return NULL; } @@ -791,13 +782,13 @@ void AmigaDisk::loadSlide(const char *name) { Graphics::ILBMDecoder decoder(stream); decoder.decode(surf, pal); - for (uint32 i = 0; i < 96; i++) - pal[i] >>= 2; + for (uint32 i = 0; i < PALETTE_SIZE; i++) + _vm->_gfx->_palette[i] = pal[i] >> 2; - - _vm->_gfx->setPalette(pal); free(pal); + _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->_gfx->setBackground(static_cast<byte*>(surf.pixels)); surf.free(); @@ -811,7 +802,7 @@ void AmigaDisk::loadScenery(const char* background, const char* mask) { } Table* AmigaDisk::loadTable(const char* name) { - printf("AmigaDisk::loadTable\n"); +// printf("AmigaDisk::loadTable\n"); char path[PATH_LEN]; sprintf(path, "%s.table", name); diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 153890b475..c4203cb0b9 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -33,8 +33,6 @@ extern OSystem *g_system; namespace Parallaction { - - // // proportional font glyphs width // @@ -52,18 +50,6 @@ const byte _glyphWidths[126] = { bool Gfx::_proportionalFont = false; byte * Gfx::_buffers[]; -#define PALETTE_BACKUP PALETTE_SIZE - -byte _black_palette[PALETTE_SIZE] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - #define BALLOON_WIDTH 12 #define BALLOON_HEIGHT 10 @@ -128,90 +114,31 @@ void Gfx::drawBalloon(const Common::Rect& r, uint16 winding) { } +void Gfx::setPalette(Palette pal, uint32 first, uint32 num) { +// printf("setPalette(%i, %i)\n", first, num); -// -// palette management -// - -void Gfx::setPalette(byte *palette) { -// memcpy(_palette, palette, PALETTE_SIZE); + if (first + num > PALETTE_COLORS) + error("wrong parameters for setPalette()"); byte syspal[PALETTE_COLORS*4]; - for (uint32 i = 0; i < PALETTE_COLORS; i++) { - syspal[i*4] = (palette[i*3] << 2) | (palette[i*3] >> 4); - syspal[i*4+1] = (palette[i*3+1] << 2) | (palette[i*3+1] >> 4); - syspal[i*4+2] = (palette[i*3+2] << 2) | (palette[i*3+2] >> 4); + for (uint32 i = first; i < first+num; i++) { + syspal[i*4] = (pal[i*3] << 2) | (pal[i*3] >> 4); + syspal[i*4+1] = (pal[i*3+1] << 2) | (pal[i*3+1] >> 4); + syspal[i*4+2] = (pal[i*3+2] << 2) | (pal[i*3+2] >> 4); syspal[i*4+3] = 0; } - g_system->setPalette(syspal, 0, PALETTE_COLORS); + g_system->setPalette(syspal, first, num); g_system->updateScreen(); - return; -} - -void Gfx::getBlackPalette(byte *palette) { - memcpy(palette, _black_palette, PALETTE_SIZE); - return; -} - -void Gfx::palUnk0(byte *palette) { -#if 0 - for (uint16 i = 0; i < PALETTE_SIZE; i++) { - palette[PALETTE_BACKUP+i] = _palette[i]/2; - } -#endif -// Gfx::setPalette(palette); - - return; -} - -void Gfx::buildBWPalette(byte *palette) { - - for (uint16 i = 0; i < PALETTE_COLORS; i++) { - byte max; - - if (_palette[i*3+1] > _palette[i*3+2]) { - max = _palette[i*3+1]; - } else { - max = _palette[i*3+2]; - } - - if (_palette[i*3] > max) { - max = _palette[i*3]; - } else { - if (_palette[i*3+1] > _palette[i*3+2]) { - max = _palette[i*3+1]; - } else { - max = _palette[i*3+2]; - } - } - - palette[i*3] = max; - palette[i*3+1] = max; - palette[i*3+2] = max; - } - - return; -} - -void Gfx::fadePalette(byte *palette) { - - for (uint16 i = 0; i < PALETTE_SIZE; i++) - if (palette[i] < _palette[i]) palette[i]++; - return; } -void Gfx::quickFadePalette(byte *palette) { - - for (uint16 i = 0; i < PALETTE_SIZE; i++) { - if (palette[i] == _palette[i]) continue; - palette[i] += (palette[i] < _palette[i] ? 4 : -4); - } - - return; +void Gfx::setBlackPalette() { + Palette pal; + memset(pal, 0, PALETTE_SIZE); + setPalette(pal); } // @@ -219,7 +146,7 @@ void Gfx::quickFadePalette(byte *palette) { // // FIXME: the effect is different from the original // -void Gfx::animatePalette(byte *palette) { +void Gfx::animatePalette() { // printf("Gfx::animatePalette()\n"); byte tmp[3]; @@ -240,11 +167,11 @@ void Gfx::animatePalette(byte *palette) { tmp[1] = _palette[_palettefx[i]._first * 3 + 1]; tmp[2] = _palette[_palettefx[i]._first * 3 + 2]; - memmove(palette+_palettefx[i]._first*3, _palette+(_palettefx[i]._first+1)*3, (_palettefx[i]._last - _palettefx[i]._first)*3); + memmove(_palette+_palettefx[i]._first*3, _palette+(_palettefx[i]._first+1)*3, (_palettefx[i]._last - _palettefx[i]._first)*3); - palette[_palettefx[i]._last * 3] = tmp[0]; - palette[_palettefx[i]._last * 3 + 1] = tmp[1]; - palette[_palettefx[i]._last * 3 + 2] = tmp[2]; + _palette[_palettefx[i]._last * 3] = tmp[0]; + _palette[_palettefx[i]._last * 3 + 1] = tmp[1]; + _palette[_palettefx[i]._last * 3 + 2] = tmp[2]; } else { // backward @@ -252,19 +179,64 @@ void Gfx::animatePalette(byte *palette) { tmp[1] = _palette[_palettefx[i]._last * 3 + 1]; tmp[2] = _palette[_palettefx[i]._last * 3 + 2]; - memmove(palette+(_palettefx[i]._first+1)*3, _palette+_palettefx[i]._first*3, (_palettefx[i]._last - _palettefx[i]._first)*3); + memmove(_palette+(_palettefx[i]._first+1)*3, _palette+_palettefx[i]._first*3, (_palettefx[i]._last - _palettefx[i]._first)*3); - palette[_palettefx[i]._first * 3] = tmp[0]; - palette[_palettefx[i]._first * 3 + 1] = tmp[1]; - palette[_palettefx[i]._first * 3 + 2] = tmp[2]; + _palette[_palettefx[i]._first * 3] = tmp[0]; + _palette[_palettefx[i]._first * 3 + 1] = tmp[1]; + _palette[_palettefx[i]._first * 3 + 2] = tmp[2]; } } + setPalette(_palette); + + return; +} + +void Gfx::fadePalette(Palette pal) { + for (uint16 i = 0; i < PALETTE_SIZE; i++) + if (pal[i] < _palette[i]) pal[i]++; + return; } +void Gfx::buildBWPalette(Palette pal) { + + for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) { + byte max; + + max = MAX(_palette[i*3+1], _palette[i*3+2]); + max = MAX(max, _palette[i*3]); + + pal[i*3] = max; + pal[i*3+1] = max; + pal[i*3+2] = max; + } + + return; +} + +void Gfx::quickFadePalette(Palette pal) { + + for (uint16 i = 0; i < PALETTE_SIZE; i++) { + if (pal[i] == _palette[i]) continue; + pal[i] += (pal[i] < _palette[i] ? 4 : -4); + } + + return; +} + +void Gfx::extendPalette(Palette pal) { + + for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) { + pal[(i+FIRST_EHB_COLOR)*3] = pal[i*3] / 2; + pal[(i+FIRST_EHB_COLOR)*3+1] = pal[i*3+1] / 2; + pal[(i+FIRST_EHB_COLOR)*3+2] = pal[i*3+2] / 2; + } + + setPalette(pal); +} @@ -950,16 +922,12 @@ Gfx::Gfx(Parallaction* vm) : _vm(vm) { g_system->beginGFXTransaction(); - g_system->initSize(SCREEN_WIDTH, SCREEN_HEIGHT); - g_system->endGFXTransaction(); initBuffers(); - byte palette[PALETTE_SIZE]; - getBlackPalette(palette); - setPalette(palette); + setBlackPalette(); initMouse( 0 ); diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 2e26e859f5..84a602e9b8 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -38,8 +38,18 @@ namespace Parallaction { #define SCREENMASK_WIDTH SCREEN_WIDTH/4 #define SCREENPATH_WIDTH SCREEN_WIDTH/8 -#define PALETTE_COLORS 32 -#define PALETTE_SIZE PALETTE_COLORS*3 +#define BASE_PALETTE_COLORS 32 +#define FIRST_BASE_COLOR 0 +#define LAST_BASE_COLOR (FIRST_BASE_COLOR+BASE_PALETTE_COLORS-1) + +#define EHB_PALETTE_COLORS 32 // extra half-brite colors for amiga +#define FIRST_EHB_COLOR (LAST_BASE_COLOR+1) +#define LAST_EHB_COLOR (FIRST_EHB_COLOR+EHB_PALETTE_COLORS-1) + +#define PALETTE_COLORS (BASE_PALETTE_COLORS+EHB_PALETTE_COLORS) + +#define BASE_PALETTE_SIZE BASE_PALETTE_COLORS*3 +#define PALETTE_SIZE PALETTE_COLORS*3 #include "common/pack-start.h" // START STRUCT PACKING @@ -65,6 +75,8 @@ struct GetData; class Gfx { public: + typedef byte Palette[PALETTE_SIZE]; + enum Buffers { // bit buffers kBitFront, @@ -119,13 +131,13 @@ public: void blitCnv(StaticCnv *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer); // palette - void animatePalette(byte *palette); - void setPalette(byte *palette); - void getBlackPalette(byte *palette); - void palUnk0(byte *palette); - void buildBWPalette(byte *palette); - void quickFadePalette(byte *palette); - void fadePalette(byte *palette); + void setPalette(Palette palette, uint32 first = FIRST_BASE_COLOR, uint32 num = PALETTE_COLORS); + void setBlackPalette(); + void animatePalette(); + void fadePalette(Palette palette); + void buildBWPalette(Palette palette); + void quickFadePalette(Palette palette); + void extendPalette(Palette palette); // init Gfx(Parallaction* vm); @@ -141,7 +153,7 @@ public: uint16 _bgLayers[4]; PaletteFxRange _palettefx[6]; - byte _palette[PALETTE_SIZE]; + Palette _palette; protected: Parallaction* _vm; diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 41fe5c467e..42e4ffeb4b 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -255,20 +255,20 @@ void parseWalkNodes(Script& script, Node *list) { void switchBackground(const char* background, const char* mask) { // printf("switchBackground(%s)", name); - byte palette[PALETTE_SIZE]; + Gfx::Palette pal; uint16 v2 = 0; if (!scumm_stricmp(background, "final")) { _vm->_gfx->clearScreen(Gfx::kBitBack); for (uint16 _si = 0; _si <= 93; ) { - palette[_si] = v2; - palette[_si+1] = v2; - palette[_si+2] = v2; + pal[_si] = v2; + pal[_si+1] = v2; + pal[_si+2] = v2; v2 += 4; _si += 3; } - _vm->_gfx->palUnk0(palette); + _vm->_gfx->extendPalette(pal); } _vm->_disk->loadScenery(background, mask); @@ -283,7 +283,7 @@ extern Job *_jEraseLabel; void Parallaction::showSlide(const char *name) { _disk->loadSlide(name); - _gfx->palUnk0(_vm->_gfx->_palette); + _gfx->extendPalette(_vm->_gfx->_palette); _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); debugC(1, kDebugLocation, "changeLocation: new background set"); @@ -401,7 +401,7 @@ void Parallaction::changeLocation(char *location) { byte palette[PALETTE_SIZE]; for (uint16 _si = 0; _si < PALETTE_SIZE; _si++) palette[_si] = 0; - _gfx->palUnk0(palette); + _gfx->extendPalette(palette); _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); if (_location._commands) { runCommands(_location._commands); @@ -419,7 +419,7 @@ void Parallaction::changeLocation(char *location) { runJobs(); _gfx->swapBuffers(); - _gfx->palUnk0(_vm->_gfx->_palette); + _gfx->extendPalette(_vm->_gfx->_palette); if (_location._aCommands) { runCommands(_location._aCommands); debugC(1, kDebugLocation, "changeLocation: location acommands run"); @@ -443,11 +443,11 @@ void Parallaction::changeLocation(char *location) { void Parallaction::doLocationEnterTransition() { debugC(1, kDebugLocation, "doLocationEnterTransition"); - byte v60[PALETTE_SIZE]; if (_localFlags[_currentLocationIndex] & kFlagsVisited) return; // visited - _vm->_gfx->buildBWPalette(v60); - _vm->_gfx->setPalette(v60); + byte pal[PALETTE_SIZE]; + _vm->_gfx->buildBWPalette(pal); + _vm->_gfx->setPalette(pal, FIRST_BASE_COLOR, BASE_PALETTE_COLORS); jobRunScripts(NULL, NULL); jobEraseAnimations(NULL, NULL); @@ -481,8 +481,8 @@ void Parallaction::doLocationEnterTransition() { // fades maximum intensity palette towards approximation of main palette for (uint16 _si = 0; _si<6; _si++) { waitTime( 1 ); - _vm->_gfx->quickFadePalette(v60); - _vm->_gfx->setPalette(v60); + _vm->_gfx->quickFadePalette(pal); + _vm->_gfx->setPalette(pal); } debugC(1, kDebugLocation, "doLocationEnterTransition completed"); diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index 031ec81695..84ab59328d 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -106,13 +106,13 @@ void Menu::start() { _vm->_gfx->setFont("slide"); _vm->_disk->loadSlide("intro"); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); g_system->delayMillis(2000); _vm->_disk->loadSlide("minintro"); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); g_system->delayMillis(2000); @@ -120,7 +120,7 @@ void Menu::start() { if (_vm->getPlatform() == Common::kPlatformPC) { _vm->_disk->loadSlide("lingua"); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE"); @@ -144,7 +144,7 @@ void Menu::newGame() { const char **v14 = introMsg3; _vm->_disk->loadScenery("test", NULL); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); _vm->_gfx->swapBuffers(); uint16 _ax = (SCREEN_WIDTH - _vm->_gfx->getStringWidth(v14[0])) / 2; @@ -217,7 +217,7 @@ uint16 Menu::selectGame() { _vm->_disk->loadSlide("restore"); - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); @@ -297,7 +297,7 @@ void Menu::selectCharacter() { _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); // _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); // - _vm->_gfx->palUnk0(_vm->_gfx->_palette); + _vm->_gfx->extendPalette(_vm->_gfx->_palette); while (askPassword == true) { @@ -371,9 +371,7 @@ void Menu::selectCharacter() { } } - byte palette[PALETTE_SIZE]; - _vm->_gfx->getBlackPalette(palette); - _vm->_gfx->setPalette(palette); + _vm->_gfx->setBlackPalette(); _engineFlags |= kEngineChangeLocation; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 0fb63734cf..24faab7da3 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -402,10 +402,7 @@ void Parallaction::runGame() { if ((_engineFlags & kEnginePauseJobs) == 0 || (_engineFlags & kEngineInventory)) { _gfx->swapBuffers(); - byte palette[PALETTE_SIZE]; - memcpy(palette, _vm->_gfx->_palette, sizeof(palette)); - _gfx->animatePalette(palette); - _gfx->setPalette(palette); + _gfx->animatePalette(); } } |