aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorEugene Sandulenko2016-05-14 15:58:21 +0200
committerEugene Sandulenko2016-05-14 15:58:21 +0200
commit6d941a359467363d1f1c9de78455e0655b612323 (patch)
treebcc341d179cee0eafbf315f2a8906405703310f2 /engines/scumm/he
parentcc6be145b74171d252e140e5436e99781a2d4fd9 (diff)
downloadscummvm-rg350-6d941a359467363d1f1c9de78455e0655b612323.tar.gz
scummvm-rg350-6d941a359467363d1f1c9de78455e0655b612323.tar.bz2
scummvm-rg350-6d941a359467363d1f1c9de78455e0655b612323.zip
SCUMM HE: Marked sprite subopcodes and better field names
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/script_v100he.cpp62
-rw-r--r--engines/scumm/he/sprite_he.cpp16
-rw-r--r--engines/scumm/he/sprite_he.h6
3 files changed, 42 insertions, 42 deletions
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 1ee46a20b3..59377024de 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -1781,14 +1781,14 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
byte subOp = fetchScriptByte();
switch (subOp) {
- case 0:
+ case 0: // SO_INIT
_curMaxSpriteId = pop();
_curSpriteId = pop();
if (_curSpriteId > _curMaxSpriteId)
SWAP(_curSpriteId, _curMaxSpriteId);
break;
- case 2:
+ case 2: // SO_ANGLE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1799,7 +1799,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteAngle(spriteId, args[0]);
break;
- case 3:
+ case 3: // SO_ANIMATION
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1810,7 +1810,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteFlagAutoAnim(spriteId, args[0]);
break;
- case 4:
+ case 4: // SO_ANIMATION_SPEED
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1821,7 +1821,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteAnimSpeed(spriteId, args[0]);
break;
- case 6:
+ case 6: // SO_AT
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -1833,7 +1833,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpritePosition(spriteId, args[0], args[1]);
break;
- case 7:
+ case 7: // SO_AT_IMAGE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1844,7 +1844,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteSourceImage(spriteId, args[0]);
break;
- case 16:
+ case 16: // SO_CLASS
n = getStackList(args, ARRAYSIZE(args));
if (_curSpriteId != 0 && _curMaxSpriteId != 0 && n != 0) {
int *p = &args[n - 1];
@@ -1867,7 +1867,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
} while (--n);
}
break;
- case 32:
+ case 32: // SO_ERASE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1878,7 +1878,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteFlagEraseType(spriteId, args[0]);
break;
- case 38:
+ case 38: // SO_GROUP
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1889,7 +1889,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteGroup(spriteId, args[0]);
break;
- case 40:
+ case 40: // SO_IMAGE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1900,7 +1900,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteImage(spriteId, args[0]);
break;
- case 48:
+ case 48: // SO_MASK
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1911,7 +1911,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteMaskImage(spriteId, args[0]);
break;
- case 49:
+ case 49: // SO_MOVE
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -1923,10 +1923,10 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->moveSprite(spriteId, args[0], args[1]);
break;
- case 52:
+ case 52: // SO_NAME
copyScriptString(string, sizeof(string));
break;
- case 53:
+ case 53: // SO_NEW
if (_curSpriteId > _curMaxSpriteId)
break;
spriteId = _curSpriteId;
@@ -1936,7 +1936,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->resetSprite(spriteId);
break;
- case 54:
+ case 54: // SO_NEW_GENERAL_PROPERTY
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -1948,7 +1948,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteGeneralProperty(spriteId, args[0], args[1]);
break;
- case 57:
+ case 57: // SO_PALETTE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1959,7 +1959,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpritePalette(spriteId, args[0]);
break;
- case 59:
+ case 59: // SO_PRIORITY
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -1970,7 +1970,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpritePriority(spriteId, args[0]);
break;
- case 60:
+ case 60: // SO_PROPERTY
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -2001,10 +2001,10 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
break;
}
break;
- case 61:
+ case 61: // SO_RESTART
_sprite->resetTables(true);
break;
- case 65:
+ case 65: // SO_SCALE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2015,7 +2015,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteScale(spriteId, args[0]);
break;
- case 70:
+ case 70: // SO_SHADOW
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2026,7 +2026,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteShadow(spriteId, args[0]);
break;
- case 73:
+ case 73: // SO_STATE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2037,7 +2037,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteImageState(spriteId, args[0]);
break;
- case 74:
+ case 74: // SO_STEP_DIST
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -2049,7 +2049,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteDist(spriteId, args[0], args[1]);
break;
- case 75:
+ case 75: // SO_STEP_DIST_X
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2062,7 +2062,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
_sprite->setSpriteDist(spriteId, args[0], tmp[1]);
}
break;
- case 76:
+ case 76: // SO_STEP_DIST_Y
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2075,7 +2075,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
_sprite->setSpriteDist(spriteId, tmp[0], args[0]);
}
break;
- case 82:
+ case 82: // SO_UPDATE
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2086,7 +2086,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteFlagUpdateType(spriteId, args[0]);
break;
- case 83:
+ case 83: // SO_VARIABLE
args[1] = pop();
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
@@ -2098,7 +2098,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
for (; spriteId <= _curMaxSpriteId; spriteId++)
_sprite->setSpriteUserValue(spriteId, args[0], args[1]);
break;
- case 88:
+ case 88: // SO_IMAGE_ZCLIP
args[0] = pop();
if (_curSpriteId > _curMaxSpriteId)
break;
@@ -2107,9 +2107,9 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
spriteId++;
for (; spriteId <= _curMaxSpriteId; spriteId++)
- _sprite->setSpriteField84(spriteId, args[0]);
+ _sprite->setSpriteZBuffer(spriteId, args[0]);
break;
- case 89:
+ case 89: // SO_NEVER_ZCLIP
if (_curSpriteId > _curMaxSpriteId)
break;
spriteId = _curSpriteId;
@@ -2117,7 +2117,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() {
spriteId++;
for (; spriteId <= _curMaxSpriteId; spriteId++)
- _sprite->setSpriteField84(spriteId, 0);
+ _sprite->setSpriteZBuffer(spriteId, 0);
break;
default:
error("o100_setSpriteInfo: Unknown case %d", subOp);
diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index b192fab233..4044d8a719 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -739,10 +739,10 @@ void Sprite::setSpriteResetClass(int spriteId) {
_spriteTable[spriteId].classFlags = 0;
}
-void Sprite::setSpriteField84(int spriteId, int value) {
+void Sprite::setSpriteZBuffer(int spriteId, int value) {
assertRange(1, spriteId, _varNumSprites, "sprite");
- _spriteTable[spriteId].field_84 = value;
+ _spriteTable[spriteId].zbufferImage = value;
}
void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) {
@@ -797,7 +797,7 @@ void Sprite::resetSprite(int spriteId) {
_spriteTable[spriteId].sourceImage = 0;
_spriteTable[spriteId].maskImage = 0;
_spriteTable[spriteId].priority = 0;
- _spriteTable[spriteId].field_84 = 0;
+ _spriteTable[spriteId].zbufferImage = 0;
_spriteTable[spriteId].imgFlags = 0;
_spriteTable[spriteId].conditionBits = 0;
@@ -816,7 +816,7 @@ void Sprite::setSpriteImage(int spriteId, int imageNum) {
origResWizStates = _spriteTable[spriteId].imageStateCount;
_spriteTable[spriteId].image = imageNum;
- _spriteTable[spriteId].field_74 = 0;
+ _spriteTable[spriteId].animIndex = 0;
_spriteTable[spriteId].imageState = 0;
if (_spriteTable[spriteId].image) {
@@ -1339,9 +1339,9 @@ void Sprite::processImages(bool arg) {
}
if (spr_flags & kSFRemapPalette)
wiz.img.flags |= kWIFRemapPalette;
- if (spi->field_84) {
+ if (spi->zbufferImage) {
wiz.processFlags |= 0x200000;
- wiz.img.zbuffer = spi->field_84;
+ wiz.img.zbuffer = spi->zbufferImage;
wiz.img.zorder = spi->priority;
}
if (spi->sourceImage) {
@@ -1419,11 +1419,11 @@ void Sprite::saveOrLoadSpriteData(Serializer *s) {
MKLINE(SpriteInfo, curAngle, sleInt32, VER(48)),
MKLINE(SpriteInfo, curScale, sleInt32, VER(48)),
MKLINE(SpriteInfo, curImgFlags, sleInt32, VER(48)),
- MKLINE(SpriteInfo, field_74, sleInt32, VER(48)),
+ MKLINE(SpriteInfo, animIndex, sleInt32, VER(48)),
MKLINE(SpriteInfo, animSpeed, sleInt32, VER(48)),
MKLINE(SpriteInfo, sourceImage, sleInt32, VER(48)),
MKLINE(SpriteInfo, maskImage, sleInt32, VER(48)),
- MKLINE(SpriteInfo, field_84, sleInt32, VER(48)),
+ MKLINE(SpriteInfo, zbufferImage, sleInt32, VER(48)),
MKLINE(SpriteInfo, classFlags, sleInt32, VER(48)),
MKLINE(SpriteInfo, imgFlags, sleInt32, VER(48)),
MKLINE(SpriteInfo, conditionBits, sleInt32, VER(48)),
diff --git a/engines/scumm/he/sprite_he.h b/engines/scumm/he/sprite_he.h
index b1a7641fcc..3ea6bb9f84 100644
--- a/engines/scumm/he/sprite_he.h
+++ b/engines/scumm/he/sprite_he.h
@@ -72,11 +72,11 @@ struct SpriteInfo {
int32 curAngle;
int32 curScale;
int32 curImgFlags;
- int32 field_74;
+ int32 animIndex;
int32 animSpeed;
int32 sourceImage;
int32 maskImage;
- int32 field_84;
+ int32 zbufferImage;
int32 classFlags;
int32 imgFlags;
int32 conditionBits;
@@ -182,7 +182,7 @@ public:
void setSpriteAnimSpeed(int spriteId, int value);
void setSpriteSetClass(int spriteId, int classId, int toggle);
void setSpriteResetClass(int spriteId);
- void setSpriteField84(int spriteId, int value);
+ void setSpriteZBuffer(int spriteId, int value);
void setSpriteGeneralProperty(int spriteId, int type, int value);
void moveGroupMembers(int spriteGroupId, int value1, int value2);