diff options
author | athrxx | 2012-02-15 18:11:18 +0100 |
---|---|---|
committer | athrxx | 2012-02-21 21:48:42 +0100 |
commit | a4223e9c2ba7d53097df95a3f640ffdba7d0fb20 (patch) | |
tree | 64c69966b4be6bdd7d798c102331babe76464164 | |
parent | 151d314912b08d7d598a3995524d89c8b4ab0371 (diff) | |
download | scummvm-rg350-a4223e9c2ba7d53097df95a3f640ffdba7d0fb20.tar.gz scummvm-rg350-a4223e9c2ba7d53097df95a3f640ffdba7d0fb20.tar.bz2 scummvm-rg350-a4223e9c2ba7d53097df95a3f640ffdba7d0fb20.zip |
KYRA: (EOB) - fix EOB1 door clipping
(this was done in the same way as in EOB2 and LOL, but it has to be slightly different)
-rw-r--r-- | devtools/create_kyradat/create_kyradat.cpp | 16 | ||||
-rw-r--r-- | devtools/create_kyradat/create_kyradat.h | 4 | ||||
-rw-r--r-- | devtools/create_kyradat/games.cpp | 12 | ||||
-rw-r--r-- | devtools/create_kyradat/tables.cpp | 26 | ||||
-rw-r--r-- | dists/engine-data/kyra.dat | bin | 469249 -> 469735 bytes | |||
-rw-r--r-- | engines/kyra/eob.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_rpg.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_rpg.h | 6 | ||||
-rw-r--r-- | engines/kyra/resource.h | 4 | ||||
-rw-r--r-- | engines/kyra/scene_lol.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/scene_rpg.cpp | 21 | ||||
-rw-r--r-- | engines/kyra/sprites_eob.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/staticres_rpg.cpp | 4 |
14 files changed, 89 insertions, 16 deletions
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp index a3d88c7b52..489be3e04d 100644 --- a/devtools/create_kyradat/create_kyradat.cpp +++ b/devtools/create_kyradat/create_kyradat.cpp @@ -45,7 +45,7 @@ #include <map> enum { - kKyraDatVersion = 81 + kKyraDatVersion = 82 }; const ExtractFilename extractFilenames[] = { @@ -656,6 +656,10 @@ const ExtractFilename extractFilenames[] = { { kRpgCommonDscBlockIndex, kTypeRawData, false }, { kLoLDscDoor4, kLoLTypeRaw16, false }, { kRpgCommonDscDoorY2, kTypeRawData, false }, + { kRpgCommonDscDoorFrameY1, kTypeRawData, false }, + { kRpgCommonDscDoorFrameY2, kTypeRawData, false }, + { kRpgCommonDscDoorFrameIndex1, kTypeRawData, false }, + { kRpgCommonDscDoorFrameIndex2, kTypeRawData, false }, { kLoLDscDoorX, kLoLTypeRaw16, false }, { kLoLDscDoorY, kLoLTypeRaw16, false }, @@ -1786,7 +1790,7 @@ const char *getIdString(const int id) { case kEoB1CgaMappingIcons: return "kEoB1CgaMappingIcons"; case kEoB1CgaMappingDeco: - return "kEoB1CgaMappingDeco"; + return "kEoB1CgaMappingDeco"; case kEoB1CgaLevelMappingIndex: return "kEoB1CgaLevelMappingIndex"; case kEoB1CgaMappingLevel0: @@ -2165,6 +2169,14 @@ const char *getIdString(const int id) { return "kRpgCommonDscBlockIndex"; case kRpgCommonDscDoorY2: return "kRpgCommonDscDoorY2"; + case kRpgCommonDscDoorFrameY1: + return "kRpgCommonDscDoorFrameY1"; + case kRpgCommonDscDoorFrameY2: + return "kRpgCommonDscDoorFrameY2"; + case kRpgCommonDscDoorFrameIndex1: + return "kRpgCommonDscDoorFrameIndex1"; + case kRpgCommonDscDoorFrameIndex2: + return "kRpgCommonDscDoorFrameIndex2"; case kLoLDscDoorScale: return "kLoLDscDoorScale"; case kLoLDscDoor4: diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h index 83ee2855fa..c2a69cfd79 100644 --- a/devtools/create_kyradat/create_kyradat.h +++ b/devtools/create_kyradat/create_kyradat.h @@ -190,6 +190,10 @@ enum kExtractID { kRpgCommonDscBlockMap, kRpgCommonDscDimMap, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, + kRpgCommonDscDoorFrameIndex1, + kRpgCommonDscDoorFrameIndex2, kRpgCommonDscBlockIndex, kEoBBaseChargenStrings1, diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp index a45cb802ef..258d2dd50d 100644 --- a/devtools/create_kyradat/games.cpp +++ b/devtools/create_kyradat/games.cpp @@ -827,6 +827,8 @@ const int lolFloppyNeed[] = { kLoLDscOvlIndex, kRpgCommonDscBlockIndex, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, kLoLDscDoorScale, kLoLDscDoor4, kLoLDscDoorX, @@ -907,6 +909,8 @@ const int lolPC98Need[] = { kLoLDscOvlIndex, kRpgCommonDscBlockIndex, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, kLoLDscDoorScale, kLoLDscDoor4, kLoLDscDoorX, @@ -992,6 +996,8 @@ const int lolCDNeed[] = { kLoLDscOvlIndex, kRpgCommonDscBlockIndex, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, kLoLDscDoorScale, kLoLDscDoor4, kLoLDscDoorX, @@ -1253,6 +1259,10 @@ const int eob1FloppyNeed[] = { kEoBBaseDscDoorY6, kEoBBaseDscDoorY7, kEoBBaseDscDoorCoordsExt, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, + kRpgCommonDscDoorFrameIndex1, + kRpgCommonDscDoorFrameIndex2, kEoBBaseDscItemPosIndex, kEoBBaseDscItemShpX, @@ -1472,6 +1482,8 @@ const int eob2FloppyNeed[] = { kEoBBaseDscDoorType5Offs, kEoBBaseDscDoorY1, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, kEoBBaseDscItemPosIndex, kEoBBaseDscItemShpX, diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp index b1b542deea..1b9ca45259 100644 --- a/devtools/create_kyradat/tables.cpp +++ b/devtools/create_kyradat/tables.cpp @@ -3647,6 +3647,28 @@ const ExtractEntrySearchData kRpgCommonDscDoorY2Provider[] = { EXTRACT_END_ENTRY }; +const ExtractEntrySearchData kRpgCommonDscDoorFrameY1Provider[] = { + { UNK_LANG, kPlatformUnknown, { 0x00000020, 0x0000053B, { { 0xF0, 0x9E, 0xC5, 0xB1, 0xEA, 0x5A, 0x58, 0xBD, 0xAC, 0x7B, 0xB2, 0xD4, 0xFE, 0x3F, 0x4F, 0x51 } } } }, // EOB I + { UNK_LANG, kPlatformUnknown, { 0x00000004, 0x00000046, { { 0xD4, 0xA4, 0xEC, 0xA2, 0x99, 0xB6, 0x5E, 0x12, 0x98, 0xFF, 0xF2, 0x55, 0xC8, 0xBD, 0xC5, 0x8F } } } }, // EOB II + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kRpgCommonDscDoorFrameY2Provider[] = { + { UNK_LANG, kPlatformUnknown, { 0x00000020, 0x0000053B, { { 0xF0, 0x9E, 0xC5, 0xB1, 0xEA, 0x5A, 0x58, 0xBD, 0xAC, 0x7B, 0xB2, 0xD4, 0xFE, 0x3F, 0x4F, 0x51 } } } }, // EOB I + { UNK_LANG, kPlatformUnknown, { 0x00000004, 0x00000150, { { 0x49, 0x7E, 0xF4, 0xDF, 0x8D, 0x04, 0x0A, 0xCE, 0x49, 0xBB, 0xA2, 0x1D, 0x8D, 0xC2, 0x14, 0x9E } } } }, // EOB II + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kRpgCommonDscDoorFrameIndex1Provider[] = { + { UNK_LANG, kPlatformUnknown, { 0x0000000C, 0x00000058, { { 0xC9, 0xAF, 0x1F, 0x68, 0xF1, 0xDE, 0x96, 0x9B, 0x3B, 0xCB, 0x56, 0xEC, 0x2E, 0x62, 0x9A, 0x0A } } } }, + EXTRACT_END_ENTRY +}; + +const ExtractEntrySearchData kRpgCommonDscDoorFrameIndex2Provider[] = { + { UNK_LANG, kPlatformUnknown, { 0x0000000C, 0x000000E8, { { 0x8C, 0x10, 0x56, 0xEA, 0x4D, 0x1A, 0x9C, 0xB2, 0x55, 0x54, 0xA5, 0x61, 0x1D, 0x19, 0x4E, 0x50 } } } }, + EXTRACT_END_ENTRY +}; + const ExtractEntrySearchData kLoLDscDoorScaleProvider[] = { { UNK_LANG, kPlatformUnknown, { 0x00000010, 0x0000024C, { { 0x8D, 0x83, 0x26, 0xEE, 0xDC, 0xF7, 0x13, 0xC0, 0xAA, 0x88, 0xC2, 0xAA, 0x66, 0xA7, 0x59, 0x41 } } } }, @@ -4382,6 +4404,10 @@ const ExtractEntry extractProviders[] = { { kLoLDscOvlIndex, kLoLDscOvlIndexProvider }, { kRpgCommonDscBlockIndex, kRpgCommonDscBlockIndexProvider }, { kRpgCommonDscDoorY2, kRpgCommonDscDoorY2Provider }, + { kRpgCommonDscDoorFrameY1, kRpgCommonDscDoorFrameY1Provider }, + { kRpgCommonDscDoorFrameY2, kRpgCommonDscDoorFrameY2Provider }, + { kRpgCommonDscDoorFrameIndex1, kRpgCommonDscDoorFrameIndex1Provider }, + { kRpgCommonDscDoorFrameIndex2, kRpgCommonDscDoorFrameIndex2Provider }, { kLoLDscDoorScale, kLoLDscDoorScaleProvider }, { kLoLDscDoor4, kLoLDscDoor4Provider }, { kLoLDscDoorX, kLoLDscDoorXProvider }, diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat Binary files differindex 2fc6791d5d..c89b21cbca 100644 --- a/dists/engine-data/kyra.dat +++ b/dists/engine-data/kyra.dat diff --git a/engines/kyra/eob.cpp b/engines/kyra/eob.cpp index 769e77e63c..9e58affded 100644 --- a/engines/kyra/eob.cpp +++ b/engines/kyra/eob.cpp @@ -421,7 +421,7 @@ void EoBEngine::drawDoorIntern(int type, int index, int x, int y, int w, int wal d1 = x - (_doorShapes[shapeIndex + 3][2] << 2); x -= (shp[2] << 2); drawBlockObject(0, 2, _doorShapes[shapeIndex + 3], d1, y, 5); - scaleLevelShapesDim(index, y1, y2, 5); + setDoorShapeDim(index, y1, y2, 5); y = _dscDoorY3[mDim] - ((wall < 30) ? (wall - _dscDoorScaleOffs[wall]) * _dscDoorScaleMult1[mDim] : _dscDoorScaleMult2[mDim]); drawBlockObject(0, 2, shp, x, y, 5); if (_wllShapeMap[wall] == -1) diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp index a885eb9e2d..1e3890b124 100644 --- a/engines/kyra/kyra_rpg.cpp +++ b/engines/kyra/kyra_rpg.cpp @@ -94,6 +94,10 @@ KyraRpgEngine::KyraRpgEngine(OSystem *system, const GameFlags &flags) : KyraEngi _dscDimMap = 0; _dscDoorShpIndex = 0; _dscDoorY2 = 0; + _dscDoorFrameY1 = 0; + _dscDoorFrameY2 = 0; + _dscDoorFrameIndex1 = 0; + _dscDoorFrameIndex2 = 0; _shpDmX1 = _shpDmX2 = 0; diff --git a/engines/kyra/kyra_rpg.h b/engines/kyra/kyra_rpg.h index aec34fc3c9..f4678e302a 100644 --- a/engines/kyra/kyra_rpg.h +++ b/engines/kyra/kyra_rpg.h @@ -183,7 +183,7 @@ protected: virtual const uint8 *getBlockFileData(int levelIndex) = 0; void setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim); - void scaleLevelShapesDim(int index, int16 &y1, int16 &y2, int dim); + void setDoorShapeDim(int index, int16 &y1, int16 &y2, int dim); void drawLevelModifyScreenDim(int dim, int16 x1, int16 y1, int16 x2, int16 y2); void generateBlockDrawingBuffer(); void generateVmpTileData(int16 startBlockX, uint8 startBlockY, uint8 wllVmpIndex, int16 vmpOffset, uint8 numBlocksX, uint8 numBlocksY); @@ -271,6 +271,10 @@ protected: const uint8 *_dscDoorShpIndex; int _dscDoorShpIndexSize; const uint8 *_dscDoorY2; + const uint8 *_dscDoorFrameY1; + const uint8 *_dscDoorFrameY2; + const uint8 *_dscDoorFrameIndex1; + const uint8 *_dscDoorFrameIndex2; // Script virtual void runLevelScript(int block, int flags) = 0; diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h index 84592880e1..f2bc4e8146 100644 --- a/engines/kyra/resource.h +++ b/engines/kyra/resource.h @@ -263,6 +263,10 @@ enum KyraResources { kRpgCommonDscBlockMap, kRpgCommonDscDimMap, kRpgCommonDscDoorY2, + kRpgCommonDscDoorFrameY1, + kRpgCommonDscDoorFrameY2, + kRpgCommonDscDoorFrameIndex1, + kRpgCommonDscDoorFrameIndex2, kRpgCommonDscBlockIndex, kEoBBaseChargenStrings1, diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 79884718d7..628654f127 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -1436,7 +1436,7 @@ void LoLEngine::drawSceneShapes(int) { if (v > 80) v = 80; - scaleLevelShapesDim(t, dimY1, dimY2, _sceneShpDim); + setDoorShapeDim(t, dimY1, dimY2, _sceneShpDim); drawDoor(_doorShapes[(s < 23 ? _dscDoorShpIndex[s] : 0)], 0, t, 10, 0, -v, 2); setLevelShapesDim(t, dimY1, dimY2, _sceneShpDim); } diff --git a/engines/kyra/scene_rpg.cpp b/engines/kyra/scene_rpg.cpp index 269a5d3461..7f6b16bfc6 100644 --- a/engines/kyra/scene_rpg.cpp +++ b/engines/kyra/scene_rpg.cpp @@ -51,7 +51,7 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim) if (t > x1) { x1 = t; if (!(a & 0x10)) - scaleLevelShapesDim(index, y1, y2, -1); + setDoorShapeDim(index, y1, y2, -1); } t = _dscDim2[((m + i) << 1) + 1]; @@ -59,7 +59,7 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim) if (t < x2) { x2 = t; if (!(a & 0x10)) - scaleLevelShapesDim(index, y1, y2, -1); + setDoorShapeDim(index, y1, y2, -1); } } else { int t = _dscDim1[m + i]; @@ -100,17 +100,20 @@ void KyraRpgEngine::setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim) drawLevelModifyScreenDim(dim, x1, 0, x2, 15); } -void KyraRpgEngine::scaleLevelShapesDim(int index, int16 &y1, int16 &y2, int dim) { - static const int8 dscY1[] = { 0x1E, 0x18, 0x10, 0x00 }; - static const int8 dscY2[] = { 0x3B, 0x47, 0x56, 0x78 }; - +void KyraRpgEngine::setDoorShapeDim(int index, int16 &y1, int16 &y2, int dim) { uint8 a = _dscDimMap[index]; - if (dim == -1 && a != 3) + if (_flags.gameID != GI_EOB1 && dim == -1 && a != 3) a++; - y1 = dscY1[a]; - y2 = dscY2[a]; + uint8 b = a; + if (_flags.gameID == GI_EOB1) { + a += _dscDoorFrameIndex1[_currentLevel - 1]; + b += _dscDoorFrameIndex2[_currentLevel - 1]; + } + + y1 = _dscDoorFrameY1[a]; + y2 = _dscDoorFrameY2[b]; if (dim == -1) return; diff --git a/engines/kyra/sprites_eob.cpp b/engines/kyra/sprites_eob.cpp index 40fc7c14e9..068647aeec 100644 --- a/engines/kyra/sprites_eob.cpp +++ b/engines/kyra/sprites_eob.cpp @@ -462,7 +462,7 @@ void EoBCoreEngine::drawDoor(int index) { int16 y1 = 0; int16 y2 = 0; - scaleLevelShapesDim(index, y1, y2, 5); + setDoorShapeDim(index, y1, y2, 5); drawDoorIntern(type, index, x, y, w, s, d, y1, y2); drawLevelModifyScreenDim(5, _shpDmX1, 0, _shpDmX2, 15); } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 2be25ce093..423b827092 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -38,7 +38,7 @@ namespace Kyra { -#define RESFILE_VERSION 81 +#define RESFILE_VERSION 82 namespace { bool checkKyraDat(Common::SeekableReadStream *file) { diff --git a/engines/kyra/staticres_rpg.cpp b/engines/kyra/staticres_rpg.cpp index cc75ae3442..a30cbf7d05 100644 --- a/engines/kyra/staticres_rpg.cpp +++ b/engines/kyra/staticres_rpg.cpp @@ -88,6 +88,10 @@ void KyraRpgEngine::initStaticResource() { _dscDimMap = _staticres->loadRawData(kRpgCommonDscDimMap, temp); _dscDoorShpIndex = _staticres->loadRawData(kRpgCommonDscDoorShapeIndex, _dscDoorShpIndexSize); _dscDoorY2 = _staticres->loadRawData(kRpgCommonDscDoorY2, temp); + _dscDoorFrameY1 = _staticres->loadRawData(kRpgCommonDscDoorFrameY1, temp); + _dscDoorFrameY2 = _staticres->loadRawData(kRpgCommonDscDoorFrameY2, temp); + _dscDoorFrameIndex1 = _staticres->loadRawData(kRpgCommonDscDoorFrameIndex1, temp); + _dscDoorFrameIndex2 = _staticres->loadRawData(kRpgCommonDscDoorFrameIndex2, temp); _moreStrings = _staticres->loadStrings(kRpgCommonMoreStrings, temp); } |