diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra.h | 1 | ||||
-rw-r--r-- | engines/kyra/plugin.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/resource.cpp | 13 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 19 | ||||
-rw-r--r-- | engines/kyra/screen.h | 3 | ||||
-rw-r--r-- | engines/kyra/seqplayer.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_v1.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sprites.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 2 |
10 files changed, 29 insertions, 21 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index a4c3b4d262..eeeabbab84 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -499,7 +499,7 @@ void KyraEngine::startup() { initMainButtonList(); loadMainScreen(); setupTimers(); - loadPalette("PALETTE.COL", _screen->_currentPalette); + _screen->loadPalette("PALETTE.COL", _screen->_currentPalette); // XXX _animator->initAnimStateList(); diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h index ad42dd3c0a..6722f84f51 100644 --- a/engines/kyra/kyra.h +++ b/engines/kyra/kyra.h @@ -603,7 +603,6 @@ protected: int _opcodeTableSize; void waitForEvent(); - void loadPalette(const char *filename, uint8 *palData); void loadMouseShapes(); void loadCharacterShapes(); void loadSpecialEffectShapes(); diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp index 2505519999..f7a14ceb57 100644 --- a/engines/kyra/plugin.cpp +++ b/engines/kyra/plugin.cpp @@ -59,6 +59,8 @@ const KYRAGameDescription adGameDescs[] = { { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "747861d2a9c643c59fdab570df5b9093"), Common::ES_ESP, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // floppy 1.8 from clemmy { { "kyra1", 0, AD_ENTRY1("GEMCUT.EMC", "ef08c8c237ee1473fd52578303fc36df"), Common::IT_ITA, Common::kPlatformPC, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, // from gourry + //{ { "kyra1", 0, AD_ENTRY1("GEMCUT.PAK", "2bd1da653eaefd691e050e4a9eb68a64"), Common::EN_ANY, Common::kPlatformAmiga, Common::ADGF_NO_FLAGS }, KYRA1_FLOPPY_FLAGS }, + { { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), Common::EN_ANY, Common::kPlatformFMTowns, Common::ADGF_NO_FLAGS }, KYRA1_TOWNS_FLAGS }, { { "kyra1", 0, AD_ENTRY1("TWMUSIC.PAK", "e53bca3a3e3fb49107d59463ec387a59"), Common::JA_JPN, Common::kPlatformFMTowns, Common::ADGF_NO_FLAGS }, KYRA1_TOWNS_SJIS_FLAGS }, diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index d69b1c0dad..b896220d17 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -523,17 +523,4 @@ uint32 INSFile::getFileSize(uint hash) { return 0; } -//////////////////////////////////////////// -void KyraEngine::loadPalette(const char *filename, uint8 *palData) { - debugC(9, kDebugLevelMain, "KyraEngine::loadPalette('%s' %p)", filename, (void *)palData); - uint32 fileSize = 0; - uint8 *srcData = _res->fileData(filename, &fileSize); - - if (palData && fileSize) { - debugC(9, kDebugLevelMain,"Loading a palette of size %i from '%s'", fileSize, filename); - memcpy(palData, srcData, fileSize); - } - delete [] srcData; -} - } // end of namespace Kyra diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 617e52b88e..6ef9ee9c21 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -2450,7 +2450,7 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 * if (palData && palSize) { debugC(9, kDebugLevelMain,"Loading a palette of size %i from %s", palSize, filename); - memcpy(palData, srcData + 10, palSize); + loadPalette(srcData + 10, palData, palSize); } uint8 *srcPtr = srcData + 10 + palSize; @@ -2476,6 +2476,23 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 * delete [] srcData; } +void Screen::loadPalette(const char *filename, uint8 *palData) { + debugC(9, kDebugLevelScreen, "Screen::loadPalette('%s' %p)", filename, (void *)palData); + uint32 fileSize = 0; + uint8 *srcData = _vm->resource()->fileData(filename, &fileSize); + + if (palData && fileSize) { + debugC(9, kDebugLevelScreen,"Loading a palette of size %i from '%s'", fileSize, filename); + memcpy(palData, srcData, fileSize); + } + delete [] srcData; +} + +void Screen::loadPalette(const byte *data, uint8 *palData, int bytes) { + debugC(9, kDebugLevelScreen, "Screen::loadPalette(%p, %p %d)", (void *)data, (void *)palData, bytes); + memcpy(palData, data, bytes); +} + // kyra3 specific const uint8 *Screen::getPtrToShape(const uint8 *shpFile, int shape) { diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 01f19781d5..fbdb517f3c 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -186,6 +186,9 @@ public: // misc void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData); + void loadPalette(const char *filename, uint8 *palData); + void loadPalette(const byte *data, uint8 *palData, int bytes); + void setAnimBlockPtr(int size); void setShapePages(int page1, int page2); diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 5e7e5e5bf6..19a1db615a 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -93,7 +93,7 @@ uint8 *SeqPlayer::setPanPages(int pageNum, int shape) { void SeqPlayer::makeHandShapes() { debugC(9, kDebugLevelSequence, "SeqPlayer::makeHandShapes()"); _screen->loadBitmap("WRITING.CPS", 3, 3, 0); - if (_vm->gameFlags().platform == Common::kPlatformMacintosh) { + if (_vm->gameFlags().platform == Common::kPlatformMacintosh || _vm->gameFlags().platform == Common::kPlatformAmiga) { freeHandShapes(); int pageBackUp = _screen->_curPage; diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp index 752db080c4..30deaf3e68 100644 --- a/engines/kyra/sequences_v1.cpp +++ b/engines/kyra/sequences_v1.cpp @@ -1641,7 +1641,7 @@ int KyraEngine::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) { void KyraEngine::setupPanPages() { debugC(9, kDebugLevelMain, "KyraEngine::setupPanPages()"); _screen->loadBitmap("BEAD.CPS", 3, 3, 0); - if (_flags.platform == Common::kPlatformMacintosh) { + if (_flags.platform == Common::kPlatformMacintosh || _flags.platform == Common::kPlatformAmiga) { int pageBackUp = _screen->_curPage; _screen->_curPage = 2; diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index 5fa86b5a42..ba1e08ede1 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -422,7 +422,7 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) { } // XXX _engine->_paletteChanged = 1; - memcpy(_screen->getPalette(1) + 684, _dat + 0x17, 60); + _screen->loadPalette(_dat + 0x17, _screen->getPalette(1) + 684, 60); uint8 *data = _dat + 0x6B; uint16 length = READ_LE_UINT16(data); @@ -478,7 +478,7 @@ void Sprites::loadDAT(const char *filename, SceneExits &exits) { data += 2; break; default: - warning("Unknown code in DAT file '%s' offset %d: %x", filename, data - _dat, READ_LE_UINT16(data)); + warning("Unknown code in DAT file '%s' offset %d: %x", filename, int(data - _dat), READ_LE_UINT16(data)); data += 2; break; } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 32226d330e..563826ff1c 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -838,7 +838,7 @@ void KyraEngine::loadButtonShapes() { void KyraEngine::loadMainScreen(int page) { _screen->clearPage(page); - if (_flags.lang == Common::EN_ANY && !_flags.isTalkie && _flags.platform == Common::kPlatformPC) + if (_flags.lang == Common::EN_ANY && !_flags.isTalkie && (_flags.platform == Common::kPlatformPC || _flags.platform == Common::kPlatformAmiga)) _screen->loadBitmap("MAIN15.CPS", page, page, 0); else if (_flags.lang == Common::EN_ANY || _flags.lang == Common::JA_JPN) _screen->loadBitmap("MAIN_ENG.CPS", page, page, 0); |