diff options
author | Travis Howell | 2005-06-05 08:02:50 +0000 |
---|---|---|
committer | Travis Howell | 2005-06-05 08:02:50 +0000 |
commit | b452ee87e78269d4560e11845f042663a7c1b669 (patch) | |
tree | 2796e3b91e031d7378ef59d8acb5c74535536111 /scumm | |
parent | 065ffeaf853fcb4633ba143e1cbf60f6d72b2aba (diff) | |
download | scummvm-rg350-b452ee87e78269d4560e11845f042663a7c1b669.tar.gz scummvm-rg350-b452ee87e78269d4560e11845f042663a7c1b669.tar.bz2 scummvm-rg350-b452ee87e78269d4560e11845f042663a7c1b669.zip |
Rename sprite functions, based on map.
svn-id: r18349
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 180 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 196 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 541 | ||||
-rw-r--r-- | scumm/sprite_he.h | 160 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 84 | ||||
-rw-r--r-- | scumm/wiz_he.h | 22 |
7 files changed, 592 insertions, 593 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index d911505582..a90d4e0b09 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -1125,7 +1125,7 @@ protected: void sortArray(int array, int dim2start, int dim2end, int dim1start, int dim1end, int sortOrder); public: - int getGroupallocateGroupSpritesList(int spriteGroupId); + int getGroupSpriteArray(int spriteGroupId); protected: uint8 *getHEPaletteIndex(int palSlot); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index 4a04141113..4a40bb1f10 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -884,7 +884,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGrouptx_ty(_curSpriteGroupId, value1, value2); + _sprite->moveGroup(_curSpriteGroupId, value1, value2); break; case 18: value4 = pop(); @@ -894,7 +894,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupbbox(_curSpriteGroupId, value1, value2, value3, value4); + _sprite->setGroupBounds(_curSpriteGroupId, value1, value2, value3, value4); break; case 38: type = pop() - 1; @@ -905,55 +905,55 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_0(_curSpriteGroupId, value1, value2); + _sprite->moveGroupMembers(_curSpriteGroupId, value1, value2); break; case 1: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_1(_curSpriteGroupId, value1); + _sprite->setGroupMembersPriority(_curSpriteGroupId, value1); break; case 2: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_2(_curSpriteGroupId, value1); + _sprite->setGroupMembersGroup(_curSpriteGroupId, value1); break; case 3: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_3(_curSpriteGroupId, value1); + _sprite->setGroupMembersUpdateType(_curSpriteGroupId, value1); break; case 4: if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_4(_curSpriteGroupId); + _sprite->setGroupMembersResetSprite(_curSpriteGroupId); break; case 5: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_5(_curSpriteGroupId, value1); + _sprite->setGroupMembersAnimationSpeed(_curSpriteGroupId, value1); break; case 6: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_6(_curSpriteGroupId, value1); + _sprite->setGroupMembersAutoAnimFlag(_curSpriteGroupId, value1); break; case 7: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_7(_curSpriteGroupId, value1); + _sprite->setGroupMembersShadow(_curSpriteGroupId, value1); break; default: error("o100_setSpriteGroupInfo subOp 38: Unknown case %d", subOp); @@ -964,7 +964,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupdstResNum(_curSpriteGroupId, value1); + _sprite->setGroupImage(_curSpriteGroupId, value1); break; case 49: value2 = pop(); @@ -993,7 +993,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupzorderPriority(_curSpriteGroupId, value1); + _sprite->setGroupPriority(_curSpriteGroupId, value1); break; case 60: type = pop(); @@ -1022,7 +1022,7 @@ void ScummEngine_v100he::o100_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupflagClipBoxAnd(_curSpriteGroupId); + _sprite->resetGroupBounds(_curSpriteGroupId); break; default: error("o100_setSpriteGroupInfo: Unknown case %d", subOp); @@ -1137,7 +1137,7 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.field_184 = 0; _wizParams.field_180 = 0; _wizParams.spriteId = 0; - _wizParams.groupNum = 0; + _wizParams.spriteGroup = 0; break; case 2: _wizParams.processFlags |= kWPFRotate; @@ -1151,7 +1151,7 @@ void ScummEngine_v100he::o100_wizImageOps() { break; case 7: _wizParams.processFlags |= kWPFMaskImg; - _wizParams.maskImgResNum = pop(); + _wizParams.sourceImage = pop(); break; case 11: _wizParams.processFlags |= kWPFClipBox | 0x100; @@ -1219,13 +1219,13 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.img.y1 = pop(); _wizParams.img.x1 = pop(); _wizParams.spriteId = 0; - _wizParams.groupNum = 0; + _wizParams.spriteGroup = 0; _wizParams.img.resNum = pop(); _wiz->displayWizImage(&_wizParams.img); break; case 57: _wizParams.processFlags |= kWPFPaletteNum; - _wizParams.img.paletteNum = pop(); + _wizParams.img.palette = pop(); break; case 58: _wizParams.processFlags |= 0x1000 | 0x100 | 0x2; @@ -1241,8 +1241,8 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.fileWriteMode = pop(); break; case 65: - _wizParams.processFlags |= kWPFZoom; - _wizParams.zoom = pop(); + _wizParams.processFlags |= kWPFScaled; + _wizParams.scale = pop(); break; case 67: _wizParams.processFlags |= kWPFNewFlags; @@ -1254,8 +1254,8 @@ void ScummEngine_v100he::o100_wizImageOps() { _wizParams.field_164 = _wizParams.img.y1 = _wizParams.img.x1 = pop(); break; case 70: - _wizParams.processFlags |= kWPFXmapNum; - _wizParams.xmapNum = pop(); + _wizParams.processFlags |= kWPFShadow; + _wizParams.shadow = pop(); break; case 73: _wizParams.processFlags |= kWPFNewState; @@ -1726,7 +1726,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagDelayed(spriteId, args[0]); + _sprite->setSpriteFlagAutoAnim(spriteId, args[0]); break; case 4: args[0] = pop(); @@ -1737,7 +1737,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteDelay(spriteId, args[0]); + _sprite->setSpriteAnimSpeed(spriteId, args[0]); break; case 6: args[1] = pop(); @@ -1749,7 +1749,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritetx_ty(spriteId, args[0], args[1]); + _sprite->setSpritePosition(spriteId, args[0], args[1]); break; case 7: args[0] = pop(); @@ -1760,7 +1760,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteMaskImgResNum(spriteId, args[0]); + _sprite->setSpriteSourceImage(spriteId, args[0]); break; case 16: n = getStackList(args, ARRAYSIZE(args)); @@ -1770,15 +1770,15 @@ void ScummEngine_v100he::o100_setSpriteInfo() { int code = *p; if (code == 0) { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteResetClassFlags(i); + _sprite->setSpriteResetClass(i); } } else if (code & 0x80) { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteSetClassFlag(i, code & 0x7F, 1); + _sprite->setSpriteSetClass(i, code & 0x7F, 1); } } else { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteSetClassFlag(i, code & 0x7F, 0); + _sprite->setSpriteSetClass(i, code & 0x7F, 0); } } --p; @@ -1794,7 +1794,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagHasImage(spriteId, args[0]); + _sprite->setSpriteFlagEraseType(spriteId, args[0]); break; case 38: args[0] = pop(); @@ -1805,7 +1805,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteGroupNum(spriteId, args[0]); + _sprite->setSpriteGroup(spriteId, args[0]); break; case 40: args[0] = pop(); @@ -1816,7 +1816,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->addImageToList(spriteId, 1, &args[0]); + _sprite->setSpriteImage(spriteId, args[0]); break; case 48: args[0] = pop(); @@ -1827,7 +1827,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField80(spriteId, args[0]); + _sprite->setSpriteMaskImage(spriteId, args[0]); break; case 49: args[1] = pop(); @@ -1839,7 +1839,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteInc_tx_ty(spriteId, args[0], args[1]); + _sprite->moveSprite(spriteId, args[0], args[1]); break; case 52: copyScriptString(string, sizeof(string)); @@ -1852,7 +1852,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteResetSprite(spriteId); + _sprite->resetSprite(spriteId); break; case 54: args[1] = pop(); @@ -1864,7 +1864,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField8C_90(spriteId, args[0], args[1]); + _sprite->setSpriteGeneralProperty(spriteId, args[0], args[1]); break; case 57: args[0] = pop(); @@ -1875,7 +1875,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritePaletteNum(spriteId, args[0]); + _sprite->setSpritePalette(spriteId, args[0]); break; case 59: args[0] = pop(); @@ -1886,7 +1886,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteZorderPriority(spriteId, args[0]); + _sprite->setSpritePriority(spriteId, args[0]); break; case 60: args[1] = pop(); @@ -1912,7 +1912,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { _sprite->setSpriteFlagDoubleBuffered(spriteId, args[0]); break; case 4: - _sprite->setSpriteFlagNeedPaletteRemap(spriteId, args[0]); + _sprite->setSpriteFlagRemapPalette(spriteId, args[0]); break; default: break; @@ -1930,7 +1930,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteZoom(spriteId, args[0]); + _sprite->setSpriteScale(spriteId, args[0]); break; case 70: args[0] = pop(); @@ -1941,7 +1941,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteXmapNum(spriteId, args[0]); + _sprite->setSpriteShadow(spriteId, args[0]); break; case 73: args[0] = pop(); @@ -1952,7 +1952,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteResState(spriteId, args[0]); + _sprite->setSpriteImageState(spriteId, args[0]); break; case 74: args[1] = pop(); @@ -1964,7 +1964,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritedx_dy(spriteId, args[0], args[1]); + _sprite->setSpriteDist(spriteId, args[0], args[1]); break; case 75: args[0] = pop(); @@ -1975,8 +1975,8 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) { - _sprite->getSpritedx_dy(spriteId, tmp[0], tmp[1]); - _sprite->setSpritedx_dy(spriteId, args[0], tmp[1]); + _sprite->getSpriteDist(spriteId, tmp[0], tmp[1]); + _sprite->setSpriteDist(spriteId, args[0], tmp[1]); } break; case 76: @@ -1988,8 +1988,8 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) { - _sprite->getSpritedx_dy(spriteId, tmp[0], tmp[1]); - _sprite->setSpritedx_dy(spriteId, tmp[0], args[0]); + _sprite->getSpriteDist(spriteId, tmp[0], tmp[1]); + _sprite->setSpriteDist(spriteId, tmp[0], args[0]); } break; case 82: @@ -2001,7 +2001,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagMarkDirty(spriteId, args[0]); + _sprite->setSpriteFlagUpdateType(spriteId, args[0]); break; case 83: args[1] = pop(); @@ -2013,7 +2013,7 @@ void ScummEngine_v100he::o100_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField44(spriteId, args[0], args[1]); + _sprite->setSpriteUserValue(spriteId, args[0], args[1]); break; case 88: args[0] = pop(); @@ -2286,14 +2286,14 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { case 5: spriteGroupId = pop(); if (spriteGroupId) - push(getGroupallocateGroupSpritesList(spriteGroupId)); + push(getGroupSpriteArray(spriteGroupId)); else push(0); break; case 40: spriteGroupId = pop(); if (spriteGroupId) - push(_sprite->getGroupdstResNum(spriteGroupId)); + push(_sprite->getGroupDstResNum(spriteGroupId)); else push(0); break; @@ -2306,7 +2306,7 @@ void ScummEngine_v100he::o100_getSpriteGroupInfo() { case 59: spriteGroupId = pop(); if (spriteGroupId) - push(_sprite->getGroupzorderPriority(spriteGroupId)); + push(_sprite->getGroupPriority(spriteGroupId)); else push(0); break; @@ -2526,8 +2526,8 @@ void ScummEngine_v100he::o100_readFile() { void ScummEngine_v100he::o100_getSpriteInfo() { int args[16]; - int spriteId, flags, c, d, e, f; - int32 a, b; + int spriteId, flags, groupId, type; + int32 x, y; byte subOp = fetchScriptByte(); @@ -2536,21 +2536,21 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 3: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagDelayed(spriteId)); + push(_sprite->getSpriteFlagAutoAnim(spriteId)); else push(0); break; case 4: spriteId = pop(); if (spriteId) - push(_sprite->getSpritedelayAmount(spriteId)); + push(_sprite->getSpriteAnimSpeed(spriteId)); else push(1); break; case 7: spriteId = pop(); if (spriteId) - push(_sprite->getSpritemaskImgResNum(spriteId)); + push(_sprite->getSpriteSourceImage(spriteId)); else push(0); break; @@ -2558,7 +2558,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() { flags = getStackList(args, ARRAYSIZE(args)); spriteId = pop(); if (spriteId) { - push(_sprite->getSpriteclassFlags(spriteId, flags, args)); + push(_sprite->getSpriteClass(spriteId, flags, args)); } else { push(0); } @@ -2566,51 +2566,51 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 26: spriteId = pop(); if (spriteId) - push(_sprite->getSpritewizSize(spriteId)); + push(_sprite->getSpriteImageStateCount(spriteId)); else push(0); break; case 30: spriteId = pop(); if (spriteId) - push(_sprite->getSpritegrp_tx(spriteId)); + push(_sprite->getSpriteDisplayX(spriteId)); else push(0); break; case 31: spriteId = pop(); if (spriteId) - push(_sprite->getSpritegrp_ty(spriteId)); + push(_sprite->getSpriteDisplayY(spriteId)); else push(0); break; case 32: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagHasImage(spriteId)); + push(_sprite->getSpriteFlagEraseType(spriteId)); else push(1); break; case 33: flags = getStackList(args, ARRAYSIZE(args)); - c = pop(); - d = pop(); - e = pop(); - f = pop(); - push(_sprite->findSpriteWithClassOf(f, e, d, c, flags, args)); + type = pop(); + groupId = pop(); + y = pop(); + x = pop(); + push(_sprite->findSpriteWithClassOf(x, y, groupId, type, flags, args)); break; case 38: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteGroupNum(spriteId)); + push(_sprite->getSpriteGroup(spriteId)); else push(0); break; case 39: spriteId = pop(); if (spriteId) { - _sprite->getSpriteImageDim(spriteId, a, b); - push(b); + _sprite->getSpriteImageDim(spriteId, x, y); + push(y); } else { push(0); } @@ -2618,14 +2618,14 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 40: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteResId(spriteId)); + push(_sprite->getSpriteImage(spriteId)); else push(0); break; case 48: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_80(spriteId)); + push(_sprite->getSpriteMaskImage(spriteId)); else push(0); break; @@ -2633,21 +2633,21 @@ void ScummEngine_v100he::o100_getSpriteInfo() { flags = pop(); spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_8C_90(spriteId, flags)); + push(_sprite->getSpriteGeneralProperty(spriteId, flags)); else push(0); break; case 57: spriteId = pop(); if (spriteId) - push(_sprite->getSpritePaletteNum(spriteId)); + push(_sprite->getSpritePalette(spriteId)); else push(0); break; case 59: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteZorderPriority(spriteId)); + push(_sprite->getSpritePriority(spriteId)); else push(0); break; @@ -2669,7 +2669,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() { push(_sprite->getSpriteFlagDoubleBuffered(spriteId)); break; case 4: - push(_sprite->getSpriteFlagNeedPaletteRemap(spriteId)); + push(_sprite->getSpriteFlagRemapPalette(spriteId)); break; default: push(0); @@ -2681,29 +2681,29 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 65: spriteId = pop(); if (spriteId) - push(_sprite->getSpritezoom(spriteId)); + push(_sprite->getSpriteScale(spriteId)); else push(0); break; case 70: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteXmapNum(spriteId)); + push(_sprite->getSpriteShadow(spriteId)); else push(0); break; case 73: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteResState(spriteId)); + push(_sprite->getSpriteImageState(spriteId)); else push(0); break; case 75: spriteId = pop(); if (spriteId) { - _sprite->getSpritedx_dy(spriteId, a, b); - push(a); + _sprite->getSpriteDist(spriteId, x, y); + push(x); } else { push(0); } @@ -2711,8 +2711,8 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 76: spriteId = pop(); if (spriteId) { - _sprite->getSpritedx_dy(spriteId, a, b); - push(b); + _sprite->getSpriteDist(spriteId, x, y); + push(y); } else { push(0); } @@ -2720,7 +2720,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 82: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagMarkDirty(spriteId)); + push(_sprite->getSpriteFlagUpdateType(spriteId)); else push(0); break; @@ -2728,15 +2728,15 @@ void ScummEngine_v100he::o100_getSpriteInfo() { pop(); spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_44(spriteId)); + push(_sprite->getSpriteUserValue(spriteId)); else push(0); break; case 84: spriteId = pop(); if (spriteId) { - _sprite->getSpriteImageDim(spriteId, a, b); - push(a); + _sprite->getSpriteImageDim(spriteId, x, y); + push(x); } else { push(0); } @@ -2744,8 +2744,8 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 85: spriteId = pop(); if (spriteId) { - _sprite->getSpritetx_ty(spriteId, a, b); - push(a); + _sprite->getSpritePosition(spriteId, x, y); + push(x); } else { push(0); } @@ -2753,8 +2753,8 @@ void ScummEngine_v100he::o100_getSpriteInfo() { case 86: spriteId = pop(); if (spriteId) { - _sprite->getSpritetx_ty(spriteId, a, b); - push(b); + _sprite->getSpritePosition(spriteId, x, y); + push(y); } else { push(0); } diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 16eb808f4f..8c8720f7a7 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -650,11 +650,11 @@ void ScummEngine_v90he::o90_wizImageOps() { _wizParams.field_184 = 0; _wizParams.field_180 = 0; _wizParams.spriteId = 0; - _wizParams.groupNum = 0; + _wizParams.spriteGroup = 0; break; case 16: // HE99+ _wizParams.processFlags |= kWPFMaskImg; - _wizParams.maskImgResNum = pop(); + _wizParams.sourceImage = pop(); break; case 19: case 108: @@ -686,15 +686,15 @@ void ScummEngine_v90he::o90_wizImageOps() { break; case 40: // HE99+ _wizParams.processFlags |= kWPFPaletteNum; - _wizParams.img.paletteNum = pop(); + _wizParams.img.palette = pop(); break; case 46: - _wizParams.processFlags |= kWPFZoom; - _wizParams.zoom = pop(); + _wizParams.processFlags |= kWPFScaled; + _wizParams.scale = pop(); break; case 52: - _wizParams.processFlags |= kWPFXmapNum; - _wizParams.xmapNum = pop(); + _wizParams.processFlags |= kWPFShadow; + _wizParams.shadow = pop(); break; case 85: // HE99+ _wizParams.processFlags |= 0x1000 | 0x100 | 0x2; @@ -839,8 +839,8 @@ void ScummEngine_v90he::o90_getDistanceBetweenPoints() { void ScummEngine_v90he::o90_getSpriteInfo() { int args[16]; - int spriteId, flags, c, d, e, f; - int32 a, b; + int spriteId, flags, groupId, type; + int32 x, y; byte subOp = fetchScriptByte(); subOp -= 30; @@ -850,8 +850,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 0: spriteId = pop(); if (spriteId) { - _sprite->getSpritetx_ty(spriteId, a, b); - push(a); + _sprite->getSpritePosition(spriteId, x, y); + push(x); } else { push(0); } @@ -859,8 +859,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 1: spriteId = pop(); if (spriteId) { - _sprite->getSpritetx_ty(spriteId, a, b); - push(b); + _sprite->getSpritePosition(spriteId, x, y); + push(y); } else { push(0); } @@ -868,8 +868,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 2: spriteId = pop(); if (spriteId) { - _sprite->getSpriteImageDim(spriteId, a, b); - push(a); + _sprite->getSpriteImageDim(spriteId, x, y); + push(x); } else { push(0); } @@ -877,8 +877,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 3: spriteId = pop(); if (spriteId) { - _sprite->getSpriteImageDim(spriteId, a, b); - push(b); + _sprite->getSpriteImageDim(spriteId, x, y); + push(y); } else { push(0); } @@ -886,8 +886,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 4: spriteId = pop(); if (spriteId) { - _sprite->getSpritedx_dy(spriteId, a, b); - push(a); + _sprite->getSpriteDist(spriteId, x, y); + push(x); } else { push(0); } @@ -895,8 +895,8 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 5: spriteId = pop(); if (spriteId) { - _sprite->getSpritedx_dy(spriteId, a, b); - push(b); + _sprite->getSpriteDist(spriteId, x, y); + push(y); } else { push(0); } @@ -904,28 +904,28 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 6: spriteId = pop(); if (spriteId) - push(_sprite->getSpritewizSize(spriteId)); + push(_sprite->getSpriteImageStateCount(spriteId)); else push(0); break; case 7: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteGroupNum(spriteId)); + push(_sprite->getSpriteGroup(spriteId)); else push(0); break; case 8: spriteId = pop(); if (spriteId) - push(_sprite->getSpritegrp_tx(spriteId)); + push(_sprite->getSpriteDisplayX(spriteId)); else push(0); break; case 9: spriteId = pop(); if (spriteId) - push(_sprite->getSpritegrp_ty(spriteId)); + push(_sprite->getSpriteDisplayY(spriteId)); else push(0); break; @@ -947,7 +947,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { push(_sprite->getSpriteFlagDoubleBuffered(spriteId)); break; case 4: - push(_sprite->getSpriteFlagNeedPaletteRemap(spriteId)); + push(_sprite->getSpriteFlagRemapPalette(spriteId)); break; default: push(0); @@ -959,98 +959,98 @@ void ScummEngine_v90he::o90_getSpriteInfo() { case 13: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteZorderPriority(spriteId)); + push(_sprite->getSpritePriority(spriteId)); else push(0); break; case 15: if (_heversion == 99) { flags = getStackList(args, ARRAYSIZE(args)); - c = pop(); - d = pop(); - e = pop(); - f = pop(); - push(_sprite->findSpriteWithClassOf(f, e, d, c, flags, args)); + type = pop(); + groupId = pop(); + y = pop(); + x = pop(); + push(_sprite->findSpriteWithClassOf(x, y, groupId, type, flags, args)); } else if (_heversion == 98) { - c = pop(); - d = pop(); - e = pop(); - f = pop(); - push(_sprite->findSpriteWithClassOf(f, e, d, c, 0, 0)); + type = pop(); + groupId = pop(); + y = pop(); + x = pop(); + push(_sprite->findSpriteWithClassOf(x, y, groupId, type, 0, 0)); } else { - d = pop(); - e = pop(); - f = pop(); - push(_sprite->findSpriteWithClassOf(f, e, d, 0, 0, 0)); + groupId = pop(); + y = pop(); + x = pop(); + push(_sprite->findSpriteWithClassOf(x, y, groupId, 0, 0, 0)); } break; case 22: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteResState(spriteId)); + push(_sprite->getSpriteImageState(spriteId)); else push(0); break; case 32: spriteId = pop(); if (spriteId) - push(_sprite->getSpritemaskImgResNum(spriteId)); + push(_sprite->getSpriteSourceImage(spriteId)); else push(0); break; case 33: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteResId(spriteId)); + push(_sprite->getSpriteImage(spriteId)); else push(0); break; case 38: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagHasImage(spriteId)); + push(_sprite->getSpriteFlagEraseType(spriteId)); else push(1); break; case 52: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagDelayed(spriteId)); + push(_sprite->getSpriteFlagAutoAnim(spriteId)); else push(0); break; case 56: spriteId = pop(); if (spriteId) - push(_sprite->getSpritePaletteNum(spriteId)); + push(_sprite->getSpritePalette(spriteId)); else push(0); break; case 62: spriteId = pop(); if (spriteId) - push(_sprite->getSpritezoom(spriteId)); + push(_sprite->getSpriteScale(spriteId)); else push(0); break; case 67: spriteId = pop(); if (spriteId) - push(_sprite->getSpritedelayAmount(spriteId)); + push(_sprite->getSpriteAnimSpeed(spriteId)); else push(1); break; case 68: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteXmapNum(spriteId)); + push(_sprite->getSpriteShadow(spriteId)); else push(0); break; case 94: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteFlagMarkDirty(spriteId)); + push(_sprite->getSpriteFlagUpdateType(spriteId)); else push(0); break; @@ -1058,7 +1058,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { flags = getStackList(args, ARRAYSIZE(args)); spriteId = pop(); if (spriteId) { - push(_sprite->getSpriteclassFlags(spriteId, flags, args)); + push(_sprite->getSpriteClass(spriteId, flags, args)); } else { push(0); } @@ -1067,14 +1067,14 @@ void ScummEngine_v90he::o90_getSpriteInfo() { flags = pop(); spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_8C_90(spriteId, flags)); + push(_sprite->getSpriteGeneralProperty(spriteId, flags)); else push(0); break; case 110: spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_80(spriteId)); + push(_sprite->getSpriteMaskImage(spriteId)); else push(0); break; @@ -1082,7 +1082,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { pop(); spriteId = pop(); if (spriteId) - push(_sprite->getSpriteField_44(spriteId)); + push(_sprite->getSpriteUserValue(spriteId)); else push(0); break; @@ -1111,8 +1111,8 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) { - _sprite->getSpritedx_dy(spriteId, tmp[0], tmp[1]); - _sprite->setSpritedx_dy(spriteId, args[0], tmp[1]); + _sprite->getSpriteDist(spriteId, tmp[0], tmp[1]); + _sprite->setSpriteDist(spriteId, args[0], tmp[1]); } break; case 1: @@ -1124,8 +1124,8 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) { - _sprite->getSpritedx_dy(spriteId, tmp[0], tmp[1]); - _sprite->setSpritedx_dy(spriteId, tmp[0], args[0]); + _sprite->getSpriteDist(spriteId, tmp[0], tmp[1]); + _sprite->setSpriteDist(spriteId, tmp[0], args[0]); } break; case 3: @@ -1137,7 +1137,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteGroupNum(spriteId, args[0]); + _sprite->setSpriteGroup(spriteId, args[0]); break; case 8: args[1] = pop(); @@ -1163,7 +1163,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { _sprite->setSpriteFlagDoubleBuffered(spriteId, args[0]); break; case 4: - _sprite->setSpriteFlagNeedPaletteRemap(spriteId, args[0]); + _sprite->setSpriteFlagRemapPalette(spriteId, args[0]); break; default: break; @@ -1178,7 +1178,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteZorderPriority(spriteId, args[0]); + _sprite->setSpritePriority(spriteId, args[0]); break; case 10: args[1] = pop(); @@ -1190,7 +1190,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteInc_tx_ty(spriteId, args[0], args[1]); + _sprite->moveSprite(spriteId, args[0], args[1]); break; case 18: args[0] = pop(); @@ -1201,7 +1201,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteResState(spriteId, args[0]); + _sprite->setSpriteImageState(spriteId, args[0]); break; case 19: args[0] = pop(); @@ -1235,7 +1235,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteMaskImgResNum(spriteId, args[0]); + _sprite->setSpriteSourceImage(spriteId, args[0]); break; case 29: args[0] = pop(); @@ -1246,7 +1246,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->addImageToList(spriteId, 1, &args[0]); + _sprite->setSpriteImage(spriteId, args[0]); break; case 31: args[1] = pop(); @@ -1258,7 +1258,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritetx_ty(spriteId, args[0], args[1]); + _sprite->setSpritePosition(spriteId, args[0], args[1]); break; case 34: args[0] = pop(); @@ -1269,7 +1269,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagHasImage(spriteId, args[0]); + _sprite->setSpriteFlagEraseType(spriteId, args[0]); break; case 43: args[1] = pop(); @@ -1281,7 +1281,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritedx_dy(spriteId, args[0], args[1]); + _sprite->setSpriteDist(spriteId, args[0], args[1]); break; case 48: args[0] = pop(); @@ -1292,7 +1292,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagDelayed(spriteId, args[0]); + _sprite->setSpriteFlagAutoAnim(spriteId, args[0]); break; case 52: // HE 98+ args[0] = pop(); @@ -1303,7 +1303,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpritePaletteNum(spriteId, args[0]); + _sprite->setSpritePalette(spriteId, args[0]); break; case 58: // HE 99+ args[0] = pop(); @@ -1314,7 +1314,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteZoom(spriteId, args[0]); + _sprite->setSpriteScale(spriteId, args[0]); break; case 63: // HE 98+ args[0] = pop(); @@ -1325,7 +1325,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteDelay(spriteId, args[0]); + _sprite->setSpriteAnimSpeed(spriteId, args[0]); break; case 64: args[0] = pop(); @@ -1336,7 +1336,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteXmapNum(spriteId, args[0]); + _sprite->setSpriteShadow(spriteId, args[0]); break; case 90: args[0] = pop(); @@ -1347,7 +1347,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteFlagMarkDirty(spriteId, args[0]); + _sprite->setSpriteFlagUpdateType(spriteId, args[0]); break; case 91: n = getStackList(args, ARRAYSIZE(args)); @@ -1357,15 +1357,15 @@ void ScummEngine_v90he::o90_setSpriteInfo() { int code = *p; if (code == 0) { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteResetClassFlags(i); + _sprite->setSpriteResetClass(i); } } else if (code & 0x80) { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteSetClassFlag(i, code & 0x7F, 1); + _sprite->setSpriteSetClass(i, code & 0x7F, 1); } } else { for (int i = _curSpriteId; i <= _curMaxSpriteId; ++i) { - _sprite->setSpriteSetClassFlag(i, code & 0x7F, 0); + _sprite->setSpriteSetClass(i, code & 0x7F, 0); } } --p; @@ -1382,7 +1382,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField8C_90(spriteId, args[0], args[1]); + _sprite->setSpriteGeneralProperty(spriteId, args[0], args[1]); break; case 106: // HE 99+ args[0] = pop(); @@ -1393,7 +1393,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField80(spriteId, args[0]); + _sprite->setSpriteMaskImage(spriteId, args[0]); break; case 124: _sprite->resetTables(true); @@ -1408,7 +1408,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteField44(spriteId, args[0], args[1]); + _sprite->setSpriteUserValue(spriteId, args[0], args[1]); break; case 183: if (_curSpriteId > _curMaxSpriteId) @@ -1418,7 +1418,7 @@ void ScummEngine_v90he::o90_setSpriteInfo() { spriteId++; for (; spriteId <= _curMaxSpriteId; spriteId++) - _sprite->setSpriteResetSprite(spriteId); + _sprite->resetSprite(spriteId); break; default: error("o90_setSpriteInfo: Unknown case %d", subOp); @@ -1436,7 +1436,7 @@ void ScummEngine_v90he::o90_getSpriteGroupInfo() { case 8: // HE 99+ spriteGroupId = pop(); if (spriteGroupId) - push(getGroupallocateGroupSpritesList(spriteGroupId)); + push(getGroupSpriteArray(spriteGroupId)); else push(0); break; @@ -1485,14 +1485,14 @@ void ScummEngine_v90he::o90_getSpriteGroupInfo() { case 43: spriteGroupId = pop(); if (spriteGroupId) - push(_sprite->getGroupzorderPriority(spriteGroupId)); + push(_sprite->getGroupPriority(spriteGroupId)); else push(0); break; case 63: // HE 99+ spriteGroupId = pop(); if (spriteGroupId) - push(_sprite->getGroupdstResNum(spriteGroupId)); + push(_sprite->getGroupDstResNum(spriteGroupId)); else push(0); break; @@ -1524,55 +1524,55 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_0(_curSpriteGroupId, value1, value2); + _sprite->moveGroupMembers(_curSpriteGroupId, value1, value2); break; case 1: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_1(_curSpriteGroupId, value1); + _sprite->setGroupMembersPriority(_curSpriteGroupId, value1); break; case 2: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_2(_curSpriteGroupId, value1); + _sprite->setGroupMembersGroup(_curSpriteGroupId, value1); break; case 3: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_3(_curSpriteGroupId, value1); + _sprite->setGroupMembersUpdateType(_curSpriteGroupId, value1); break; case 4: if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_4(_curSpriteGroupId); + _sprite->setGroupMembersResetSprite(_curSpriteGroupId); break; case 5: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_5(_curSpriteGroupId, value1); + _sprite->setGroupMembersAnimationSpeed(_curSpriteGroupId, value1); break; case 6: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_6(_curSpriteGroupId, value1); + _sprite->setGroupMembersAutoAnimFlag(_curSpriteGroupId, value1); break; case 7: value1 = pop(); if (!_curSpriteGroupId) break; - _sprite->setGroupCase0_7(_curSpriteGroupId, value1); + _sprite->setGroupMembersShadow(_curSpriteGroupId, value1); break; default: error("o90_setSpriteGroupInfo subOp 0: Unknown case %d", subOp); @@ -1606,7 +1606,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupzorderPriority(_curSpriteGroupId, value1); + _sprite->setGroupPriority(_curSpriteGroupId, value1); break; case 7: value2 = pop(); @@ -1624,7 +1624,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupdstResNum(_curSpriteGroupId, value1); + _sprite->setGroupImage(_curSpriteGroupId, value1); break; case 28: value2 = pop(); @@ -1632,7 +1632,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGrouptx_ty(_curSpriteGroupId, value1, value2); + _sprite->moveGroup(_curSpriteGroupId, value1, value2); break; case 30: value4 = pop(); @@ -1642,13 +1642,13 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { if (!_curSpriteGroupId) break; - _sprite->setGroupbbox(_curSpriteGroupId, value1, value2, value3, value4); + _sprite->setGroupBounds(_curSpriteGroupId, value1, value2, value3, value4); break; case 56: if (!_curSpriteGroupId) break; - _sprite->setGroupflagClipBoxAnd(_curSpriteGroupId); + _sprite->resetGroupBounds(_curSpriteGroupId); break; case 180: if (!_curSpriteGroupId) diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index ef04f427af..0af4dd904b 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -44,14 +44,14 @@ void ScummEngine_v90he::allocateArrays() { void Sprite::getSpriteBounds(int spriteId, bool checkGroup, Common::Rect &bound) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); int16 spr_wiz_x, spr_wiz_y; - int angle, zoom, x1, y1; + int angle, scale, x1, y1; int32 w, h; SpriteInfo *spi = &_spriteTable[spriteId]; - _vm->_wiz->loadImgSpot(spi->resId, spi->resState, spr_wiz_x, spr_wiz_y); - if (checkGroup && spi->groupNum) { - SpriteGroup *spg = &_spriteGroups[spi->groupNum]; + _vm->_wiz->loadImgSpot(spi->image, spi->imageState, spr_wiz_x, spr_wiz_y); + if (checkGroup && spi->group) { + SpriteGroup *spg = &_spriteGroups[spi->group]; if (spg->scaling) { x1 = spi->tx * spg->scale_x_ratio_mul / spg->scale_x_ratio_div - spr_wiz_x + spg->tx; @@ -65,11 +65,11 @@ void Sprite::getSpriteBounds(int spriteId, bool checkGroup, Common::Rect &bound) y1 = spi->ty - spr_wiz_y; } - if (spi->resId) { + if (spi->image) { angle = spi->angle; - zoom = spi->zoom; - _vm->_wiz->getWizImageDim(spi->resId, spi->resState, w, h); - if (!(spi->flags & (kSFZoomed | kSFRotated))) { + scale = spi->scale; + _vm->_wiz->getWizImageDim(spi->image, spi->imageState, w, h); + if (!(spi->flags & (kSFScaled | kSFRotated))) { bound.left = x1; bound.top = y1; bound.right = x1 + w; @@ -81,10 +81,10 @@ void Sprite::getSpriteBounds(int spriteId, bool checkGroup, Common::Rect &bound) pts[0].x = pts[0].y = pts[1].y = pts[3].x = -w / 2; pts[2].y = pts[3].y = h / 2 - 1; - if ((spi->flags & kSFZoomed) && zoom) { + if ((spi->flags & kSFScaled) && scale) { for (int j = 0; j < 4; ++j) { - pts[j].x = pts[j].x * zoom / 256; - pts[j].y = pts[j].y * zoom / 256; + pts[j].x = pts[j].x * scale / 256; + pts[j].y = pts[j].y * scale / 256; } } if ((spi->flags & kSFRotated) && angle) @@ -115,10 +115,10 @@ int Sprite::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int t for (int i = (_numSpritesToProcess - 1); i >= 0; i--) { SpriteInfo *spi = _activeSpritesTable[i]; - if (!spi->curResId) + if (!spi->curImage) continue; - if (spriteGroupId && spi->groupNum != spriteGroupId) + if (spriteGroupId && spi->group != spriteGroupId) continue; cond = true; @@ -152,20 +152,20 @@ int Sprite::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int t continue; return spi->id; } else { - int resId, resState, angle, zoom; + int image, imageState, angle, scale; int32 w, h; - resId = spi->curResId; - if (spi->field_80) { + image = spi->curImage; + if (spi->maskImage) { int16 x1, x2, y1, y2; - resState = spi->curImageState % _vm->_wiz->getWizImageStates(spi->field_80); + imageState = spi->curImageState % _vm->_wiz->getWizImageStates(spi->maskImage); x = x_pos - spi->pos.x; y = y_pos - spi->pos.y; - _vm->_wiz->loadImgSpot(spi->curResId, resState, x1, y1); - _vm->_wiz->loadImgSpot(spi->field_80, resState, x2, y2); + _vm->_wiz->loadImgSpot(spi->curImage, imageState, x1, y1); + _vm->_wiz->loadImgSpot(spi->maskImage, imageState, x2, y2); x += (x2 - x1); y += (y2 - y1); @@ -185,15 +185,15 @@ int Sprite::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int t x = x_pos - spi->pos.x; y = y_pos - spi->pos.y; - resState = spi->curImageState; + imageState = spi->curImageState; } angle = spi->curAngle; - zoom = spi->curZoom; - if ((spi->flags & kSFZoomed) || (spi->flags & kSFRotated)) { - if (spi->flags & kSFZoomed && zoom) { - x = x * 256 / zoom; - y = y * 256 / zoom; + scale = spi->curScale; + if ((spi->flags & kSFScaled) || (spi->flags & kSFRotated)) { + if (spi->flags & kSFScaled && scale) { + x = x * 256 / scale; + y = y * 256 / scale; } if (spi->flags & kSFRotated && angle) { angle = (360 - angle) % 360; @@ -201,12 +201,12 @@ int Sprite::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int t _vm->_wiz->polygonRotatePoints(pts, 1, angle); } - _vm->_wiz->getWizImageDim(resId, resState, w, h); + _vm->_wiz->getWizImageDim(image, imageState, w, h); x += w / 2; y += h / 2; } - if (_vm->_wiz->isWizPixelNonTransparent(resId, resState, x, y, spi->curImgFlags)) + if (_vm->_wiz->isWizPixelNonTransparent(image, imageState, x, y, spi->curImgFlags)) return spi->id; } } @@ -214,7 +214,7 @@ int Sprite::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int t return 0; } -int Sprite::getSpriteclassFlags(int spriteId, int num, int *args) { +int Sprite::getSpriteClass(int spriteId, int num, int *args) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); int code, classId; @@ -261,122 +261,122 @@ int Sprite::getSpriteFlagActive(int spriteId) { return ((_spriteTable[spriteId].flags & kSFActive) != 0) ? 1 : 0; } -int Sprite::getSpriteFlagNeedPaletteRemap(int spriteId) { +int Sprite::getSpriteFlagRemapPalette(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return ((_spriteTable[spriteId].flags & kSFNeedPaletteRemap) != 0) ? 1 : 0; + return ((_spriteTable[spriteId].flags & kSFRemapPalette) != 0) ? 1 : 0; } -int Sprite::getSpriteFlagDelayed(int spriteId) { +int Sprite::getSpriteFlagAutoAnim(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return ((_spriteTable[spriteId].flags & kSFDelayed) != 0) ? 1 : 0; + return ((_spriteTable[spriteId].flags & kSFAutoAnim) != 0) ? 1 : 0; } -int Sprite::getSpriteFlagMarkDirty(int spriteId) { +int Sprite::getSpriteFlagUpdateType(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); return ((_spriteTable[spriteId].flags & kSFMarkDirty) != 0) ? 1 : 0; } -int Sprite::getSpriteFlagHasImage(int spriteId) { +int Sprite::getSpriteFlagEraseType(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); return ((_spriteTable[spriteId].flags & kSFImageless) != 0) ? 1 : 0; } -int Sprite::getSpriteResId(int spriteId) { +int Sprite::getSpriteImage(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].resId; + return _spriteTable[spriteId].image; } -int Sprite::getSpriteResState(int spriteId) { +int Sprite::getSpriteImageState(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].resState; + return _spriteTable[spriteId].imageState; } -int Sprite::getSpriteGroupNum(int spriteId) { +int Sprite::getSpriteGroup(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].groupNum; + return _spriteTable[spriteId].group; } -int Sprite::getSpritePaletteNum(int spriteId) { +int Sprite::getSpritePalette(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].paletteNum; + return _spriteTable[spriteId].palette; } -int Sprite::getSpriteZorderPriority(int spriteId) { +int Sprite::getSpritePriority(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].zorderPriority; + return _spriteTable[spriteId].priority; } -int Sprite::getSpritegrp_tx(int spriteId) { +int Sprite::getSpriteDisplayX(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].groupNum) - return _spriteTable[spriteId].tx + _spriteGroups[_spriteTable[spriteId].groupNum].tx; + if (_spriteTable[spriteId].group) + return _spriteTable[spriteId].tx + _spriteGroups[_spriteTable[spriteId].group].tx; else return _spriteTable[spriteId].tx; } -int Sprite::getSpritegrp_ty(int spriteId) { +int Sprite::getSpriteDisplayY(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].groupNum) - return _spriteTable[spriteId].ty + _spriteGroups[_spriteTable[spriteId].groupNum].ty; + if (_spriteTable[spriteId].group) + return _spriteTable[spriteId].ty + _spriteGroups[_spriteTable[spriteId].group].ty; else return _spriteTable[spriteId].ty; } -int Sprite::getSpriteField_44(int spriteId) { +int Sprite::getSpriteUserValue(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].field_44; + return _spriteTable[spriteId].userValue; } -int Sprite::getSpriteXmapNum(int spriteId) { +int Sprite::getSpriteShadow(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].xmapNum; + return _spriteTable[spriteId].shadow; } -int Sprite::getSpritewizSize(int spriteId) { +int Sprite::getSpriteImageStateCount(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].res_wiz_states; + return _spriteTable[spriteId].imageStateCount; } -int Sprite::getSpritezoom(int spriteId) { +int Sprite::getSpriteScale(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].zoom; + return _spriteTable[spriteId].scale; } -int Sprite::getSpritedelayAmount(int spriteId) { +int Sprite::getSpriteAnimSpeed(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].delayAmount; + return _spriteTable[spriteId].animSpeed; } -int Sprite::getSpritemaskImgResNum(int spriteId) { +int Sprite::getSpriteSourceImage(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].maskImgResNum; + return _spriteTable[spriteId].sourceImage; } -int Sprite::getSpriteField_80(int spriteId) { +int Sprite::getSpriteMaskImage(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - return _spriteTable[spriteId].field_80; + return _spriteTable[spriteId].maskImage; } -int Sprite::getSpriteField_8C_90(int spriteId, int type) { - debug(0, "getSpriteField_8C_90: spriteId %d type 0x%x", spriteId, type); +int Sprite::getSpriteGeneralProperty(int spriteId, int type) { + debug(0, "getSpriteGeneralProperty: spriteId %d type 0x%x", spriteId, type); checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); // XXX U32 related check @@ -387,31 +387,31 @@ int Sprite::getSpriteField_8C_90(int spriteId, int type) { case 0x7D: return _spriteTable[spriteId].field_90; case 0x7E: - return _spriteTable[spriteId].delayCount; + return _spriteTable[spriteId].animProgress; default: - error("getSpriteField_8C_90: Invalid type %d", type); + error("getSpriteGeneralProperty: Invalid type %d", type); } } void Sprite::getSpriteImageDim(int spriteId, int32 &w, int32 &h) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].resId) { - _vm->_wiz->getWizImageDim(_spriteTable[spriteId].resId, _spriteTable[spriteId].resState, w, h); + if (_spriteTable[spriteId].image) { + _vm->_wiz->getWizImageDim(_spriteTable[spriteId].image, _spriteTable[spriteId].imageState, w, h); } else { w = 0; h = 0; } } -void Sprite::getSpritetx_ty(int spriteId, int32 &tx, int32 &ty) { +void Sprite::getSpritePosition(int spriteId, int32 &tx, int32 &ty) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); tx = _spriteTable[spriteId].tx; ty = _spriteTable[spriteId].ty; } -void Sprite::getSpritedx_dy(int spriteId, int32 &dx, int32 &dy) { +void Sprite::getSpriteDist(int spriteId, int32 &dx, int32 &dy) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); dx = _spriteTable[spriteId].dx; @@ -421,13 +421,13 @@ void Sprite::getSpritedx_dy(int spriteId, int32 &dx, int32 &dy) { // // spriteGroupGet functions // -int ScummEngine_v90he::getGroupallocateGroupSpritesList(int spriteGroupId) { +int ScummEngine_v90he::getGroupSpriteArray(int spriteGroupId) { int i, numSprites = 0; checkRange(_sprite->_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (i = (_sprite->_varNumSprites - 1); i > 0; i--) { - if (_sprite->_spriteTable[i].groupNum == spriteGroupId) + if (_sprite->_spriteTable[i].group == spriteGroupId) numSprites++; } @@ -440,7 +440,7 @@ int ScummEngine_v90he::getGroupallocateGroupSpritesList(int spriteGroupId) { numSprites = 1; for (i = (_sprite->_varNumSprites - 1); i > 0; i--) { - if (_sprite->_spriteTable[i].groupNum == spriteGroupId) { + if (_sprite->_spriteTable[i].group == spriteGroupId) { writeArray(0, 0, numSprites, i); numSprites++; } @@ -449,16 +449,16 @@ int ScummEngine_v90he::getGroupallocateGroupSpritesList(int spriteGroupId) { return readVar(0); } -int Sprite::getGroupzorderPriority(int spriteGroupId) { +int Sprite::getGroupPriority(int spriteGroupId) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); - return _spriteGroups[spriteGroupId].zorderPriority; + return _spriteGroups[spriteGroupId].priority; } -int Sprite::getGroupdstResNum(int spriteGroupId) { +int Sprite::getGroupDstResNum(int spriteGroupId) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); - return _spriteGroups[spriteGroupId].dstResNum; + return _spriteGroups[spriteGroupId].image; } int Sprite::getGroupScale_x_ratio_mul(int spriteGroupId) { @@ -495,91 +495,91 @@ void Sprite::getGrouptx_ty(int spriteGroupId, int32 &tx, int32 &ty) { // // spriteInfoSet functions // -void Sprite::setSpritePaletteNum(int spriteId, int value) { +void Sprite::setSpritePalette(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].paletteNum != value) { - _spriteTable[spriteId].paletteNum = value; + if (_spriteTable[spriteId].palette != value) { + _spriteTable[spriteId].palette = value; _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } -void Sprite::setSpriteMaskImgResNum(int spriteId, int value) { +void Sprite::setSpriteSourceImage(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].maskImgResNum != value) { - _spriteTable[spriteId].maskImgResNum = value; + if (_spriteTable[spriteId].sourceImage != value) { + _spriteTable[spriteId].sourceImage = value; _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } -void Sprite::setSpriteField80(int spriteId, int value) { +void Sprite::setSpriteMaskImage(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].field_80 = value; + _spriteTable[spriteId].maskImage = value; } -void Sprite::setSpriteResState(int spriteId, int state) { +void Sprite::setSpriteImageState(int spriteId, int state) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].resId) { - int res_wiz_states = _spriteTable[spriteId].res_wiz_states - 1; + if (_spriteTable[spriteId].image) { + int imageStateCount = _spriteTable[spriteId].imageStateCount - 1; state = MAX(0, state); - state = MIN(state, res_wiz_states); + state = MIN(state, imageStateCount); - if (_spriteTable[spriteId].resState != state) { - _spriteTable[spriteId].resState = state; + if (_spriteTable[spriteId].imageState != state) { + _spriteTable[spriteId].imageState = state; _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } } -void Sprite::setSpritetx_ty(int spriteId, int value1, int value2) { +void Sprite::setSpritePosition(int spriteId, int tx, int ty) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - if (_spriteTable[spriteId].tx != value1 || _spriteTable[spriteId].ty != value2) { - _spriteTable[spriteId].tx = value1; - _spriteTable[spriteId].ty = value2; + if (_spriteTable[spriteId].tx != tx || _spriteTable[spriteId].ty != ty) { + _spriteTable[spriteId].tx = tx; + _spriteTable[spriteId].ty = ty; _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } -void Sprite::setSpriteGroupNum(int spriteId, int value) { +void Sprite::setSpriteGroup(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); checkRange(_varNumSpriteGroups, 0, value, "Invalid sprite group %d"); - _spriteTable[spriteId].groupNum = value; + _spriteTable[spriteId].group = value; _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } -void Sprite::setSpritedx_dy(int spriteId, int value1, int value2) { +void Sprite::setSpriteDist(int spriteId, int value1, int value2) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); _spriteTable[spriteId].dx = value1; _spriteTable[spriteId].dy = value2; } -void Sprite::setSpriteXmapNum(int spriteId, int value) { +void Sprite::setSpriteShadow(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].xmapNum = value; - if (_spriteTable[spriteId].resId) + _spriteTable[spriteId].shadow = value; + if (_spriteTable[spriteId].image) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } -void Sprite::setSpriteField44(int spriteId, int value1, int value2) { +void Sprite::setSpriteUserValue(int spriteId, int value1, int value2) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].field_44 = value2; + _spriteTable[spriteId].userValue = value2; } -void Sprite::setSpriteZorderPriority(int spriteId, int value) { +void Sprite::setSpritePriority(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].zorderPriority = value; + _spriteTable[spriteId].priority = value; } -void Sprite::setSpriteInc_tx_ty(int spriteId, int value1, int value2) { +void Sprite::moveSprite(int spriteId, int value1, int value2) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); _spriteTable[spriteId].tx += value1; @@ -589,15 +589,15 @@ void Sprite::setSpriteInc_tx_ty(int spriteId, int value1, int value2) { _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } -void Sprite::setSpriteZoom(int spriteId, int value) { +void Sprite::setSpriteScale(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].flags |= kSFZoomed; + _spriteTable[spriteId].flags |= kSFScaled; - if (_spriteTable[spriteId].zoom != value) { - _spriteTable[spriteId].zoom = value; + if (_spriteTable[spriteId].scale != value) { + _spriteTable[spriteId].scale = value; - if (_spriteTable[spriteId].resId) + if (_spriteTable[spriteId].image) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } @@ -610,7 +610,7 @@ void Sprite::setSpriteAngle(int spriteId, int value) { if (_spriteTable[spriteId].angle != value) { _spriteTable[spriteId].angle = value; - if (_spriteTable[spriteId].resId) + if (_spriteTable[spriteId].image) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } } @@ -624,7 +624,7 @@ void Sprite::setSpriteFlagDoubleBuffered(int spriteId, int value) { else _spriteTable[spriteId].flags &= ~kSFDoubleBuffered; - if (_spriteTable[spriteId].resId && _spriteTable[spriteId].flags != oldFlags) + if (_spriteTable[spriteId].image && _spriteTable[spriteId].flags != oldFlags) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } @@ -637,7 +637,7 @@ void Sprite::setSpriteFlagYFlipped(int spriteId, int value) { else _spriteTable[spriteId].flags &= ~kSFYFlipped; - if (_spriteTable[spriteId].resId && _spriteTable[spriteId].flags != oldFlags) + if (_spriteTable[spriteId].image && _spriteTable[spriteId].flags != oldFlags) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } @@ -650,7 +650,7 @@ void Sprite::setSpriteFlagXFlipped(int spriteId, int value) { else _spriteTable[spriteId].flags &= ~kSFXFlipped; - if (_spriteTable[spriteId].resId && _spriteTable[spriteId].flags != oldFlags) + if (_spriteTable[spriteId].image && _spriteTable[spriteId].flags != oldFlags) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } @@ -663,29 +663,29 @@ void Sprite::setSpriteFlagActive(int spriteId, int value) { _spriteTable[spriteId].flags &= ~kSFActive; } -void Sprite::setSpriteFlagNeedPaletteRemap(int spriteId, int value) { +void Sprite::setSpriteFlagRemapPalette(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); int oldFlags = _spriteTable[spriteId].flags; if (value) - _spriteTable[spriteId].flags |= kSFNeedPaletteRemap; + _spriteTable[spriteId].flags |= kSFRemapPalette; else - _spriteTable[spriteId].flags &= ~kSFNeedPaletteRemap; + _spriteTable[spriteId].flags &= ~kSFRemapPalette; - if (_spriteTable[spriteId].resId && _spriteTable[spriteId].flags != oldFlags) + if (_spriteTable[spriteId].image && _spriteTable[spriteId].flags != oldFlags) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } -void Sprite::setSpriteFlagDelayed(int spriteId, int value) { +void Sprite::setSpriteFlagAutoAnim(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); if (value) - _spriteTable[spriteId].flags |= kSFDelayed; + _spriteTable[spriteId].flags |= kSFAutoAnim; else - _spriteTable[spriteId].flags &= ~kSFDelayed; + _spriteTable[spriteId].flags &= ~kSFAutoAnim; } -void Sprite::setSpriteFlagMarkDirty(int spriteId, int value) { +void Sprite::setSpriteFlagUpdateType(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); switch(value) { @@ -700,11 +700,11 @@ void Sprite::setSpriteFlagMarkDirty(int spriteId, int value) { _spriteTable[spriteId].flags &= ~(kSFMarkDirty | kSFBlitDirectly); break; default: - error("setSpriteFlagMarkDirty: Invalid value %d", value); + error("setSpriteFlagUpdateType: Invalid value %d", value); } } -void Sprite::setSpriteFlagHasImage(int spriteId, int value) { +void Sprite::setSpriteFlagEraseType(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); // Note that condition is inverted @@ -714,14 +714,14 @@ void Sprite::setSpriteFlagHasImage(int spriteId, int value) { _spriteTable[spriteId].flags &= ~kSFImageless; } -void Sprite::setSpriteDelay(int spriteId, int value) { +void Sprite::setSpriteAnimSpeed(int spriteId, int value) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - _spriteTable[spriteId].delayAmount = value; - _spriteTable[spriteId].delayCount = value; + _spriteTable[spriteId].animSpeed = value; + _spriteTable[spriteId].animProgress = value; } -void Sprite::setSpriteSetClassFlag(int spriteId, int classId, int toggle) { +void Sprite::setSpriteSetClass(int spriteId, int classId, int toggle) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); checkRange(32, 1, classId, "class %d out of range in statement"); @@ -732,7 +732,7 @@ void Sprite::setSpriteSetClassFlag(int spriteId, int classId, int toggle) { } } -void Sprite::setSpriteResetClassFlags(int spriteId) { +void Sprite::setSpriteResetClass(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); _spriteTable[spriteId].classFlags = 0; @@ -744,8 +744,8 @@ void Sprite::setSpriteField84(int spriteId, int value) { _spriteTable[spriteId].field_84 = value; } -void Sprite::setSpriteField8C_90(int spriteId, int type, int value) { - debug(0, "setSpriteField8C_90: spriteId %d type 0x%x", spriteId, type); +void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) { + debug(0, "setSpriteGeneralProperty: spriteId %d type 0x%x", spriteId, type); checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); int delay; @@ -762,25 +762,24 @@ void Sprite::setSpriteField8C_90(int spriteId, int type, int value) { break; case 0x7E: delay = MAX(0, value); - delay = MIN((int32)value, _spriteTable[spriteId].delayAmount); + delay = MIN((int32)value, _spriteTable[spriteId].animSpeed); - _spriteTable[spriteId].delayCount = value; + _spriteTable[spriteId].animProgress = value; break; default: - error("setSpriteField8C_90: Invalid value %d", type); + error("setSpriteGeneralProperty: Invalid value %d", type); } } -void Sprite::setSpriteResetSprite(int spriteId) { +void Sprite::resetSprite(int spriteId) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); _spriteTable[spriteId].angle = 0; - _spriteTable[spriteId].zoom = 0; + _spriteTable[spriteId].scale = 0; - int tmp = 0; - addImageToList(spriteId, 1, &tmp); + setSpriteImage(spriteId, 0); - _spriteTable[spriteId].xmapNum = 0; + _spriteTable[spriteId].shadow = 0; _spriteTable[spriteId].tx = 0; _spriteTable[spriteId].ty = 0; @@ -788,46 +787,46 @@ void Sprite::setSpriteResetSprite(int spriteId) { _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; _spriteTable[spriteId].dx = 0; _spriteTable[spriteId].dy = 0; - _spriteTable[spriteId].field_44 = 0; - _spriteTable[spriteId].groupNum = 0; - _spriteTable[spriteId].delayAmount = 0; - _spriteTable[spriteId].delayCount = 0; + _spriteTable[spriteId].userValue = 0; + _spriteTable[spriteId].group = 0; + _spriteTable[spriteId].animSpeed = 0; + _spriteTable[spriteId].animProgress = 0; _spriteTable[spriteId].classFlags = 0; - _spriteTable[spriteId].paletteNum = 0; - _spriteTable[spriteId].maskImgResNum = 0; - _spriteTable[spriteId].field_80 = 0; - _spriteTable[spriteId].zorderPriority = 0; + _spriteTable[spriteId].palette = 0; + _spriteTable[spriteId].sourceImage = 0; + _spriteTable[spriteId].maskImage = 0; + _spriteTable[spriteId].priority = 0; _spriteTable[spriteId].field_84 = 0; _spriteTable[spriteId].imgFlags = 0; _spriteTable[spriteId].field_90 = 0; } -void Sprite::addImageToList(int spriteId, int imageNum, int *spriteIdptr) { +void Sprite::setSpriteImage(int spriteId, int imageNum) { int origResId, origResWizStates; checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - origResId = _spriteTable[spriteId].resId; - origResWizStates = _spriteTable[spriteId].res_wiz_states; + origResId = _spriteTable[spriteId].image; + origResWizStates = _spriteTable[spriteId].imageStateCount; - _spriteTable[spriteId].resId = *spriteIdptr; + _spriteTable[spriteId].image = imageNum; _spriteTable[spriteId].field_74 = 0; - _spriteTable[spriteId].resState = 0; + _spriteTable[spriteId].imageState = 0; - if (_spriteTable[spriteId].resId) { - _spriteTable[spriteId].res_wiz_states = _vm->_wiz->getWizImageStates(_spriteTable[spriteId].resId); - _spriteTable[spriteId].flags |= kSFActive | kSFDelayed | kSFMarkDirty | kSFBlitDirectly; + if (_spriteTable[spriteId].image) { + _spriteTable[spriteId].imageStateCount = _vm->_wiz->getWizImageStates(_spriteTable[spriteId].image); + _spriteTable[spriteId].flags |= kSFActive | kSFAutoAnim | kSFMarkDirty | kSFBlitDirectly; - if (_spriteTable[spriteId].resId != origResId || _spriteTable[spriteId].res_wiz_states != origResWizStates) + if (_spriteTable[spriteId].image != origResId || _spriteTable[spriteId].imageStateCount != origResWizStates) _spriteTable[spriteId].flags |= kSFChanged | kSFNeedRedraw; } else { if (_spriteTable[spriteId].flags & kSFImageless) _spriteTable[spriteId].flags = 0; else _spriteTable[spriteId].flags = kSFChanged | kSFBlitDirectly; - _spriteTable[spriteId].curResId = 0; + _spriteTable[spriteId].curImage = 0; _spriteTable[spriteId].curImageState = 0; - _spriteTable[spriteId].res_wiz_states = 0; + _spriteTable[spriteId].imageStateCount = 0; } } @@ -837,17 +836,17 @@ void Sprite::addImageToList(int spriteId, int imageNum, int *spriteIdptr) { void Sprite::redrawSpriteGroup(int spriteGroupId) { for (int i = 0; i < _numSpritesToProcess; ++i) { SpriteInfo *spi = _activeSpritesTable[i]; - if (spi->groupNum == spriteGroupId) { + if (spi->group == spriteGroupId) { spi->flags |= kSFChanged | kSFNeedRedraw; } } } -void Sprite::setGroupCase0_0(int spriteGroupId, int value1, int value2) { +void Sprite::moveGroupMembers(int spriteGroupId, int value1, int value2) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) { + if (_spriteTable[i].group == spriteGroupId) { _spriteTable[i].tx += value1; _spriteTable[i].ty += value2; @@ -857,81 +856,81 @@ void Sprite::setGroupCase0_0(int spriteGroupId, int value1, int value2) { } } -void Sprite::setGroupCase0_1(int spriteGroupId, int value) { +void Sprite::setGroupMembersPriority(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) - _spriteTable[i].zorderPriority = value; + if (_spriteTable[i].group == spriteGroupId) + _spriteTable[i].priority = value; } } -void Sprite::setGroupCase0_2(int spriteGroupId, int value) { +void Sprite::setGroupMembersGroup(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) { - _spriteTable[i].groupNum = value; + if (_spriteTable[i].group == spriteGroupId) { + _spriteTable[i].group = value; _spriteTable[i].flags |= kSFChanged | kSFNeedRedraw; } } } -void Sprite::setGroupCase0_3(int spriteGroupId, int value) { +void Sprite::setGroupMembersUpdateType(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) - setSpriteFlagMarkDirty(i, value); + if (_spriteTable[i].group == spriteGroupId) + setSpriteFlagUpdateType(i, value); } } -void Sprite::setGroupCase0_4(int spriteGroupId) { +void Sprite::setGroupMembersResetSprite(int spriteGroupId) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) - setSpriteResetSprite(i); + if (_spriteTable[i].group == spriteGroupId) + resetSprite(i); } } -void Sprite::setGroupCase0_5(int spriteGroupId, int value) { +void Sprite::setGroupMembersAnimationSpeed(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) { - _spriteTable[i].delayAmount = value; - _spriteTable[i].delayCount = value; + if (_spriteTable[i].group == spriteGroupId) { + _spriteTable[i].animSpeed = value; + _spriteTable[i].animProgress = value; } } } -void Sprite::setGroupCase0_6(int spriteGroupId, int value) { +void Sprite::setGroupMembersAutoAnimFlag(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) { + if (_spriteTable[i].group == spriteGroupId) { if (value) - _spriteTable[i].flags |= kSFDelayed; + _spriteTable[i].flags |= kSFAutoAnim; else - _spriteTable[i].flags &= ~kSFDelayed; + _spriteTable[i].flags &= ~kSFAutoAnim; } } } -void Sprite::setGroupCase0_7(int spriteGroupId, int value) { +void Sprite::setGroupMembersShadow(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); for (int i = 1; i < _varNumSprites; i++) { - if (_spriteTable[i].groupNum == spriteGroupId) { - _spriteTable[i].xmapNum = value; - if (_spriteTable[i].resId) + if (_spriteTable[i].group == spriteGroupId) { + _spriteTable[i].shadow = value; + if (_spriteTable[i].image) _spriteTable[i].flags |= kSFChanged | kSFNeedRedraw; } } } -void Sprite::setGroupbbox(int spriteGroupId, int x1, int y1, int x2, int y2) { +void Sprite::setGroupBounds(int spriteGroupId, int x1, int y1, int x2, int y2) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); _spriteGroups[spriteGroupId].flags |= kSGFClipBox; @@ -943,16 +942,16 @@ void Sprite::setGroupbbox(int spriteGroupId, int x1, int y1, int x2, int y2) { redrawSpriteGroup(spriteGroupId); } -void Sprite::setGroupzorderPriority(int spriteGroupId, int value) { +void Sprite::setGroupPriority(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); - if (_spriteGroups[spriteGroupId].zorderPriority != value) { - _spriteGroups[spriteGroupId].zorderPriority = value; + if (_spriteGroups[spriteGroupId].priority != value) { + _spriteGroups[spriteGroupId].priority = value; redrawSpriteGroup(spriteGroupId); } } -void Sprite::setGrouptx_ty(int spriteGroupId, int value1, int value2) { +void Sprite::moveGroup(int spriteGroupId, int value1, int value2) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); if (_spriteGroups[spriteGroupId].tx != value1 || _spriteGroups[spriteGroupId].ty != value2) { @@ -972,16 +971,16 @@ void Sprite::setGroupinc_tx_ty(int spriteGroupId, int value1, int value2) { } } -void Sprite::setGroupdstResNum(int spriteGroupId, int value) { +void Sprite::setGroupImage(int spriteGroupId, int value) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); - if (_spriteGroups[spriteGroupId].dstResNum != value) { - _spriteGroups[spriteGroupId].dstResNum = value; + if (_spriteGroups[spriteGroupId].image != value) { + _spriteGroups[spriteGroupId].image = value; redrawSpriteGroup(spriteGroupId); } } -void Sprite::setGroupscaling(int spriteGroupId) { +void Sprite::setGroupScaling(int spriteGroupId) { if ((_spriteGroups[spriteGroupId].scale_x_ratio_mul != _spriteGroups[spriteGroupId].scale_x_ratio_div) || (_spriteGroups[spriteGroupId].scale_y_ratio_mul != _spriteGroups[spriteGroupId].scale_y_ratio_div)) _spriteGroups[spriteGroupId].scaling = 1; else @@ -994,7 +993,7 @@ void Sprite::setGroupScale_x_ratio_mul(int spriteGroupId, int value) { if (_spriteGroups[spriteGroupId].scale_x_ratio_mul != value) { _spriteGroups[spriteGroupId].scale_x_ratio_mul = value; - setGroupscaling(spriteGroupId); + setGroupScaling(spriteGroupId); redrawSpriteGroup(spriteGroupId); } } @@ -1007,7 +1006,7 @@ void Sprite::setGroupScale_x_ratio_div(int spriteGroupId, int value) { if (_spriteGroups[spriteGroupId].scale_x_ratio_div != value) { _spriteGroups[spriteGroupId].scale_x_ratio_div = value; - setGroupscaling(spriteGroupId); + setGroupScaling(spriteGroupId); redrawSpriteGroup(spriteGroupId); } } @@ -1017,7 +1016,7 @@ void Sprite::setGroupScale_y_ratio_mul(int spriteGroupId, int value) { if (_spriteGroups[spriteGroupId].scale_y_ratio_mul != value) { _spriteGroups[spriteGroupId].scale_y_ratio_mul = value; - setGroupscaling(spriteGroupId); + setGroupScaling(spriteGroupId); redrawSpriteGroup(spriteGroupId); } } @@ -1030,12 +1029,12 @@ void Sprite::setGroupScale_y_ratio_div(int spriteGroupId, int value) { if (_spriteGroups[spriteGroupId].scale_y_ratio_div != value) { _spriteGroups[spriteGroupId].scale_y_ratio_div = value; - setGroupscaling(spriteGroupId); + setGroupScaling(spriteGroupId); redrawSpriteGroup(spriteGroupId); } } -void Sprite::setGroupflagClipBoxAnd(int spriteGroupId) { +void Sprite::resetGroupBounds(int spriteGroupId) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); _spriteGroups[spriteGroupId].flags &= ~(kSGFClipBox); @@ -1056,13 +1055,13 @@ void Sprite::resetGroup(int spriteGroupId) { checkRange(_varNumSpriteGroups, 1, spriteGroupId, "Invalid sprite group %d"); SpriteGroup *spg = &_spriteGroups[spriteGroupId]; - spg->zorderPriority = 0; + spg->priority = 0; spg->tx = spg->ty = 0; spg->flags &= ~kSGFClipBox; redrawSpriteGroup(spriteGroupId); - spg->dstResNum = 0; + spg->image = 0; spg->scaling = 0; spg->scale_x_ratio_mul = 1; spg->scale_x_ratio_div = 1; @@ -1118,7 +1117,7 @@ void Sprite::resetBackground() { } refreshScreen = true; } - if (!(spi->flags & (kSFNeedRedraw | kSF30)) && spi->resId) + if (!(spi->flags & (kSFNeedRedraw | kSF30)) && spi->image) spi->flags |= kSFNeedRedraw; } } @@ -1133,7 +1132,7 @@ void Sprite::setRedrawFlags(bool checkZOrder) { for (int i = 0; i < _numSpritesToProcess; ++i) { SpriteInfo *spi = _activeSpritesTable[i]; if (!(spi->flags & (kSFNeedRedraw | kSF30))) { - if ((!checkZOrder || spi->zorderPriority >= 0) && (spi->flags & kSFMarkDirty)) { + if ((!checkZOrder || spi->priority >= 0) && (spi->flags & kSFMarkDirty)) { int lp = spi->bbox.left / 8; if (lp < 0) { lp = 0; @@ -1169,19 +1168,19 @@ void Sprite::updateImages() { spi->flags |= kSFChanged | kSFNeedRedraw; } } - if (spi->flags & kSFDelayed) { - if (spi->delayAmount) { - --spi->delayCount; - if (spi->delayCount) + if (spi->flags & kSFAutoAnim) { + if (spi->animSpeed) { + --spi->animProgress; + if (spi->animProgress) continue; - spi->delayCount = spi->delayAmount; + spi->animProgress = spi->animSpeed; } - int resState = spi->resState; - ++spi->resState; - if (spi->resState >= spi->res_wiz_states) { - spi->resState = 0; - if (resState == 0) + int imageState = spi->imageState; + ++spi->imageState; + if (spi->imageState >= spi->imageStateCount) { + spi->imageState = 0; + if (imageState == 0) continue; } spi->flags |= kSFChanged | kSFNeedRedraw; @@ -1220,13 +1219,13 @@ void Sprite::sortActiveSprites() { if (!(spi->flags & kSFImageless)) spi->flags |= kSFChanged; } - if (spi->groupNum) - groupZorder = _spriteGroups[spi->groupNum].zorderPriority; + if (spi->group) + groupZorder = _spriteGroups[spi->group].priority; else groupZorder = 0; spi->id = i; - spi->zorder = spi->zorderPriority + groupZorder; + spi->zorder = spi->priority + groupZorder; _activeSpritesTable[_numSpritesToProcess++] = spi; } @@ -1241,9 +1240,9 @@ void Sprite::sortActiveSprites() { void Sprite::processImages(bool arg) { int spr_flags; int16 spr_wiz_x, spr_wiz_y; - int resId, resState; + int image, imageState; Common::Rect *bboxPtr; - int angle, zoom; + int angle, scale; int32 w, h; WizParameters wiz; @@ -1264,12 +1263,12 @@ void Sprite::processImages(bool arg) { } spi->flags &= ~kSFNeedRedraw; - resId = spi->resId; - resState = spi->resState; - _vm->_wiz->loadImgSpot(spi->resId, spi->resState, spr_wiz_x, spr_wiz_y); + image = spi->image; + imageState = spi->imageState; + _vm->_wiz->loadImgSpot(spi->image, spi->imageState, spr_wiz_x, spr_wiz_y); - if (spi->groupNum) { - SpriteGroup *spg = &_spriteGroups[spi->groupNum]; + if (spi->group) { + SpriteGroup *spg = &_spriteGroups[spi->group]; if (spg->scaling) { wiz.img.x1 = spi->tx * spg->scale_x_ratio_mul / spg->scale_x_ratio_div - spr_wiz_x + spg->tx; @@ -1284,21 +1283,21 @@ void Sprite::processImages(bool arg) { } wiz.spriteId = spi->id; - wiz.groupNum = spi->groupNum; + wiz.spriteGroup = spi->group; wiz.field_23EA = spi->field_90; - spi->curImageState = wiz.img.state = resState; - spi->curResId = wiz.img.resNum = resId; + spi->curImageState = wiz.img.state = imageState; + spi->curImage = wiz.img.resNum = image; wiz.processFlags = kWPFNewState | kWPFSetPos; spi->curAngle = spi->angle; - spi->curZoom = spi->zoom; + spi->curScale = spi->scale; spi->pos.x = wiz.img.x1; spi->pos.y = wiz.img.y1; bboxPtr = &spi->bbox; - if (resId) { + if (image) { angle = spi->angle; - zoom = spi->zoom; - _vm->_wiz->getWizImageDim(resId, resState, w, h); - if (!(spi->flags & (kSFZoomed | kSFRotated))) { + scale = spi->scale; + _vm->_wiz->getWizImageDim(image, imageState, w, h); + if (!(spi->flags & (kSFScaled | kSFRotated))) { bboxPtr->left = wiz.img.x1; bboxPtr->top = wiz.img.y1; bboxPtr->right = wiz.img.x1 + w; @@ -1310,10 +1309,10 @@ void Sprite::processImages(bool arg) { pts[0].x = pts[0].y = pts[1].y = pts[3].x = -w / 2; pts[2].y = pts[3].y = h / 2 - 1; - if ((spi->flags & kSFZoomed) && zoom) { + if ((spi->flags & kSFScaled) && scale) { for (int j = 0; j < 4; ++j) { - pts[j].x = pts[j].x * zoom / 256; - pts[j].y = pts[j].y * zoom / 256; + pts[j].x = pts[j].x * scale / 256; + pts[j].y = pts[j].y * scale / 256; } } if ((spi->flags & kSFRotated) && angle) @@ -1343,21 +1342,21 @@ void Sprite::processImages(bool arg) { wiz.img.flags &= ~kWIFMarkBufferDirty; wiz.img.flags |= kWIFBlitToFrontVideoBuffer; } - if (spi->xmapNum) { + if (spi->shadow) { wiz.img.flags |= 0x200; - wiz.processFlags |= kWPFXmapNum; - wiz.xmapNum = spi->xmapNum; + wiz.processFlags |= kWPFShadow; + wiz.shadow = spi->shadow; } - if (spr_flags & kSFNeedPaletteRemap) + if (spr_flags & kSFRemapPalette) wiz.img.flags |= kWIFRemapPalette; if (spi->field_84) { wiz.processFlags |= 0x200000; wiz.img.field_390 = spi->field_84; - wiz.img.zorder = spi->zorderPriority; + wiz.img.zorder = spi->priority; } - if (spi->maskImgResNum) { + if (spi->sourceImage) { wiz.processFlags |= kWPFMaskImg; - wiz.maskImgResNum = spi->maskImgResNum; + wiz.sourceImage = spi->sourceImage; } wiz.processFlags |= kWPFNewFlags; wiz.img.flags |= spi->imgFlags; @@ -1366,15 +1365,15 @@ void Sprite::processImages(bool arg) { wiz.processFlags |= kWPFRotate; wiz.angle = spi->angle; } - if (spr_flags & kSFZoomed) { - wiz.processFlags |= kWPFZoom; - wiz.zoom = spi->zoom; + if (spr_flags & kSFScaled) { + wiz.processFlags |= kWPFScaled; + wiz.scale = spi->scale; } spi->curImgFlags = wiz.img.flags; - if (spi->groupNum && (_spriteGroups[spi->groupNum].flags & kSGFClipBox)) { - if (spi->bbox.intersects(_spriteGroups[spi->groupNum].bbox)) { - spi->bbox.clip(_spriteGroups[spi->groupNum].bbox); + if (spi->group && (_spriteGroups[spi->group].flags & kSGFClipBox)) { + if (spi->bbox.intersects(_spriteGroups[spi->group].bbox)) { + spi->bbox.clip(_spriteGroups[spi->group].bbox); wiz.processFlags |= kWPFClipBox; wiz.box = spi->bbox; } else { @@ -1385,13 +1384,13 @@ void Sprite::processImages(bool arg) { continue; } } - if (spi->paletteNum) { + if (spi->palette) { wiz.processFlags |= kWPFPaletteNum; - wiz.img.paletteNum = spi->paletteNum; + wiz.img.palette = spi->palette; } - if (spi->resId && spi->groupNum && _spriteGroups[spi->groupNum].dstResNum) { + if (spi->image && spi->group && _spriteGroups[spi->group].image) { wiz.processFlags |= kWPFDstResNum; - wiz.dstResNum = _spriteGroups[spi->groupNum].dstResNum; + wiz.dstResNum = _spriteGroups[spi->group].image; } _vm->_wiz->displayWizComplexImage(&wiz); } @@ -1402,11 +1401,11 @@ void Sprite::saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion) { 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, image, sleInt32, VER(48)), + MKLINE(SpriteInfo, imageState, sleInt32, VER(48)), + MKLINE(SpriteInfo, group, sleInt32, VER(48)), + MKLINE(SpriteInfo, palette, sleInt32, VER(48)), + MKLINE(SpriteInfo, priority, sleInt32, VER(48)), MKLINE(SpriteInfo, bbox.left, sleInt32, VER(48)), MKLINE(SpriteInfo, bbox.top, sleInt32, VER(48)), MKLINE(SpriteInfo, bbox.right, sleInt32, VER(48)), @@ -1417,22 +1416,22 @@ void Sprite::saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion) { 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, userValue, sleInt32, VER(48)), MKLINE(SpriteInfo, curImageState, sleInt32, VER(48)), - MKLINE(SpriteInfo, curResId, sleInt32, VER(48)), + MKLINE(SpriteInfo, curImage, 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, shadow, sleInt32, VER(48)), + MKLINE(SpriteInfo, imageStateCount, sleInt32, VER(48)), MKLINE(SpriteInfo, angle, sleInt32, VER(48)), - MKLINE(SpriteInfo, zoom, sleInt32, VER(48)), - MKLINE(SpriteInfo, delayCount, sleInt32, VER(48)), + MKLINE(SpriteInfo, scale, sleInt32, VER(48)), + MKLINE(SpriteInfo, animProgress, sleInt32, VER(48)), MKLINE(SpriteInfo, curAngle, sleInt32, VER(48)), - MKLINE(SpriteInfo, curZoom, sleInt32, VER(48)), + MKLINE(SpriteInfo, curScale, sleInt32, VER(48)), MKLINE(SpriteInfo, curImgFlags, sleInt32, VER(48)), MKLINE(SpriteInfo, field_74, sleInt32, VER(48)), - MKLINE(SpriteInfo, delayAmount, sleInt32, VER(48)), - MKLINE(SpriteInfo, maskImgResNum, sleInt32, VER(48)), - MKLINE(SpriteInfo, field_80, 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, classFlags, sleInt32, VER(48)), MKLINE(SpriteInfo, imgFlags, sleInt32, VER(48)), @@ -1445,11 +1444,11 @@ void Sprite::saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion) { 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, priority, 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, image, sleInt32, VER(48)), MKLINE(SpriteGroup, scaling, sleInt32, VER(48)), MKLINE(SpriteGroup, scale_x_ratio_mul, sleInt32, VER(48)), MKLINE(SpriteGroup, scale_x_ratio_div, sleInt32, VER(48)), diff --git a/scumm/sprite_he.h b/scumm/sprite_he.h index 63832df59d..4fab70c90a 100644 --- a/scumm/sprite_he.h +++ b/scumm/sprite_he.h @@ -28,14 +28,14 @@ namespace Scumm { enum SpriteFlags { kSFChanged = 0x1, kSFNeedRedraw = 0x2, - kSFZoomed = 0x10, + kSFScaled = 0x10, kSFRotated = 0x20, kSFDoubleBuffered = 0x1000, kSFYFlipped = 0x2000, kSFXFlipped = 0x4000, kSFActive = 0x8000, - kSFNeedPaletteRemap = 0x80000, - kSFDelayed = 0x200000, + kSFRemapPalette = 0x80000, + kSFAutoAnim = 0x200000, kSFMarkDirty = 0x400000, kSFBlitDirectly = 0x2000000, kSF30 = 0x20000000, @@ -50,33 +50,33 @@ struct SpriteInfo { int32 id; int32 zorder; int32 flags; - int32 resId; - int32 resState; - int32 groupNum; - int32 paletteNum; - int32 zorderPriority; + int32 image; + int32 imageState; + int32 group; + int32 palette; + int32 priority; Common::Rect bbox; int32 dx; int32 dy; Common::Point pos; int32 tx; int32 ty; - int32 field_44; + int32 userValue; int32 curImageState; - int32 curResId; + int32 curImage; int32 imglistNum; - int32 xmapNum; - int32 res_wiz_states; + int32 shadow; + int32 imageStateCount; int32 angle; - int32 zoom; - int32 delayCount; + int32 scale; + int32 animProgress; int32 curAngle; - int32 curZoom; + int32 curScale; int32 curImgFlags; int32 field_74; - int32 delayAmount; - int32 maskImgResNum; - int32 field_80; + int32 animSpeed; + int32 sourceImage; + int32 maskImage; int32 field_84; int32 classFlags; int32 imgFlags; @@ -85,11 +85,11 @@ struct SpriteInfo { struct SpriteGroup { Common::Rect bbox; - int32 zorderPriority; + int32 priority; int32 flags; int32 tx; int32 ty; - int32 dstResNum; + int32 image; int32 scaling; int32 scale_x_ratio_mul; int32 scale_x_ratio_div; @@ -121,95 +121,95 @@ public: void getSpriteBounds(int spriteId, bool checkGroup, Common::Rect &bound); int findSpriteWithClassOf(int x, int y, int spriteGroupId, int d, int num, int *args); - int getSpriteclassFlags(int spriteId, int num, int *args); + int getSpriteClass(int spriteId, int num, int *args); int getSpriteFlagDoubleBuffered(int spriteId); int getSpriteFlagYFlipped(int spriteId); int getSpriteFlagXFlipped(int spriteId); int getSpriteFlagActive(int spriteId); - int getSpriteFlagNeedPaletteRemap(int spriteId); - int getSpriteFlagDelayed(int spriteId); - int getSpriteFlagMarkDirty(int spriteId); - int getSpriteFlagHasImage(int spriteId); - int getSpriteResId(int spriteId); - int getSpriteResState(int spriteId); - int getSpriteGroupNum(int spriteId); - int getSpritePaletteNum(int spriteId); - int getSpriteZorderPriority(int spriteId); - int getSpritegrp_tx(int spriteId); - int getSpritegrp_ty(int spriteId); - int getSpriteField_44(int spriteId); - int getSpriteXmapNum(int spriteId); - int getSpritewizSize(int spriteId); - int getSpritezoom(int spriteId); - int getSpritedelayAmount(int spriteId); - int getSpritemaskImgResNum(int spriteId); - int getSpriteField_80(int spriteId); - int getSpriteField_8C_90(int spriteId, int type); + int getSpriteFlagRemapPalette(int spriteId); + int getSpriteFlagAutoAnim(int spriteId); + int getSpriteFlagUpdateType(int spriteId); + int getSpriteFlagEraseType(int spriteId); + int getSpriteImage(int spriteId); + int getSpriteImageState(int spriteId); + int getSpriteGroup(int spriteId); + int getSpritePalette(int spriteId); + int getSpritePriority(int spriteId); + int getSpriteDisplayX(int spriteId); + int getSpriteDisplayY(int spriteId); + int getSpriteUserValue(int spriteId); + int getSpriteShadow(int spriteId); + int getSpriteImageStateCount(int spriteId); + int getSpriteScale(int spriteId); + int getSpriteAnimSpeed(int spriteId); + int getSpriteSourceImage(int spriteId); + int getSpriteMaskImage(int spriteId); + int getSpriteGeneralProperty(int spriteId, int type); void getSpriteImageDim(int spriteId, int32 &w, int32 &h); - void getSpritetx_ty(int spriteId, int32 &tx, int32 &ty); - void getSpritedx_dy(int spriteId, int32 &dx, int32 &dy); + void getSpritePosition(int spriteId, int32 &tx, int32 &ty); + void getSpriteDist(int spriteId, int32 &dx, int32 &dy); - int getGroupzorderPriority(int spriteGroupId); - int getGroupdstResNum(int spriteGroupId); + int getGroupPriority(int spriteGroupId); + int getGroupDstResNum(int spriteGroupId); int getGroupScale_x_ratio_mul(int spriteGroupId); int getGroupScale_x_ratio_div(int spriteGroupId); int getGroupScale_y_ratio_mul(int spriteGroupId); int getGroupScale_y_ratio_div(int spriteGroupId); void getGrouptx_ty(int spriteGroupId, int32 &tx, int32 &ty); - void setSpritePaletteNum(int spriteId, int value); - void setSpriteMaskImgResNum(int spriteId, int value); - void setSpriteField80(int spriteId, int value); - void setSpriteResetSprite(int spriteId); - void setSpriteResState(int spriteId, int value); - void setSpritetx_ty(int spriteId, int value1, int value2); - void setSpriteGroupNum(int spriteId, int value); - void setSpritedx_dy(int spriteId, int value1, int value2); - void setSpriteXmapNum(int spriteId, int value); - void setSpriteField44(int spriteId, int value1, int value2); - void setSpriteZorderPriority(int spriteId, int value); - void setSpriteInc_tx_ty(int spriteId, int value1, int value2); - void setSpriteZoom(int spriteId, int value); + void setSpritePalette(int spriteId, int value); + void setSpriteSourceImage(int spriteId, int value); + void setSpriteMaskImage(int spriteId, int value); + void resetSprite(int spriteId); + void setSpriteImageState(int spriteId, int value); + void setSpritePosition(int spriteId, int value1, int value2); + void setSpriteGroup(int spriteId, int value); + void setSpriteDist(int spriteId, int value1, int value2); + void setSpriteShadow(int spriteId, int value); + void setSpriteUserValue(int spriteId, int value1, int value2); + void setSpritePriority(int spriteId, int value); + void moveSprite(int spriteId, int value1, int value2); + void setSpriteScale(int spriteId, int value); void setSpriteAngle(int spriteId, int value); void setSpriteFlagDoubleBuffered(int spriteId, int value); void setSpriteFlagYFlipped(int spriteId, int value); void setSpriteFlagXFlipped(int spriteId, int value); void setSpriteFlagActive(int spriteId, int value); - void setSpriteFlagNeedPaletteRemap(int spriteId, int value); - void setSpriteFlagDelayed(int spriteId, int value); - void setSpriteFlagMarkDirty(int spriteId, int value); - void setSpriteFlagHasImage(int spriteId, int value); - void setSpriteDelay(int spriteId, int value); - void setSpriteSetClassFlag(int spriteId, int classId, int toggle); - void setSpriteResetClassFlags(int spriteId); + void setSpriteFlagRemapPalette(int spriteId, int value); + void setSpriteFlagAutoAnim(int spriteId, int value); + void setSpriteFlagUpdateType(int spriteId, int value); + void setSpriteFlagEraseType(int spriteId, int value); + 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 setSpriteField8C_90(int spriteId, int type, int value); + void setSpriteGeneralProperty(int spriteId, int type, int value); void redrawSpriteGroup(int spriteGroupId); - void setGroupCase0_0(int spriteGroupId, int value1, int value2); - void setGroupCase0_1(int spriteGroupId, int value); - void setGroupCase0_2(int spriteGroupId, int value); - void setGroupCase0_3(int spriteGroupId, int value); - void setGroupCase0_4(int spriteGroupId); - void setGroupCase0_5(int spriteGroupId, int value); - void setGroupCase0_6(int spriteGroupId, int value); - void setGroupCase0_7(int spriteGroupId, int value); - void setGroupbbox(int spriteGroupId, int x1, int y1, int x2, int y2); - void setGroupzorderPriority(int spriteGroupId, int value); - void setGrouptx_ty(int spriteGroupId, int value1, int value2); + void moveGroupMembers(int spriteGroupId, int value1, int value2); + void setGroupMembersPriority(int spriteGroupId, int value); + void setGroupMembersGroup(int spriteGroupId, int value); + void setGroupMembersUpdateType(int spriteGroupId, int value); + void setGroupMembersResetSprite(int spriteGroupId); + void setGroupMembersAnimationSpeed(int spriteGroupId, int value); + void setGroupMembersAutoAnimFlag(int spriteGroupId, int value); + void setGroupMembersShadow(int spriteGroupId, int value); + void setGroupBounds(int spriteGroupId, int x1, int y1, int x2, int y2); + void setGroupPriority(int spriteGroupId, int value); + void moveGroup(int spriteGroupId, int value1, int value2); void setGroupinc_tx_ty(int spriteGroupId, int value1, int value2); - void setGroupdstResNum(int spriteGroupId, int value); - void setGroupscaling(int spriteGroupId); + void setGroupImage(int spriteGroupId, int value); + void setGroupScaling(int spriteGroupId); void setGroupScale_x_ratio_mul(int spriteGroupId, int value); void setGroupScale_x_ratio_div(int spriteGroupId, int value); void setGroupScale_y_ratio_mul(int spriteGroupId, int value); void setGroupScale_y_ratio_div(int spriteGroupId, int value); - void setGroupflagClipBoxAnd(int spriteGroupId); + void resetGroupBounds(int spriteGroupId); void allocTables(int numSprites, int numGroups, int numMaxSprites); void resetGroup(int spriteGroupId); void resetTables(bool refreshScreen); - void addImageToList(int spriteId, int imageNum, int *spriteIdptr); + void setSpriteImage(int spriteId, int imageNum); private: ScummEngine_v90he *_vm; }; diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 0556d54adb..e33a78938a 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -955,9 +955,9 @@ void Wiz::displayWizImage(WizImage *pwi) { wi->zorder = 0; wi->state = pwi->state; wi->flags = pwi->flags; - wi->xmapNum = 0; + wi->shadow = 0; wi->field_390 = 0; - wi->paletteNum = 0; + wi->palette = 0; ++_imagesNum; } else if (pwi->flags & kWIFIsPolygon) { drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, 0, 0, 0); @@ -967,21 +967,21 @@ void Wiz::displayWizImage(WizImage *pwi) { } } -uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int xmapNum, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum) { - debug(2, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d xmapNum %d field_390 %d dstResNum %d paletteNum %d)", resNum, x1, y1, flags, zorder, xmapNum, field_390, dstResNum, paletteNum); +uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int palette) { + debug(2, "drawWizImage(resNum %d, x1 %d y1 %d flags 0x%X zorder %d shadow %d field_390 %d dstResNum %d palette %d)", resNum, x1, y1, flags, zorder, shadow, field_390, dstResNum, palette); uint8 *dst = NULL; const uint8 *palPtr = NULL; if (_vm->_heversion >= 99) { - if (paletteNum) { - palPtr = _vm->_hePalettes + paletteNum * 1024 + 768; + if (palette) { + palPtr = _vm->_hePalettes + palette * 1024 + 768; } else { palPtr = _vm->_hePalettes + 1792; } } const uint8 *xmap = NULL; - if (xmapNum) { + if (shadow) { // TODO: Handle 'XMAP' data for shadows } @@ -1182,7 +1182,7 @@ struct PolygonDrawData { } }; -void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int xmapNum, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int paletteNum) { +void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int scale, const Common::Rect *r, int flags, int dstResNum, int palette) { Common::Point pts[4]; int32 w, h; getWizImageDim(resNum, state, w, h); @@ -1192,10 +1192,10 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int x pts[2].y = pts[3].y = h / 2 - 1; // transform points - if (zoom != 256) { + if (scale != 256) { for (int i = 0; i < 4; ++i) { - pts[i].x = pts[i].x * zoom / 256; - pts[i].y = pts[i].y * zoom / 256; + pts[i].x = pts[i].x * scale / 256; + pts[i].y = pts[i].y * scale / 256; } } if (angle) @@ -1206,10 +1206,10 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int x pts[i].y += po_y; } - if (zoom != 256) { - debug(1, "drawWizComplexPolygon() zoom not implemented"); + if (scale != 256) { + debug(1, "drawWizComplexPolygon() scale not implemented"); - //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstPtr, paletteNum, xmapPtr); + //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstPtr, palette, xmapPtr); } else { debug(1, "drawWizComplexPolygon() angle partially implemented"); @@ -1226,27 +1226,27 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int x switch(angle) { case 270: flags |= kWIFFlipX | kWIFFlipY; - //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, paletteNum); + //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette); break; case 180: flags |= kWIFFlipX | kWIFFlipY; - drawWizImage(resNum, state, x1, y1, 0, xmapNum, 0, r, flags, dstResNum, paletteNum); + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; case 90: - //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, paletteNum); + //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette); break; case 0: - drawWizImage(resNum, state, x1, y1, 0, xmapNum, 0, r, flags, dstResNum, paletteNum); + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; default: - //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstResNum, paletteNum, xmapPtr); + //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstResNum, palette, xmapPtr); break; } } } -void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int xmapNum, int dstResNum, int paletteNum) { - debug(1, "drawWizPolygon(resNum %d, id %d, flags 0x%X, xmapNum %d paletteNum %d)", resNum, id, flags, xmapNum, paletteNum); +void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int shadow, int dstResNum, int palette) { + debug(1, "drawWizPolygon(resNum %d, id %d, flags 0x%X, shadow %d palette %d)", resNum, id, flags, shadow, palette); int i; WizPolygon *wp = NULL; for (i = 0; i < ARRAYSIZE(_polygons); ++i) { @@ -1262,7 +1262,7 @@ void Wiz::drawWizPolygon(int resNum, int state, int id, int flags, int xmapNum, error("Invalid point count %d for Polygon %d", wp->numVerts, id); } const Common::Rect *r = NULL; - uint8 *srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, xmapNum, 0, r, kWIFBlitToMemBuffer, 0, paletteNum); + uint8 *srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, palette); if (srcWizBuf) { uint8 *dst; int32 wizW, wizH; @@ -1357,10 +1357,10 @@ void Wiz::flushWizBuffer() { for (int i = 0; i < _imagesNum; ++i) { WizImage *pwi = &_images[i]; if (pwi->flags & kWIFIsPolygon) { - drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->xmapNum, 0, pwi->paletteNum); + drawWizPolygon(pwi->resNum, pwi->state, pwi->x1, pwi->flags, pwi->shadow, 0, pwi->palette); } else { const Common::Rect *r = NULL; - drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->xmapNum, pwi->field_390, r, pwi->flags, 0, pwi->paletteNum); + drawWizImage(pwi->resNum, pwi->state, pwi->x1, pwi->y1, pwi->zorder, pwi->shadow, pwi->field_390, r, pwi->flags, 0, pwi->palette); } } _imagesNum = 0; @@ -1403,18 +1403,18 @@ void Wiz::loadWizCursor(int resId) { } void Wiz::displayWizComplexImage(const WizParameters *params) { - int maskImgResNum = 0; + int sourceImage = 0; if (params->processFlags & kWPFMaskImg) { - maskImgResNum = params->maskImgResNum; + sourceImage = params->sourceImage; warning("displayWizComplexImage() unhandled flag 0x80000"); } - int paletteNum = 0; + int palette = 0; if (params->processFlags & kWPFPaletteNum) { - paletteNum = params->img.paletteNum; + palette = params->img.palette; } - int zoom = 256; - if (params->processFlags & kWPFZoom) { - zoom = params->zoom; + int scale = 256; + if (params->processFlags & kWPFScaled) { + scale = params->scale; } int rotationAngle = 0; if (params->processFlags & kWPFRotate) { @@ -1434,9 +1434,9 @@ void Wiz::displayWizComplexImage(const WizParameters *params) { po_x = params->img.x1; po_y = params->img.y1; } - int xmapNum = 0; - if (params->processFlags & kWPFXmapNum) { - xmapNum = params->xmapNum; + int shadow = 0; + if (params->processFlags & kWPFShadow) { + shadow = params->shadow; } int field_390 = 0; if (params->processFlags & 0x200000) { @@ -1468,7 +1468,7 @@ void Wiz::displayWizComplexImage(const WizParameters *params) { } if (_vm->_fullRedraw && dstResNum == 0) { - if (maskImgResNum != 0 || (params->processFlags & (kWPFZoom | kWPFRotate))) + if (sourceImage != 0 || (params->processFlags & (kWPFScaled | kWPFRotate))) error("Can't do this command in the enter script."); assert(_imagesNum < ARRAYSIZE(_images)); @@ -1479,20 +1479,20 @@ void Wiz::displayWizComplexImage(const WizParameters *params) { pwi->zorder = params->img.zorder; pwi->state = state; pwi->flags = flags; - pwi->xmapNum = xmapNum; + pwi->shadow = shadow; pwi->field_390 = field_390; - pwi->paletteNum = paletteNum; + pwi->palette = palette; ++_imagesNum; } else { - if (maskImgResNum != 0) { + if (sourceImage != 0) { // TODO - } else if (params->processFlags & (kWPFZoom | kWPFRotate)) { - drawWizComplexPolygon(params->img.resNum, state, po_x, po_y, xmapNum, rotationAngle, zoom, r, flags, dstResNum, paletteNum); + } else if (params->processFlags & (kWPFScaled | kWPFRotate)) { + drawWizComplexPolygon(params->img.resNum, state, po_x, po_y, shadow, rotationAngle, scale, r, flags, dstResNum, palette); } else { if (flags & kWIFIsPolygon) { - drawWizPolygon(params->img.resNum, state, po_x, flags, xmapNum, dstResNum, paletteNum); // XXX , VAR(VAR_WIZ_TCOLOR)); + drawWizPolygon(params->img.resNum, state, po_x, flags, shadow, dstResNum, palette); // XXX , VAR(VAR_WIZ_TCOLOR)); } else { - drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, xmapNum, field_390, r, flags, dstResNum, paletteNum); + drawWizImage(params->img.resNum, state, po_x, po_y, params->img.zorder, shadow, field_390, r, flags, dstResNum, palette); } } } diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index c02bc99071..270a73daaf 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -42,9 +42,9 @@ struct WizImage { int zorder; int state; int flags; - int xmapNum; + int shadow; int field_390; - int paletteNum; + int palette; }; struct WizParameters { @@ -64,13 +64,13 @@ struct WizParameters { int compType; int fileWriteMode; int angle; - int zoom; - int xmapNum; + int scale; + int shadow; int field_164; int field_168; int resDefImgW; int resDefImgH; - int maskImgResNum; + int sourceImage; int field_180; int field_184; uint8 remapColor[256]; @@ -97,7 +97,7 @@ struct WizParameters { Common::Rect box2; int field_23DE; int spriteId; - int groupNum; + int spriteGroup; int field_23EA; WizImage img; }; @@ -116,8 +116,8 @@ enum WizImageFlags { enum WizProcessFlags { kWPFSetPos = 0x1, - kWPFXmapNum = 0x4, - kWPFZoom = 0x8, + kWPFShadow = 0x4, + kWPFScaled = 0x8, kWPFRotate = 0x10, kWPFNewFlags = 0x20, kWPFRemapPalette = 0x40, @@ -179,9 +179,9 @@ public: void displayWizComplexImage(const WizParameters *params); void displayWizImage(WizImage *pwi); void captureWizImage(int resNum, const Common::Rect& r, bool frontBuffer, int compType); - uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int xmapNum, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int paletteNum); - void drawWizPolygon(int resNum, int state, int id, int flags, int xmapNum, int dstResNum, int paletteNum); - void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int xmapNum, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int paletteNum); + uint8 *drawWizImage(int resNum, int state, int x1, int y1, int zorder, int shadow, int field_390, const Common::Rect *clipBox, int flags, int dstResNum, int palette); + void drawWizPolygon(int resNum, int state, int id, int flags, int shadow, int dstResNum, int palette); + void drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int shadow, int angle, int zoom, const Common::Rect *r, int flags, int dstResNum, int palette); void processWizImage(const WizParameters *params); static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch); |