diff options
author | Travis Howell | 2005-04-08 23:27:36 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-08 23:27:36 +0000 |
commit | dbc4d13b3d003ac5225c9b18d7b4b86d01d8b735 (patch) | |
tree | d47055a0c15383ca7a6650db553977bcec851056 /scumm | |
parent | c30dd3e9aaf7fdbe7cf9c50aae744a1be1568618 (diff) | |
download | scummvm-rg350-dbc4d13b3d003ac5225c9b18d7b4b86d01d8b735.tar.gz scummvm-rg350-dbc4d13b3d003ac5225c9b18d7b4b86d01d8b735.tar.bz2 scummvm-rg350-dbc4d13b3d003ac5225c9b18d7b4b86d01d8b735.zip |
load/save sprite data in HE90+ games.
svn-id: r17459
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/saveload.cpp | 3 | ||||
-rw-r--r-- | scumm/saveload.h | 2 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 70 | ||||
-rw-r--r-- | scumm/sprite_he.h | 1 |
5 files changed, 76 insertions, 1 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index d3f6e8d85b..5fd1fa0055 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -1048,6 +1048,7 @@ protected: void spriteAddImageToList(int spriteId, int imageNum, int *spriteIdptr); public: + void saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion); void spritesBlitToScreen(); void spritesMarkDirty(bool unkFlag); void spritesSortActiveSprites(); diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index fcf73bb1af..f63b0e667f 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -759,6 +759,9 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { else NES_loadCostumeSet(_NESCostumeSet); + if (_heversion >= 90) { + ((ScummEngine_v90he *)this)->saveOrLoadSpriteData(&*s, savegameVersion); + } if (_heversion >= 71) { Wiz *wiz = &((ScummEngine_v70he *)this)->_wiz; s->saveLoadArrayOf(wiz->_polygons, ARRAYSIZE(wiz->_polygons), sizeof(wiz->_polygons[0]), polygonEntries); diff --git a/scumm/saveload.h b/scumm/saveload.h index 3a3e9ea34d..bc6cfa8522 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -32,7 +32,7 @@ namespace Scumm { // Can be useful for other ports too :) #define VER(x) x -#define CURRENT_VER 47 +#define CURRENT_VER 48 // To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types, // we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index d6c7b6ff62..b0b1c8b327 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -24,6 +24,7 @@ #include "scumm/intern.h" #include "scumm/resource.h" +#include "scumm/saveload.h" #include "scumm/scumm.h" #include "scumm/sprite_he.h" #include "scumm/usage_bits.h" @@ -1356,4 +1357,73 @@ void ScummEngine_v90he::spritesProcessWiz(bool arg) { } } +void ScummEngine_v90he::saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion) { + static const SaveLoadEntry spriteEntries[] = { + MKLINE(SpriteInfo, id, sleInt32, VER(48)), + MKLINE(SpriteInfo, zorder, sleInt32, VER(48)), + MKLINE(SpriteInfo, flags, sleInt32, VER(48)), + MKLINE(SpriteInfo, resId, sleInt32, VER(48)), + MKLINE(SpriteInfo, resState, sleInt32, VER(48)), + MKLINE(SpriteInfo, groupNum, sleInt32, VER(48)), + MKLINE(SpriteInfo, paletteNum, sleInt32, VER(48)), + MKLINE(SpriteInfo, zorderPriority, sleInt32, VER(48)), + MKLINE(SpriteInfo, bbox.left, sleInt32, VER(48)), + MKLINE(SpriteInfo, bbox.top, sleInt32, VER(48)), + MKLINE(SpriteInfo, bbox.right, sleInt32, VER(48)), + MKLINE(SpriteInfo, bbox.bottom, sleInt32, VER(48)), + MKLINE(SpriteInfo, dx, sleInt32, VER(48)), + MKLINE(SpriteInfo, dy, sleInt32, VER(48)), + MKLINE(SpriteInfo, pos.x, sleInt32, VER(48)), + MKLINE(SpriteInfo, pos.y, sleInt32, VER(48)), + MKLINE(SpriteInfo, tx, sleInt32, VER(48)), + MKLINE(SpriteInfo, ty, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_44, sleInt32, VER(48)), + MKLINE(SpriteInfo, curImageState, sleInt32, VER(48)), + MKLINE(SpriteInfo, curResId, sleInt32, VER(48)), + MKLINE(SpriteInfo, imglistNum, sleInt32, VER(48)), + MKLINE(SpriteInfo, xmapNum, sleInt32, VER(48)), + MKLINE(SpriteInfo, res_wiz_states, sleInt32, VER(48)), + MKLINE(SpriteInfo, angle, sleInt32, VER(48)), + MKLINE(SpriteInfo, zoom, sleInt32, VER(48)), + MKLINE(SpriteInfo, delayCount, sleInt32, VER(48)), + MKLINE(SpriteInfo, curAngle, sleInt32, VER(48)), + MKLINE(SpriteInfo, curZoom, sleInt32, VER(48)), + MKLINE(SpriteInfo, imgFlags, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_74, sleInt32, VER(48)), + MKLINE(SpriteInfo, delayAmount, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_7C, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_80, sleInt32, VER(48)), + MKLINE(SpriteInfo, classFlags, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_88, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_8C, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_90, sleInt32, VER(48)), + MKLINE(SpriteInfo, field_94, sleInt32, VER(48)), + MKEND() + }; + + static const SaveLoadEntry spriteGroupEntries[] = { + MKLINE(SpriteGroup, bbox.left, sleInt32, VER(48)), + MKLINE(SpriteGroup, bbox.top, sleInt32, VER(48)), + MKLINE(SpriteGroup, bbox.right, sleInt32, VER(48)), + MKLINE(SpriteGroup, bbox.bottom, sleInt32, VER(48)), + MKLINE(SpriteGroup, zorderPriority, sleInt32, VER(48)), + MKLINE(SpriteGroup, flags, sleInt32, VER(48)), + MKLINE(SpriteGroup, tx, sleInt32, VER(48)), + MKLINE(SpriteGroup, ty, sleInt32, VER(48)), + MKLINE(SpriteGroup, dstResNum, sleInt32, VER(48)), + MKLINE(SpriteGroup, scaling, sleInt32, VER(48)), + MKLINE(SpriteGroup, scaleX, sleInt32, VER(48)), + MKLINE(SpriteGroup, scaleY, sleInt32, VER(48)), + MKLINE(SpriteGroup, scale_x_ratio_mul, sleInt32, VER(48)), + MKLINE(SpriteGroup, scale_x_ratio_div, sleInt32, VER(48)), + MKLINE(SpriteGroup, scale_y_ratio_mul, sleInt32, VER(48)), + MKLINE(SpriteGroup, scale_y_ratio_div, sleInt32, VER(48)), + MKEND() + }; + + s->saveLoadArrayOf(_activeSpritesTable, _varNumSprites, sizeof(_activeSpritesTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteTable, _varNumSprites, sizeof(_spriteTable[0]), spriteEntries); + s->saveLoadArrayOf(_spriteGroups, _varNumSpriteGroups, sizeof(_spriteGroups[0]), spriteGroupEntries); +} + } // End of namespace Scumm diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h index de6f35481b..5bd5060af9 100644 --- a/scumm/sprite_he.h +++ b/scumm/sprite_he.h @@ -81,6 +81,7 @@ struct SpriteInfo { int field_88; int field_8C; int field_90; + int field_94; }; struct SpriteGroup { |