mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 08:55:45 +00:00
load/save sprite data in HE90+ games.
svn-id: r17459
This commit is contained in:
parent
c30dd3e9aa
commit
dbc4d13b3d
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -81,6 +81,7 @@ struct SpriteInfo {
|
||||
int field_88;
|
||||
int field_8C;
|
||||
int field_90;
|
||||
int field_94;
|
||||
};
|
||||
|
||||
struct SpriteGroup {
|
||||
|
Loading…
x
Reference in New Issue
Block a user