diff options
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/engine/eob.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/engine/kyra_rpg.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/engine/kyra_rpg.h | 8 | ||||
-rw-r--r-- | engines/kyra/engine/scene_eob.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/engine/scene_rpg.cpp | 35 |
5 files changed, 35 insertions, 36 deletions
diff --git a/engines/kyra/engine/eob.cpp b/engines/kyra/engine/eob.cpp index 5ecd43a2a2..d9c401b385 100644 --- a/engines/kyra/engine/eob.cpp +++ b/engines/kyra/engine/eob.cpp @@ -100,6 +100,7 @@ Common::Error EoBEngine::init() { void EoBEngine::startupNew() { _sound->selectAudioResourceSet(kMusicIngame); _sound->loadSoundFile(0); + _screen->selectPC98Palette(0, _screen->getPalette(0)); _currentLevel = 1; _currentSub = 0; loadLevel(1, 0); @@ -113,6 +114,7 @@ void EoBEngine::startupNew() { void EoBEngine::startupLoad() { _sound->selectAudioResourceSet(kMusicIngame); _sound->loadSoundFile(0); + _screen->selectPC98Palette(0, _screen->getPalette(0)); } void EoBEngine::drawNpcScene(int npcIndex) { diff --git a/engines/kyra/engine/kyra_rpg.cpp b/engines/kyra/engine/kyra_rpg.cpp index 35cdfa27a3..9a41c0269c 100644 --- a/engines/kyra/engine/kyra_rpg.cpp +++ b/engines/kyra/engine/kyra_rpg.cpp @@ -199,9 +199,9 @@ Common::Error KyraRpgEngine::init() { if (_vcnBpp == 2) _vcnDrawLine = new VcnLineDrawingMethods(new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_hiCol), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_hiCol), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_trans_hiCol), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_trans_hiCol)); - else if (_flags.platform == Common::kPlatformAmiga) - _vcnDrawLine = new VcnLineDrawingMethods(new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_Amiga), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_Amiga), - new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_trans_Amiga), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_trans_Amiga)); + else if (_flags.platform == Common::kPlatformAmiga || (_flags.gameID == GI_EOB1 && _flags.use16ColorMode)) + _vcnDrawLine = new VcnLineDrawingMethods(new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_planar), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_planar), + new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_trans_planar), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_trans_planar)); else _vcnDrawLine = new VcnLineDrawingMethods(new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_4bit), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_4bit), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_fw_trans_4bit), new VcnDrawProc(this, &KyraRpgEngine::vcnDraw_bw_trans_4bit)); diff --git a/engines/kyra/engine/kyra_rpg.h b/engines/kyra/engine/kyra_rpg.h index 81b5645461..8c88a9dfdd 100644 --- a/engines/kyra/engine/kyra_rpg.h +++ b/engines/kyra/engine/kyra_rpg.h @@ -213,10 +213,10 @@ protected: void vcnDraw_bw_hiCol(uint8 *&dst, const uint8 *&src); void vcnDraw_fw_trans_hiCol(uint8 *&dst, const uint8 *&src); void vcnDraw_bw_trans_hiCol(uint8 *&dst, const uint8 *&src); - void vcnDraw_fw_Amiga(uint8 *&dst, const uint8 *&src); - void vcnDraw_bw_Amiga(uint8 *&dst, const uint8 *&src); - void vcnDraw_fw_trans_Amiga(uint8 *&dst, const uint8 *&src); - void vcnDraw_bw_trans_Amiga(uint8 *&dst, const uint8 *&src); + void vcnDraw_fw_planar(uint8 *&dst, const uint8 *&src); + void vcnDraw_bw_planar(uint8 *&dst, const uint8 *&src); + void vcnDraw_fw_trans_planar(uint8 *&dst, const uint8 *&src); + void vcnDraw_bw_trans_planar(uint8 *&dst, const uint8 *&src); typedef Common::Functor2Mem<uint8 *&, const uint8 *&, void, KyraRpgEngine> VcnDrawProc; struct VcnLineDrawingMethods { diff --git a/engines/kyra/engine/scene_eob.cpp b/engines/kyra/engine/scene_eob.cpp index cbe6055b79..fea8da5806 100644 --- a/engines/kyra/engine/scene_eob.cpp +++ b/engines/kyra/engine/scene_eob.cpp @@ -324,19 +324,19 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) { delete[] _vcnBlocks; uint32 vcnSize = 0; - if (_flags.platform == Common::kPlatformFMTowns) { - _vcnBlocks = _res->fileData(Common::String::format(_vcnFilePattern.c_str(), _lastBlockDataFile).c_str(), &vcnSize); - return; - } - Common::String fn = Common::String::format(_vcnFilePattern.c_str(), _lastBlockDataFile); - if (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformAmiga) { + if (_flags.platform == Common::kPlatformFMTowns) { + _vcnBlocks = _res->fileData(fn.c_str(), &vcnSize); + return; + } else if (_flags.gameID == GI_EOB1 && (_flags.platform == Common::kPlatformAmiga || _flags.platform == Common::kPlatformPC98)) { Common::SeekableReadStream *in = _res->createReadStream(fn); - vcnSize = in->readUint16LE() * (_vcnSrcBitsPerPixel << 3); - _vcnBlocks = new uint8[vcnSize]; - _screen->getPalette(1).loadAmigaPalette(*in, 1, 5); - in->seek(22, SEEK_CUR); + vcnSize = _flags.platform == Common::kPlatformPC98 ? in->size() : in->readUint16LE() * (_vcnSrcBitsPerPixel << 3); + _vcnBlocks = new uint8[vcnSize]; + if (_flags.platform == Common::kPlatformAmiga) { + _screen->getPalette(1).loadAmigaPalette(*in, 1, 5); + in->seek(22, SEEK_CUR); + } in->read(_vcnBlocks, vcnSize); delete in; return; diff --git a/engines/kyra/engine/scene_rpg.cpp b/engines/kyra/engine/scene_rpg.cpp index 1bb777f51c..8dc8e184e7 100644 --- a/engines/kyra/engine/scene_rpg.cpp +++ b/engines/kyra/engine/scene_rpg.cpp @@ -532,53 +532,50 @@ void KyraRpgEngine::vcnDraw_bw_trans_hiCol(uint8 *&dst, const uint8 *&src) { src += 9; } -void KyraRpgEngine::vcnDraw_fw_Amiga(uint8 *&dst, const uint8 *&src) { +void KyraRpgEngine::vcnDraw_fw_planar(uint8 *&dst, const uint8 *&src) { for (int blockX = 0; blockX < 8; blockX++) { uint8 col = 0; - for (int i = 0; i < 5; ++i) - col |= (((src[i] & (0x80 >> blockX)) >> (7 - blockX)) << i); + for (int i = 0; i < _vcnSrcBitsPerPixel; ++i) + col |= ((src[i] >> (7 - blockX)) & 1) << i; *dst++ = col; } - src += 5; + src += _vcnSrcBitsPerPixel; } -void KyraRpgEngine::vcnDraw_bw_Amiga(uint8 *&dst, const uint8 *&src) { +void KyraRpgEngine::vcnDraw_bw_planar(uint8 *&dst, const uint8 *&src) { for (int blockX = 7; blockX >= 0; blockX--) { uint8 col = 0; - for (int i = 0; i < 5; ++i) - col |= (((src[i] & (0x80 >> blockX)) >> (7 - blockX)) << i); + for (int i = 0; i < _vcnSrcBitsPerPixel; ++i) + col |= ((src[i] >> (7 - blockX)) & 1) << i; *dst++ = col; } - src += 5; + src += _vcnSrcBitsPerPixel; } -void KyraRpgEngine::vcnDraw_fw_trans_Amiga(uint8 *&dst, const uint8 *&src) { +void KyraRpgEngine::vcnDraw_fw_trans_planar(uint8 *&dst, const uint8 *&src) { for (int blockX = 0; blockX < 8; blockX++) { uint8 col = 0; - for (int i = 0; i < 5; ++i) - col |= (((src[i] & (0x80 >> blockX)) >> (7 - blockX)) << i); - + for (int i = 0; i < _vcnSrcBitsPerPixel; ++i) + col |= ((src[i] >> (7 - blockX)) & 1) << i; if (col) *dst = col; dst++; } - src += 5; + src += _vcnSrcBitsPerPixel; } -void KyraRpgEngine::vcnDraw_bw_trans_Amiga(uint8 *&dst, const uint8 *&src) { +void KyraRpgEngine::vcnDraw_bw_trans_planar(uint8 *&dst, const uint8 *&src) { for (int blockX = 7; blockX >= 0; blockX--) { uint8 col = 0; - for (int i = 0; i < 5; ++i) - col |= (((src[i] & (0x80 >> blockX)) >> (7 - blockX)) << i); - + for (int i = 0; i < _vcnSrcBitsPerPixel; ++i) + col |= ((src[i] >> (7 - blockX)) & 1) << i; if (col) *dst = col; dst++; } - src += 5; + src += _vcnSrcBitsPerPixel; } - int KyraRpgEngine::clickedWallShape(uint16 block, uint16 direction) { uint8 v = _wllShapeMap[_levelBlockProperties[block].walls[direction]]; if (!clickedShape(v)) |