aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/engine
diff options
context:
space:
mode:
authorathrxx2019-11-24 15:58:37 +0100
committerathrxx2019-12-18 20:50:43 +0100
commitddb6ca441babcbfefc9daf22d3bda3ddf940cb06 (patch)
tree702c3d5a40f158a49e027e4a7c09e59bd73e9a2f /engines/kyra/engine
parent512fe083670e0fa1d37b88876d8b612017714c27 (diff)
downloadscummvm-rg350-ddb6ca441babcbfefc9daf22d3bda3ddf940cb06.tar.gz
scummvm-rg350-ddb6ca441babcbfefc9daf22d3bda3ddf940cb06.tar.bz2
scummvm-rg350-ddb6ca441babcbfefc9daf22d3bda3ddf940cb06.zip
KYRA: (EOB/PC98) - fix level loading and some cleanup
(no block drawing yet)
Diffstat (limited to 'engines/kyra/engine')
-rw-r--r--engines/kyra/engine/chargen.cpp2
-rw-r--r--engines/kyra/engine/darkmoon.cpp3
-rw-r--r--engines/kyra/engine/eob.cpp17
-rw-r--r--engines/kyra/engine/eob.h3
-rw-r--r--engines/kyra/engine/eobcommon.cpp2
-rw-r--r--engines/kyra/engine/eobcommon.h2
-rw-r--r--engines/kyra/engine/scene_eob.cpp20
7 files changed, 33 insertions, 16 deletions
diff --git a/engines/kyra/engine/chargen.cpp b/engines/kyra/engine/chargen.cpp
index 696f6efdf6..6ddc360630 100644
--- a/engines/kyra/engine/chargen.cpp
+++ b/engines/kyra/engine/chargen.cpp
@@ -282,7 +282,7 @@ void CharacterGenerator::init() {
_screen->fadeToBlack(32);
_screen->loadEoBBitmap("CHARGEN", _vm->_cgaMappingDefault, 5, 3, 0);
- _screen->loadPC98Palette(4, _screen->getPalette(0));
+ _screen->selectPC98Palette(4, _screen->getPalette(0));
if (_vm->gameFlags().platform == Common::kPlatformAmiga || (_vm->game() == GI_EOB1 && _vm->gameFlags().platform == Common::kPlatformPC98))
_screen->fadeFromBlack(32);
diff --git a/engines/kyra/engine/darkmoon.cpp b/engines/kyra/engine/darkmoon.cpp
index 718e8a190e..900956cf49 100644
--- a/engines/kyra/engine/darkmoon.cpp
+++ b/engines/kyra/engine/darkmoon.cpp
@@ -67,10 +67,11 @@ Common::Error DarkMoonEngine::init() {
_screen->loadPalette(_flags.platform == Common::kPlatformFMTowns ? "MENU.PAL" : "PALETTE.COL", _screen->getPalette(0));
_screen->setScreenPalette(_screen->getPalette(0));
- // adjust menu settings for EOB II FM-Towns
if (_flags.platform == Common::kPlatformFMTowns) {
+ // adjust menu settings for EOB II FM-Towns
_screen->modifyScreenDim(6, 10, 100, 21, 40);
_screen->modifyScreenDim(27, 0, 0, 21, 2);
+ _vcnFilePattern = "%s.VCC";
}
return Common::kNoError;
diff --git a/engines/kyra/engine/eob.cpp b/engines/kyra/engine/eob.cpp
index 00aeffbe8a..5ecd43a2a2 100644
--- a/engines/kyra/engine/eob.cpp
+++ b/engines/kyra/engine/eob.cpp
@@ -72,6 +72,7 @@ Common::Error EoBEngine::init() {
_screen->modifyScreenDim(9, 0x01, 0x7D, 0x26, 0x3F);
_screen->modifyScreenDim(12, 0x01, 0x04, 0x14, 0xA0);
+ // adjust main menu coords for EOB I PC-98
if (_flags.platform == Common::kPlatformPC98)
_screen->modifyScreenDim(28, 0x0A, 0xA4, 0x15, 0x18);
@@ -85,6 +86,14 @@ Common::Error EoBEngine::init() {
_screen->loadPalette("PALETTE.COL", _screen->getPalette(0));
}
+ if (_flags.platform == Common::kPlatformPC98) {
+ _vcnFilePattern = "%s.ECB";
+ _vmpFilePattern = "%s.EMP";
+ } else if (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA) {
+ _vcnFilePattern = "%s.ECN";
+ _vmpFilePattern = "%s.EMP";
+ }
+
return Common::kNoError;
}
@@ -387,9 +396,9 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
if (doorType1 != 0xFF) {
for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType1 * 3 + i) << 2];
- _doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
+ _doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
enc = &_doorSwitchShapeEncodeDefs[(doorType1 * 3 + i) << 2];
- _doorSwitches[shapeId1 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
+ _doorSwitches[shapeId1 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
_doorSwitches[shapeId1 + i].x = _doorSwitchCoords[doorType1 * 6 + i * 2];
_doorSwitches[shapeId1 + i].y = _doorSwitchCoords[doorType1 * 6 + i * 2 + 1];
}
@@ -398,9 +407,9 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
if (doorType2 != 0xFF) {
for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType2 * 3 + i) << 2];
- _doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
+ _doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
enc = &_doorSwitchShapeEncodeDefs[(doorType2 * 3 + i) << 2];
- _doorSwitches[shapeId2 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
+ _doorSwitches[shapeId2 + i].shp = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
_doorSwitches[shapeId2 + i].x = _doorSwitchCoords[doorType2 * 6 + i * 2];
_doorSwitches[shapeId2 + i].y = _doorSwitchCoords[doorType2 * 6 + i * 2 + 1];
}
diff --git a/engines/kyra/engine/eob.h b/engines/kyra/engine/eob.h
index ac88963514..309636e7f9 100644
--- a/engines/kyra/engine/eob.h
+++ b/engines/kyra/engine/eob.h
@@ -31,6 +31,7 @@ namespace Kyra {
class EoBEngine : public EoBCoreEngine {
friend class GUI_EoB;
+friend class EoBSeqPlayerCommon;
friend class EoBIntroPlayer;
friend class EoBAmigaFinalePlayer;
public:
@@ -84,8 +85,6 @@ private:
void seq_playFinale();
void seq_xdeath();
- void boxMorphTransition(int targetDestX, int targetDestY, int targetFinalX, int targetFinalY, int targetSrcX, int targetSrcY, int targetFinalW, int targetFinalH, int originX1, int originY1, int originW, int originH, int fillColor = -1);
-
const char *const *_finBonusStrings;
// characters
diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index 1767857f3b..238f1404bd 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -59,6 +59,8 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags) : KyraRpgE
_envAudioTimer = 0;
_flashShapeTimer = 0;
_drawSceneTimer = 0;
+ _vcnFilePattern = "%s.VCN";
+ _vmpFilePattern = "%s.VMP";
_largeItemShapes = _smallItemShapes = _thrownItemShapes = _spellShapes = _firebeamShapes = 0;
_itemIconShapes = _amigaBlueItemIconShapes = _wallOfForceShapes = _teleporterShapes = _sparkShapes = _compassShapes = 0;
diff --git a/engines/kyra/engine/eobcommon.h b/engines/kyra/engine/eobcommon.h
index 91d0a6e089..b54e70b4f5 100644
--- a/engines/kyra/engine/eobcommon.h
+++ b/engines/kyra/engine/eobcommon.h
@@ -629,6 +629,8 @@ protected:
int8 _currentSub;
Common::String _curGfxFile;
Common::String _curBlockFile;
+ Common::String _vcnFilePattern;
+ Common::String _vmpFilePattern;
uint32 _drawSceneTimer;
uint32 _flashShapeTimer;
diff --git a/engines/kyra/engine/scene_eob.cpp b/engines/kyra/engine/scene_eob.cpp
index 6d51c0c725..cbe6055b79 100644
--- a/engines/kyra/engine/scene_eob.cpp
+++ b/engines/kyra/engine/scene_eob.cpp
@@ -94,7 +94,7 @@ void EoBCoreEngine::loadLevel(int level, int sub) {
if (_flags.gameID == GI_EOB1 && level == 7 && _levelBlockProperties[0x035C].assignedObjects == 0x0E89)
_levelBlockProperties[0x035C].assignedObjects = 0x0E8D;
- loadVcnData(gfxFile.c_str(), (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[level - 1]] : 0);
+ loadVcnData(gfxFile.c_str(), _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[level - 1]] : 0);
_screen->loadEoBBitmap("INVENT", _cgaMappingInv, 5, 3, 2);
if (_flags.platform == Common::kPlatformAmiga && _flags.gameID == GI_EOB1)
_screen->getPalette(0).copy(_screen->getPalette(1), 1, 5, 1);
@@ -107,6 +107,9 @@ void EoBCoreEngine::loadLevel(int level, int sub) {
_sceneDrawPage2 = 1;
_screen->setCurPage(0);
setHandItem(_itemInHand);
+
+ if (_flags.platform == Common::kPlatformPC98)
+ snd_playSong(level + 1);
}
void EoBCoreEngine::readLevelFileData(int level) {
@@ -159,8 +162,8 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
loadBlockProperties((const char *)pos);
pos += slen;
- const char *vmpPattern = (_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.EMP" : "%s.VMP";
- Common::SeekableReadStreamEndian *s = _res->createEndianAwareReadStream(Common::String::format(vmpPattern, (const char *)pos));
+ Common::SeekableReadStreamEndian *s = _res->createEndianAwareReadStream(Common::String::format(_vmpFilePattern.c_str(), (const char *)pos));
+ assert(s);
uint16 size = (_flags.platform == Common::kPlatformFMTowns) ? 2916 : s->readUint16();
delete[] _vmpPtr;
_vmpPtr = new uint16[size];
@@ -203,6 +206,8 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
_screen->setScreenPalette(_screen->getPalette(0));
} else if (_flags.platform == Common::kPlatformAmiga) {
// Amiga versions don't have shape shading
+ } else if (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformPC98) {
+
} else if (_configRenderMode != Common::kRenderCGA) {
Palette backupPal(256);
backupPal.copy(_screen->getPalette(0), 224, 32, 224);
@@ -320,12 +325,11 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
uint32 vcnSize = 0;
if (_flags.platform == Common::kPlatformFMTowns) {
- _vcnBlocks = _res->fileData(Common::String::format("%s.VCC", _lastBlockDataFile).c_str(), &vcnSize);
+ _vcnBlocks = _res->fileData(Common::String::format(_vcnFilePattern.c_str(), _lastBlockDataFile).c_str(), &vcnSize);
return;
}
- const char *filePattern = ((_flags.gameID == GI_EOB1 && (_configRenderMode == Common::kRenderEGA || _configRenderMode == Common::kRenderCGA)) ? "%s.ECN" : "%s.VCN");
- Common::String fn = Common::String::format(filePattern, _lastBlockDataFile);
+ Common::String fn = Common::String::format(_vcnFilePattern.c_str(), _lastBlockDataFile);
if (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformAmiga) {
Common::SeekableReadStream *in = _res->createReadStream(fn);
@@ -495,7 +499,7 @@ void EoBCoreEngine::assignWallsAndDecorations(int wallIndex, int vmpIndex, int d
if (r->w == 0 || r->h == 0)
error("Error trying to make decoration %d (x: %d, y: %d, w: %d, h: %d)", decIndex, r->x, r->y, r->w, r->h);
- _levelDecorationShapes[t] = _screen->encodeShape(r->x, r->y, r->w, r->h, false, (_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformDOS) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
+ _levelDecorationShapes[t] = _screen->encodeShape(r->x, r->y, r->w, r->h, false, _cgaLevelMappingIndex ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
}
decIndex = _levelDecorationProperties[_mappedDecorationsCount++].next;
@@ -706,7 +710,7 @@ int EoBCoreEngine::calcNewBlockPositionAndTestPassability(uint16 curBlock, uint1
void EoBCoreEngine::notifyBlockNotPassable() {
_txt->printMessage(_warningStrings[0]);
- snd_playSoundEffect(29); //PC98 : 45
+ snd_playSoundEffect(_flags.gameID == GI_EOB1 && _flags.platform == Common::kPlatformPC98 ? 45 : 29);
removeInputTop();
}