aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/staticres.cpp
diff options
context:
space:
mode:
authorNorbert Lange2009-08-16 16:39:34 +0000
committerNorbert Lange2009-08-16 16:39:34 +0000
commitc96affd0c1e5480fe1a4a3d3e82583c795570d21 (patch)
tree3f3a71bc02976024345c5c3e44534055d9c9c4cd /engines/kyra/staticres.cpp
parent2b147c57161cdacf3cdc5bc572ce46160cbd6b5e (diff)
parentce30a513acdaab2ca5eacd136cc80ade1beabb3a (diff)
downloadscummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.tar.gz
scummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.tar.bz2
scummvm-rg350-c96affd0c1e5480fe1a4a3d3e82583c795570d21.zip
merge with trunk
svn-id: r43443
Diffstat (limited to 'engines/kyra/staticres.cpp')
-rw-r--r--engines/kyra/staticres.cpp49
1 files changed, 26 insertions, 23 deletions
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 83f4b22b6d..d4882a12af 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -44,7 +44,7 @@
namespace Kyra {
-#define RESFILE_VERSION 49
+#define RESFILE_VERSION 50
namespace {
bool checkKyraDat(Common::SeekableReadStream *file) {
@@ -444,16 +444,18 @@ bool StaticResource::init() {
{ kLolButtonList7, kLolRawDataBe16, "BUTTON7.LST" },
{ kLolButtonList8, kLolRawDataBe16, "BUTTON84.LST" },
- { lolLegendData, kRawData, "MAPLGND.DEF" },
- { lolMapCursorOvl, kRawData, "MAPCURSOR.PAL" },
- { lolMapStringId, kLolRawDataBe16, "MAPSTRID.LST" },
- //{ lolMapPal, kRawData, "MAP.PAL" },
+ { kLolLegendData, kRawData, "MAPLGND.DEF" },
+ { kLolMapCursorOvl, kRawData, "MAPCURSOR.PAL" },
+ { kLolMapStringId, kLolRawDataBe16, "MAPSTRID.LST" },
+ //{ kLolMapPal, kRawData, "MAP.PAL" },
- { lolSpellbookAnim, kRawData, "MBOOKA.DEF" },
- { lolSpellbookCoords, kRawData, "MBOOKC.DEF" },
- { lolHealShapeFrames, kRawData, "MHEAL.SHP" },
- { lolLightningDefs, kRawData, "MLGHTNG.DEF" },
- { lolFireballCoords, kLolRawDataBe16, "MFIREBLL.DEF" },
+ { kLolSpellbookAnim, kRawData, "MBOOKA.DEF" },
+ { kLolSpellbookCoords, kRawData, "MBOOKC.DEF" },
+ { kLolHealShapeFrames, kRawData, "MHEAL.SHP" },
+ { kLolLightningDefs, kRawData, "MLGHTNG.DEF" },
+ { kLolFireballCoords, kLolRawDataBe16, "MFIREBLL.DEF" },
+
+ { kLolHistory, kRawData, "HISTORY.FLS" },
{ 0, 0, 0 }
};
@@ -589,6 +591,7 @@ void StaticResource::unloadId(int id) {
if (pos->id == id || id == -1) {
const FileType *filetype = getFiletype(pos->type);
(this->*(filetype->free))(pos->data, pos->size);
+ pos = _resList.erase(pos);
if (id != -1)
break;
}
@@ -1874,10 +1877,10 @@ void LoLEngine::initStaticResource() {
_buttonList7 = (const int16 *)_staticres->loadRawDataBe16(kLolButtonList7, _buttonList7Size);
_buttonList8 = (const int16 *)_staticres->loadRawDataBe16(kLolButtonList8, _buttonList8Size);
- _autoMapStrings = _staticres->loadRawDataBe16(lolMapStringId, _autoMapStringsSize);
+ _autoMapStrings = _staticres->loadRawDataBe16(kLolMapStringId, _autoMapStringsSize);
int tmpSize = 0;
- const uint8 *tmp = _staticres->loadRawData(lolLegendData, tmpSize);
+ const uint8 *tmp = _staticres->loadRawData(kLolLegendData, tmpSize);
tmpSize /= 5;
if (tmp) {
_defaultLegendData = new MapLegendData[tmpSize];
@@ -1888,19 +1891,19 @@ void LoLEngine::initStaticResource() {
_defaultLegendData[i].stringId = READ_LE_UINT16(tmp);
tmp += 2;
}
- _staticres->unloadId(lolLegendData);
+ _staticres->unloadId(kLolLegendData);
}
- tmp = _staticres->loadRawData(lolMapCursorOvl, tmpSize);
+ tmp = _staticres->loadRawData(kLolMapCursorOvl, tmpSize);
_mapCursorOverlay = new uint8[tmpSize];
memcpy(_mapCursorOverlay, tmp, tmpSize);
- _staticres->unloadId(lolMapCursorOvl);
+ _staticres->unloadId(kLolMapCursorOvl);
- _updateSpellBookCoords = _staticres->loadRawData(lolSpellbookCoords, _updateSpellBookCoordsSize);
- _updateSpellBookAnimData = _staticres->loadRawData(lolSpellbookAnim, _updateSpellBookAnimDataSize);
- _healShapeFrames = _staticres->loadRawData(lolHealShapeFrames, _healShapeFramesSize);
+ _updateSpellBookCoords = _staticres->loadRawData(kLolSpellbookCoords, _updateSpellBookCoordsSize);
+ _updateSpellBookAnimData = _staticres->loadRawData(kLolSpellbookAnim, _updateSpellBookAnimDataSize);
+ _healShapeFrames = _staticres->loadRawData(kLolHealShapeFrames, _healShapeFramesSize);
- tmp = _staticres->loadRawData(lolLightningDefs, tmpSize);
+ tmp = _staticres->loadRawData(kLolLightningDefs, tmpSize);
if (tmp) {
_lightningProps = new LightningProperty[5];
for (int i = 0; i < 5; i++) {
@@ -1908,10 +1911,10 @@ void LoLEngine::initStaticResource() {
_lightningProps[i].frameDiv = tmp[(i << 2) + 1];
_lightningProps[i].sfxId = READ_LE_UINT16(&tmp[(i << 2) + 2]);
}
- _staticres->unloadId(lolLightningDefs);
+ _staticres->unloadId(kLolLightningDefs);
}
- _fireBallCoords = (const int16*)_staticres->loadRawDataBe16(lolFireballCoords, _fireBallCoordsSize);
+ _fireBallCoords = (const int16*)_staticres->loadRawDataBe16(kLolFireballCoords, _fireBallCoordsSize);
_buttonCallbacks.clear();
_buttonCallbacks.reserve(95);
@@ -3417,7 +3420,7 @@ extern const byte LoKAmigaSfxIntro[] = {
0x45, 0x03, 0x00, 0x00, 0x02, 0x24, 0x6E, 0x00,
0x3C, 0x16, 0x00, 0x00, 0x26, 0x77, 0x6E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// TODO: fileoffset = 0x2C55E, len = 120 * 8
@@ -3541,7 +3544,7 @@ extern const byte LoKAmigaSfxGame[] = {
0x30, 0x23, 0x00, 0x00, 0x16, 0x99, 0x50, 0x02,
0x30, 0x23, 0x00, 0x00, 0x16, 0x99, 0x50, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02,
+ 0x3C, 0x13, 0x00, 0x00, 0x01, 0x56, 0x78, 0x02
};
} // End of namespace Kyra