[Scummvm-git-logs] scummvm master -> 55832ef8851be42e3c62887dfc67275b7fece2c8
AndywinXp
noreply at scummvm.org
Fri Sep 20 21:08:57 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
55832ef885 SCUMM: Relabel v2 object states
Commit: 55832ef8851be42e3c62887dfc67275b7fece2c8
https://github.com/scummvm/scummvm/commit/55832ef8851be42e3c62887dfc67275b7fece2c8
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-09-20T23:08:51+02:00
Commit Message:
SCUMM: Relabel v2 object states
This has been bugging me for a while...
Note that ifNotStateCommon and ifStateCommon have
been semantically inverted until now. I also fixed their
naming now to reflect what they are actually doing.
Changed paths:
engines/scumm/object.cpp
engines/scumm/object.h
engines/scumm/script_v0.cpp
engines/scumm/script_v2.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm_v2.h
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index dc208ecb423..de537c0c8af 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -311,7 +311,7 @@ int ScummEngine::getState(int obj) {
// blowing up the mansion, should they feel the urge to.
if (_game.id == GID_MANIAC && _game.version != 0 && _game.platform != Common::kPlatformNES && (obj == 182 || obj == 193))
- _objectStateTable[obj] |= kObjectState_08;
+ _objectStateTable[obj] |= kObjectStateIntrinsic;
}
return _objectStateTable[obj];
@@ -550,7 +550,7 @@ int ScummEngine::getObjActToObjActDist(int a, int b) {
int ScummEngine::findObject(int x, int y) {
int i, b;
byte a;
- const int mask = (_game.version <= 2) ? kObjectState_08 : 0xF;
+ const int mask = (_game.version <= 2) ? kObjectStateIntrinsic : 0xF;
for (i = 1; i < _numLocalObjects; i++) {
if ((_objs[i].obj_nr < 1) || getClass(_objs[i].obj_nr, kObjectClassUntouchable))
@@ -593,7 +593,7 @@ int ScummEngine::findObject(int x, int y) {
void ScummEngine::drawRoomObject(int i, int arg) {
ObjectData *od;
byte a;
- const int mask = (_game.version <= 2) ? kObjectState_08 : 0xF;
+ const int mask = (_game.version <= 2) ? kObjectStateIntrinsic : 0xF;
od = &_objs[i];
if ((i < 1) || (od->obj_nr < 1) || !od->state)
@@ -612,7 +612,7 @@ void ScummEngine::drawRoomObject(int i, int arg) {
void ScummEngine::drawRoomObjects(int arg) {
int i;
- const int mask = (_game.version <= 2) ? kObjectState_08 : 0xF;
+ const int mask = (_game.version <= 2) ? kObjectStateIntrinsic : 0xF;
if (_game.heversion >= 60) {
// In HE games, normal objects are drawn, followed by FlObjects.
diff --git a/engines/scumm/object.h b/engines/scumm/object.h
index 2ddbc44038d..a18e501f2d7 100644
--- a/engines/scumm/object.h
+++ b/engines/scumm/object.h
@@ -58,14 +58,7 @@ enum ObjectStateV2 {
kObjectStatePickupable = 1,
kObjectStateUntouchable = 2,
kObjectStateLocked = 4,
-
- // FIXME: Not quite sure how to name state 8. It seems to mark some kind
- // of "activation state" for the given object. E.g. is a door open?
- // Is a drawer extended? In addition it is used to toggle the look
- // of objects that the user can "pick up" (i.e. it is set in
- // o2_pickupObject together with kObjectStateUntouchable). So in a sense,
- // it can also mean "invisible" in some situations.
- kObjectState_08 = 8
+ kObjectStateIntrinsic = 8 // Some kind of general ON/OFF property for an object
};
struct ObjectData {
diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp
index 78f518a5c0d..f6dac08bb7f 100644
--- a/engines/scumm/script_v0.cpp
+++ b/engines/scumm/script_v0.cpp
@@ -52,7 +52,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x0c, o_loadSound);
OPCODE(0x0d, o_printEgo);
OPCODE(0x0e, o_putActorAtObject);
- OPCODE(0x0f, o2_clearState02);
+ OPCODE(0x0f, o2_setStateTouchable);
/* 10 */
OPCODE(0x10, o5_breakHere);
OPCODE(0x11, o_animateActor);
@@ -62,7 +62,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x14, o_print);
OPCODE(0x15, o5_walkActorToActor);
OPCODE(0x16, o5_getRandomNr);
- OPCODE(0x17, o2_clearState08);
+ OPCODE(0x17, o2_setStateIntrinsicOff);
/* 18 */
OPCODE(0x18, o5_jumpRelative);
OPCODE(0x19, o_stopCurrentScript);
@@ -72,7 +72,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x1c, o5_startSound);
OPCODE(0x1d, o_setBitVar);
OPCODE(0x1e, o2_walkActorTo);
- OPCODE(0x1f, o2_ifState04);
+ OPCODE(0x1f, o2_ifStateUnlocked);
/* 20 */
OPCODE(0x20, o5_stopMusic);
OPCODE(0x21, o2_putActor);
@@ -92,7 +92,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x2c, o_stopCurrentScript);
OPCODE(0x2d, o2_putActorInRoom);
OPCODE(0x2e, o_print);
- OPCODE(0x2f, o2_ifState08);
+ OPCODE(0x2f, o2_ifStateIntrinsicOff);
/* 30 */
OPCODE(0x30, o_loadCostume);
OPCODE(0x31, o_getBitVar);
@@ -102,7 +102,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x34, o5_getDist);
OPCODE(0x35, o_stopCurrentScript);
OPCODE(0x36, o_walkActorToObject);
- OPCODE(0x37, o2_clearState04);
+ OPCODE(0x37, o2_setStateUnlocked);
/* 38 */
OPCODE(0x38, o2_isLessEqual);
OPCODE(0x39, o_stopCurrentScript);
@@ -112,7 +112,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x3c, o5_stopSound);
OPCODE(0x3d, o_setBitVar);
OPCODE(0x3e, o2_walkActorTo);
- OPCODE(0x3f, o2_ifState02);
+ OPCODE(0x3f, o2_ifStateTouchable);
/* 40 */
OPCODE(0x40, o_cutscene);
OPCODE(0x41, o2_putActor);
@@ -132,7 +132,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x4c, o_loadScript);
OPCODE(0x4d, o_lockRoom);
OPCODE(0x4e, o_putActorAtObject);
- OPCODE(0x4f, o2_clearState02);
+ OPCODE(0x4f, o2_setStateTouchable);
/* 50 */
OPCODE(0x50, o_nop);
OPCODE(0x51, o_animateActor);
@@ -142,7 +142,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x54, o_setObjectName);
OPCODE(0x55, o5_walkActorToActor);
OPCODE(0x56, o_getActorMoving);
- OPCODE(0x57, o2_clearState08);
+ OPCODE(0x57, o2_setStateIntrinsicOff);
/* 58 */
OPCODE(0x58, o2_beginOverride);
OPCODE(0x59, o_stopCurrentScript);
@@ -152,7 +152,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x5c, o5_startSound);
OPCODE(0x5d, o_setBitVar);
OPCODE(0x5e, o2_walkActorTo);
- OPCODE(0x5f, o2_ifState04);
+ OPCODE(0x5f, o2_ifStateUnlocked);
/* 60 */
OPCODE(0x60, o_setMode);
OPCODE(0x61, o2_putActor);
@@ -172,7 +172,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x6c, o_stopCurrentScript);
OPCODE(0x6d, o2_putActorInRoom);
OPCODE(0x6e, o_screenPrepare);
- OPCODE(0x6f, o2_ifState08);
+ OPCODE(0x6f, o2_ifStateIntrinsicOff);
/* 70 */
OPCODE(0x70, o_lights);
OPCODE(0x71, o_getBitVar);
@@ -182,7 +182,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x74, o5_getDist);
OPCODE(0x75, o_printEgo);
OPCODE(0x76, o_walkActorToObject);
- OPCODE(0x77, o2_clearState04);
+ OPCODE(0x77, o2_setStateUnlocked);
/* 78 */
OPCODE(0x78, o2_isGreater);
OPCODE(0x79, o_stopCurrentScript);
@@ -192,7 +192,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x7c, o5_isSoundRunning);
OPCODE(0x7d, o_setBitVar);
OPCODE(0x7e, o2_walkActorTo);
- OPCODE(0x7f, o2_ifNotState02);
+ OPCODE(0x7f, o2_ifStateUntouchable);
/* 80 */
OPCODE(0x80, o_stopCurrentScript);
OPCODE(0x81, o2_putActor);
@@ -212,7 +212,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x8c, o_loadSound);
OPCODE(0x8d, o_stopCurrentScript);
OPCODE(0x8e, o_putActorAtObject);
- OPCODE(0x8f, o2_setState02);
+ OPCODE(0x8f, o2_setStateUntouchable);
/* 90 */
OPCODE(0x90, o_pickupObject);
OPCODE(0x91, o_animateActor);
@@ -222,7 +222,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x94, o5_print);
OPCODE(0x95, o2_actorFromPos);
OPCODE(0x96, o_stopCurrentScript);
- OPCODE(0x97, o2_setState08);
+ OPCODE(0x97, o2_setStateIntrinsicOn);
/* 98 */
OPCODE(0x98, o2_restart);
OPCODE(0x99, o_stopCurrentScript);
@@ -232,7 +232,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0x9c, o5_startSound);
OPCODE(0x9d, o_setBitVar);
OPCODE(0x9e, o2_walkActorTo);
- OPCODE(0x9f, o2_ifNotState04);
+ OPCODE(0x9f, o2_ifStateLocked);
/* A0 */
OPCODE(0xa0, o5_stopObjectCode);
OPCODE(0xa1, o2_putActor);
@@ -252,7 +252,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xac, o_stopCurrentScript);
OPCODE(0xad, o2_putActorInRoom);
OPCODE(0xae, o_print);
- OPCODE(0xaf, o2_ifNotState08);
+ OPCODE(0xaf, o2_ifStateIntrinsicOn);
/* B0 */
OPCODE(0xb0, o_loadCostume);
OPCODE(0xb1, o_getBitVar);
@@ -262,7 +262,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xb4, o5_getDist);
OPCODE(0xb5, o_stopCurrentScript);
OPCODE(0xb6, o_walkActorToObject);
- OPCODE(0xb7, o2_setState04);
+ OPCODE(0xb7, o2_setStateLocked);
/* B8 */
OPCODE(0xb8, o2_isLessEqual);
OPCODE(0xb9, o_stopCurrentScript);
@@ -272,7 +272,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xbc, o5_stopSound);
OPCODE(0xbd, o_setBitVar);
OPCODE(0xbe, o2_walkActorTo);
- OPCODE(0xbf, o2_ifNotState02);
+ OPCODE(0xbf, o2_ifStateUntouchable);
/* C0 */
OPCODE(0xc0, o_endCutscene);
OPCODE(0xc1, o2_putActor);
@@ -292,7 +292,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xcc, o_loadScript);
OPCODE(0xcd, o_unlockRoom);
OPCODE(0xce, o_putActorAtObject);
- OPCODE(0xcf, o2_setState02);
+ OPCODE(0xcf, o2_setStateUntouchable);
/* D0 */
OPCODE(0xd0, o_nop);
OPCODE(0xd1, o_animateActor);
@@ -302,7 +302,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xd4, o_setObjectName);
OPCODE(0xd5, o2_actorFromPos);
OPCODE(0xd6, o_getActorMoving);
- OPCODE(0xd7, o2_setState08);
+ OPCODE(0xd7, o2_setStateIntrinsicOn);
/* D8 */
OPCODE(0xd8, o_stopCurrentScript);
OPCODE(0xd9, o_stopCurrentScript);
@@ -312,7 +312,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xdc, o5_startSound);
OPCODE(0xdd, o_setBitVar);
OPCODE(0xde, o2_walkActorTo);
- OPCODE(0xdf, o2_ifNotState04);
+ OPCODE(0xdf, o2_ifStateLocked);
/* E0 */
OPCODE(0xe0, o_setMode);
OPCODE(0xe1, o2_putActor);
@@ -332,7 +332,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xec, o_stopCurrentScript);
OPCODE(0xed, o2_putActorInRoom);
OPCODE(0xee, o2_dummy);
- OPCODE(0xef, o2_ifNotState08);
+ OPCODE(0xef, o2_ifStateIntrinsicOn);
/* F0 */
OPCODE(0xf0, o_lights);
OPCODE(0xf1, o_getBitVar);
@@ -342,7 +342,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xf4, o5_getDist);
OPCODE(0xf5, o_stopCurrentScript);
OPCODE(0xf6, o_walkActorToObject);
- OPCODE(0xf7, o2_setState04);
+ OPCODE(0xf7, o2_setStateLocked);
/* F8 */
OPCODE(0xf8, o2_isGreater);
OPCODE(0xf9, o_stopCurrentScript);
@@ -352,7 +352,7 @@ void ScummEngine_v0::setupOpcodes() {
OPCODE(0xfc, o5_isSoundRunning);
OPCODE(0xfd, o_setBitVar);
OPCODE(0xfe, o2_walkActorTo);
- OPCODE(0xff, o2_ifState02);
+ OPCODE(0xff, o2_ifStateTouchable);
}
int ScummEngine_v0::getVarOrDirectWord(byte mask) {
@@ -777,7 +777,7 @@ void ScummEngine_v0::o_pickupObject() {
addObjectToInventory(obj, _roomResource);
markObjectRectAsDirty(obj);
putOwner(obj, VAR(VAR_EGO));
- putState(obj, getState(obj) | kObjectState_08 | kObjectStateUntouchable);
+ putState(obj, getState(obj) | kObjectStateIntrinsic | kObjectStateUntouchable);
clearDrawObjectQueue();
runInventoryScript(1);
diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp
index 6d3f62ddf1e..d39e6d5ca26 100644
--- a/engines/scumm/script_v2.cpp
+++ b/engines/scumm/script_v2.cpp
@@ -46,7 +46,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x04, o2_isGreaterEqual);
OPCODE(0x05, o2_drawObject);
OPCODE(0x06, o2_getActorElevation);
- OPCODE(0x07, o2_setState08);
+ OPCODE(0x07, o2_setStateIntrinsicOn);
/* 08 */
OPCODE(0x08, o5_isNotEqual);
OPCODE(0x09, o5_faceActor);
@@ -56,7 +56,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x0c, o2_resourceRoutines);
OPCODE(0x0d, o5_walkActorToActor);
OPCODE(0x0e, o2_putActorAtObject);
- OPCODE(0x0f, o2_ifNotState08);
+ OPCODE(0x0f, o2_ifStateIntrinsicOn);
/* 10 */
OPCODE(0x10, o5_getObjectOwner);
OPCODE(0x11, o5_animateActor);
@@ -66,7 +66,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x14, o5_print);
OPCODE(0x15, o2_actorFromPos);
OPCODE(0x16, o5_getRandomNr);
- OPCODE(0x17, o2_clearState02);
+ OPCODE(0x17, o2_setStateTouchable);
/* 18 */
OPCODE(0x18, o5_jumpRelative);
OPCODE(0x19, o2_doSentence);
@@ -76,7 +76,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x1c, o5_startSound);
OPCODE(0x1d, o2_ifClassOfIs);
OPCODE(0x1e, o2_walkActorTo);
- OPCODE(0x1f, o2_ifState02);
+ OPCODE(0x1f, o2_ifStateTouchable);
/* 20 */
OPCODE(0x20, o5_stopMusic);
OPCODE(0x21, o2_putActor);
@@ -86,7 +86,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x24, o2_loadRoomWithEgo);
OPCODE(0x25, o2_drawObject);
OPCODE(0x26, o5_setVarRange);
- OPCODE(0x27, o2_setState04);
+ OPCODE(0x27, o2_setStateLocked);
/* 28 */
OPCODE(0x28, o5_equalZero);
OPCODE(0x29, o2_setOwnerOf);
@@ -96,7 +96,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x2c, o2_assignVarByte);
OPCODE(0x2d, o2_putActorInRoom);
OPCODE(0x2e, o2_delay);
- OPCODE(0x2f, o2_ifNotState04);
+ OPCODE(0x2f, o2_ifStateLocked);
/* 30 */
OPCODE(0x30, o3_setBoxFlags);
OPCODE(0x31, o2_getBitVar);
@@ -106,7 +106,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x34, o5_getDist);
OPCODE(0x35, o2_findObject);
OPCODE(0x36, o2_walkActorToObject);
- OPCODE(0x37, o2_setState01);
+ OPCODE(0x37, o2_setStatePickupable);
/* 38 */
OPCODE(0x38, o2_isLessEqual);
OPCODE(0x39, o2_doSentence);
@@ -116,7 +116,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x3c, o5_stopSound);
OPCODE(0x3d, o2_setActorElevation);
OPCODE(0x3e, o2_walkActorTo);
- OPCODE(0x3f, o2_ifNotState01);
+ OPCODE(0x3f, o2_ifStatePickupable);
/* 40 */
OPCODE(0x40, o2_cutscene);
OPCODE(0x41, o2_putActor);
@@ -126,7 +126,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x44, o2_isLess);
OPCODE(0x45, o2_drawObject);
OPCODE(0x46, o5_increment);
- OPCODE(0x47, o2_clearState08);
+ OPCODE(0x47, o2_setStateIntrinsicOff);
/* 48 */
OPCODE(0x48, o5_isEqual);
OPCODE(0x49, o5_faceActor);
@@ -136,7 +136,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x4c, o2_waitForSentence);
OPCODE(0x4d, o5_walkActorToActor);
OPCODE(0x4e, o2_putActorAtObject);
- OPCODE(0x4f, o2_ifState08);
+ OPCODE(0x4f, o2_ifStateIntrinsicOff);
/* 50 */
OPCODE(0x50, o2_pickupObject);
OPCODE(0x51, o5_animateActor);
@@ -146,7 +146,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x54, o5_setObjectName);
OPCODE(0x55, o2_actorFromPos);
OPCODE(0x56, o5_getActorMoving);
- OPCODE(0x57, o2_setState02);
+ OPCODE(0x57, o2_setStateUntouchable);
/* 58 */
OPCODE(0x58, o2_beginOverride);
OPCODE(0x59, o2_doSentence);
@@ -156,7 +156,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x5c, o2_dummy);
OPCODE(0x5d, o2_ifClassOfIs);
OPCODE(0x5e, o2_walkActorTo);
- OPCODE(0x5f, o2_ifNotState02);
+ OPCODE(0x5f, o2_ifStateUntouchable);
/* 60 */
OPCODE(0x60, o2_cursorCommand);
OPCODE(0x61, o2_putActor);
@@ -166,7 +166,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x64, o2_loadRoomWithEgo);
OPCODE(0x65, o2_drawObject);
OPCODE(0x66, o5_getClosestObjActor);
- OPCODE(0x67, o2_clearState04);
+ OPCODE(0x67, o2_setStateUnlocked);
/* 68 */
OPCODE(0x68, o5_isScriptRunning);
OPCODE(0x69, o2_setOwnerOf);
@@ -176,7 +176,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x6c, o2_getObjPreposition);
OPCODE(0x6d, o2_putActorInRoom);
OPCODE(0x6e, o2_dummy);
- OPCODE(0x6f, o2_ifState04);
+ OPCODE(0x6f, o2_ifStateUnlocked);
/* 70 */
OPCODE(0x70, o2_lights);
OPCODE(0x71, o5_getActorCostume);
@@ -186,7 +186,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x74, o5_getDist);
OPCODE(0x75, o2_findObject);
OPCODE(0x76, o2_walkActorToObject);
- OPCODE(0x77, o2_clearState01);
+ OPCODE(0x77, o2_setStateUnpickupable);
/* 78 */
OPCODE(0x78, o2_isGreater);
OPCODE(0x79, o2_doSentence);
@@ -196,7 +196,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x7c, o5_isSoundRunning);
OPCODE(0x7d, o2_setActorElevation);
OPCODE(0x7e, o2_walkActorTo);
- OPCODE(0x7f, o2_ifState01);
+ OPCODE(0x7f, o2_ifStateUnpickupable);
/* 80 */
OPCODE(0x80, o5_breakHere);
OPCODE(0x81, o2_putActor);
@@ -206,7 +206,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x84, o2_isGreaterEqual);
OPCODE(0x85, o2_drawObject);
OPCODE(0x86, o2_getActorElevation);
- OPCODE(0x87, o2_setState08);
+ OPCODE(0x87, o2_setStateIntrinsicOn);
/* 88 */
OPCODE(0x88, o5_isNotEqual);
OPCODE(0x89, o5_faceActor);
@@ -216,7 +216,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x8c, o2_resourceRoutines);
OPCODE(0x8d, o5_walkActorToActor);
OPCODE(0x8e, o2_putActorAtObject);
- OPCODE(0x8f, o2_ifNotState08);
+ OPCODE(0x8f, o2_ifStateIntrinsicOn);
/* 90 */
OPCODE(0x90, o5_getObjectOwner);
OPCODE(0x91, o5_animateActor);
@@ -226,7 +226,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x94, o5_print);
OPCODE(0x95, o2_actorFromPos);
OPCODE(0x96, o5_getRandomNr);
- OPCODE(0x97, o2_clearState02);
+ OPCODE(0x97, o2_setStateTouchable);
/* 98 */
OPCODE(0x98, o2_restart);
OPCODE(0x99, o2_doSentence);
@@ -236,7 +236,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0x9c, o5_startSound);
OPCODE(0x9d, o2_ifClassOfIs);
OPCODE(0x9e, o2_walkActorTo);
- OPCODE(0x9f, o2_ifState02);
+ OPCODE(0x9f, o2_ifStateTouchable);
/* A0 */
OPCODE(0xa0, o5_stopObjectCode);
OPCODE(0xa1, o2_putActor);
@@ -246,7 +246,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xa4, o2_loadRoomWithEgo);
OPCODE(0xa5, o2_drawObject);
OPCODE(0xa6, o5_setVarRange);
- OPCODE(0xa7, o2_setState04);
+ OPCODE(0xa7, o2_setStateLocked);
/* A8 */
OPCODE(0xa8, o5_notEqualZero);
OPCODE(0xa9, o2_setOwnerOf);
@@ -256,7 +256,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xac, o2_drawSentence);
OPCODE(0xad, o2_putActorInRoom);
OPCODE(0xae, o2_waitForMessage);
- OPCODE(0xaf, o2_ifNotState04);
+ OPCODE(0xaf, o2_ifStateLocked);
/* B0 */
OPCODE(0xb0, o3_setBoxFlags);
OPCODE(0xb1, o2_getBitVar);
@@ -266,7 +266,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xb4, o5_getDist);
OPCODE(0xb5, o2_findObject);
OPCODE(0xb6, o2_walkActorToObject);
- OPCODE(0xb7, o2_setState01);
+ OPCODE(0xb7, o2_setStatePickupable);
/* B8 */
OPCODE(0xb8, o2_isLessEqual);
OPCODE(0xb9, o2_doSentence);
@@ -276,7 +276,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xbc, o5_stopSound);
OPCODE(0xbd, o2_setActorElevation);
OPCODE(0xbe, o2_walkActorTo);
- OPCODE(0xbf, o2_ifNotState01);
+ OPCODE(0xbf, o2_ifStatePickupable);
/* C0 */
OPCODE(0xc0, o2_endCutscene);
OPCODE(0xc1, o2_putActor);
@@ -286,7 +286,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xc4, o2_isLess);
OPCODE(0xc5, o2_drawObject);
OPCODE(0xc6, o5_decrement);
- OPCODE(0xc7, o2_clearState08);
+ OPCODE(0xc7, o2_setStateIntrinsicOff);
/* C8 */
OPCODE(0xc8, o5_isEqual);
OPCODE(0xc9, o5_faceActor);
@@ -296,7 +296,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xcc, o5_pseudoRoom);
OPCODE(0xcd, o5_walkActorToActor);
OPCODE(0xce, o2_putActorAtObject);
- OPCODE(0xcf, o2_ifState08);
+ OPCODE(0xcf, o2_ifStateIntrinsicOff);
/* D0 */
OPCODE(0xd0, o2_pickupObject);
OPCODE(0xd1, o5_animateActor);
@@ -306,7 +306,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xd4, o5_setObjectName);
OPCODE(0xd5, o2_actorFromPos);
OPCODE(0xd6, o5_getActorMoving);
- OPCODE(0xd7, o2_setState02);
+ OPCODE(0xd7, o2_setStateUntouchable);
/* D8 */
OPCODE(0xd8, o5_printEgo);
OPCODE(0xd9, o2_doSentence);
@@ -316,7 +316,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xdc, o2_dummy);
OPCODE(0xdd, o2_ifClassOfIs);
OPCODE(0xde, o2_walkActorTo);
- OPCODE(0xdf, o2_ifNotState02);
+ OPCODE(0xdf, o2_ifStateUntouchable);
/* E0 */
OPCODE(0xe0, o2_cursorCommand);
OPCODE(0xe1, o2_putActor);
@@ -326,7 +326,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xe4, o2_loadRoomWithEgo);
OPCODE(0xe5, o2_drawObject);
OPCODE(0xe6, o5_getClosestObjActor);
- OPCODE(0xe7, o2_clearState04);
+ OPCODE(0xe7, o2_setStateUnlocked);
/* E8 */
OPCODE(0xe8, o5_isScriptRunning);
OPCODE(0xe9, o2_setOwnerOf);
@@ -336,7 +336,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xec, o2_getObjPreposition);
OPCODE(0xed, o2_putActorInRoom);
OPCODE(0xee, o2_dummy);
- OPCODE(0xef, o2_ifState04);
+ OPCODE(0xef, o2_ifStateUnlocked);
/* F0 */
OPCODE(0xf0, o2_lights);
OPCODE(0xf1, o5_getActorCostume);
@@ -346,7 +346,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xf4, o5_getDist);
OPCODE(0xf5, o2_findObject);
OPCODE(0xf6, o2_walkActorToObject);
- OPCODE(0xf7, o2_clearState01);
+ OPCODE(0xf7, o2_setStateUnpickupable);
/* F8 */
OPCODE(0xf8, o2_isGreater);
OPCODE(0xf9, o2_doSentence);
@@ -356,7 +356,7 @@ void ScummEngine_v2::setupOpcodes() {
OPCODE(0xfc, o5_isSoundRunning);
OPCODE(0xfd, o2_setActorElevation);
OPCODE(0xfe, o2_walkActorTo);
- OPCODE(0xff, o2_ifState01);
+ OPCODE(0xff, o2_ifStateUnpickupable);
}
#define SENTENCE_SCRIPT 2
@@ -510,53 +510,53 @@ void ScummEngine_v2::clearStateCommon(byte type) {
putState(obj, getState(obj) & ~type);
}
-void ScummEngine_v2::ifStateCommon(byte type) {
+void ScummEngine_v2::ifStateZeroCommon(byte type) {
int obj = getActiveObject();
jumpRelative((getState(obj) & type) != 0);
}
-void ScummEngine_v2::ifNotStateCommon(byte type) {
+void ScummEngine_v2::ifStateNotZeroCommon(byte type) {
int obj = getActiveObject();
jumpRelative((getState(obj) & type) == 0);
}
-void ScummEngine_v2::o2_setState08() {
+void ScummEngine_v2::o2_setStateIntrinsicOn() {
int obj = getActiveObject();
- putState(obj, getState(obj) | kObjectState_08);
+ putState(obj, getState(obj) | kObjectStateIntrinsic);
markObjectRectAsDirty(obj);
clearDrawObjectQueue();
}
-void ScummEngine_v2::o2_clearState08() {
+void ScummEngine_v2::o2_setStateIntrinsicOff() {
int obj = getActiveObject();
- putState(obj, getState(obj) & ~kObjectState_08);
+ putState(obj, getState(obj) & ~kObjectStateIntrinsic);
markObjectRectAsDirty(obj);
clearDrawObjectQueue();
}
-void ScummEngine_v2::o2_setState04() {
+void ScummEngine_v2::o2_setStateLocked() {
setStateCommon(kObjectStateLocked);
}
-void ScummEngine_v2::o2_clearState04() {
+void ScummEngine_v2::o2_setStateUnlocked() {
clearStateCommon(kObjectStateLocked);
}
-void ScummEngine_v2::o2_setState02() {
+void ScummEngine_v2::o2_setStateUntouchable() {
setStateCommon(kObjectStateUntouchable);
}
-void ScummEngine_v2::o2_clearState02() {
+void ScummEngine_v2::o2_setStateTouchable() {
clearStateCommon(kObjectStateUntouchable);
}
-void ScummEngine_v2::o2_setState01() {
+void ScummEngine_v2::o2_setStatePickupable() {
setStateCommon(kObjectStatePickupable);
}
-void ScummEngine_v2::o2_clearState01() {
+void ScummEngine_v2::o2_setStateUnpickupable() {
clearStateCommon(kObjectStatePickupable);
}
@@ -624,36 +624,36 @@ void ScummEngine_v2::o2_getBitVar() {
setResult((_scummVars[bit_var] & (1 << bit_offset)) ? 1 : 0);
}
-void ScummEngine_v2::o2_ifState08() {
- ifStateCommon(kObjectState_08);
+void ScummEngine_v2::o2_ifStateIntrinsicOff() {
+ ifStateZeroCommon(kObjectStateIntrinsic);
}
-void ScummEngine_v2::o2_ifNotState08() {
- ifNotStateCommon(kObjectState_08);
+void ScummEngine_v2::o2_ifStateIntrinsicOn() {
+ ifStateNotZeroCommon(kObjectStateIntrinsic);
}
-void ScummEngine_v2::o2_ifState04() {
- ifStateCommon(kObjectStateLocked);
+void ScummEngine_v2::o2_ifStateUnlocked() {
+ ifStateZeroCommon(kObjectStateLocked);
}
-void ScummEngine_v2::o2_ifNotState04() {
- ifNotStateCommon(kObjectStateLocked);
+void ScummEngine_v2::o2_ifStateLocked() {
+ ifStateNotZeroCommon(kObjectStateLocked);
}
-void ScummEngine_v2::o2_ifState02() {
- ifStateCommon(kObjectStateUntouchable);
+void ScummEngine_v2::o2_ifStateTouchable() {
+ ifStateZeroCommon(kObjectStateUntouchable);
}
-void ScummEngine_v2::o2_ifNotState02() {
- ifNotStateCommon(kObjectStateUntouchable);
+void ScummEngine_v2::o2_ifStateUntouchable() {
+ ifStateNotZeroCommon(kObjectStateUntouchable);
}
-void ScummEngine_v2::o2_ifState01() {
- ifStateCommon(kObjectStatePickupable);
+void ScummEngine_v2::o2_ifStateUnpickupable() {
+ ifStateZeroCommon(kObjectStatePickupable);
}
-void ScummEngine_v2::o2_ifNotState01() {
- ifNotStateCommon(kObjectStatePickupable);
+void ScummEngine_v2::o2_ifStatePickupable() {
+ ifStateNotZeroCommon(kObjectStatePickupable);
}
void ScummEngine_v2::o2_addIndirect() {
@@ -786,10 +786,10 @@ void ScummEngine_v2::o2_drawObject() {
i = _numLocalObjects;
while (i--) {
if (_objs[i].obj_nr && _objs[i].x_pos == x && _objs[i].y_pos == y && _objs[i].width == w && _objs[i].height == h)
- putState(_objs[i].obj_nr, getState(_objs[i].obj_nr) & ~kObjectState_08);
+ putState(_objs[i].obj_nr, getState(_objs[i].obj_nr) & ~kObjectStateIntrinsic);
}
- putState(obj, getState(od->obj_nr) | kObjectState_08);
+ putState(obj, getState(od->obj_nr) | kObjectStateIntrinsic);
}
void ScummEngine_v2::o2_resourceRoutines() {
@@ -1193,7 +1193,7 @@ void ScummEngine_v2::stopScriptCommon(int script) {
if (script == MM_SCRIPT(138)) {
int obj = MM_VALUE(124, 157);
- putState(obj, getState(obj) & ~kObjectState_08);
+ putState(obj, getState(obj) & ~kObjectStateIntrinsic);
}
}
}
@@ -1601,7 +1601,7 @@ void ScummEngine_v2::o2_pickupObject() {
addObjectToInventory(obj, _roomResource);
markObjectRectAsDirty(obj);
putOwner(obj, VAR(VAR_EGO));
- putState(obj, getState(obj) | kObjectState_08 | kObjectStateUntouchable);
+ putState(obj, getState(obj) | kObjectStateIntrinsic | kObjectStateUntouchable);
clearDrawObjectQueue();
runInventoryScript(1);
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 786025dab57..16c7cfca4e8 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -3075,7 +3075,7 @@ void ScummEngine_v2::terminateSaveMenuScript() {
int obj[] = {182, 193};
for (int i = 0; i < ARRAYSIZE(obj); i++) {
- putState(obj[i], getState(obj[i]) & ~kObjectState_08);
+ putState(obj[i], getState(obj[i]) & ~kObjectStateIntrinsic);
markObjectRectAsDirty(obj[i]);
clearDrawObjectQueue();
}
diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h
index 25a6f297b31..94fe410223d 100644
--- a/engines/scumm/scumm_v2.h
+++ b/engines/scumm/scumm_v2.h
@@ -88,8 +88,8 @@ protected:
protected:
virtual int getActiveObject();
- void ifStateCommon(byte type);
- void ifNotStateCommon(byte type);
+ void ifStateZeroCommon(byte type);
+ void ifStateNotZeroCommon(byte type);
void setStateCommon(byte type);
void clearStateCommon(byte type);
void stopScriptCommon(int script);
@@ -123,10 +123,10 @@ protected:
void o2_assignVarWordIndirect();
void o2_beginOverride();
void o2_chainScript();
- void o2_clearState01();
- void o2_clearState02();
- void o2_clearState04();
- void o2_clearState08();
+ void o2_setStateUnpickupable();
+ void o2_setStateTouchable();
+ void o2_setStateUnlocked();
+ void o2_setStateIntrinsicOff();
void o2_cursorCommand();
void o2_cutscene();
void o2_delay();
@@ -142,14 +142,14 @@ protected:
void o2_getBitVar();
void o2_getObjPreposition();
void o2_ifClassOfIs();
- void o2_ifNotState01();
- void o2_ifNotState02();
- void o2_ifNotState04();
- void o2_ifNotState08();
- void o2_ifState01();
- void o2_ifState02();
- void o2_ifState04();
- void o2_ifState08();
+ void o2_ifStatePickupable();
+ void o2_ifStateUntouchable();
+ void o2_ifStateLocked();
+ void o2_ifStateIntrinsicOn();
+ void o2_ifStateUnpickupable();
+ void o2_ifStateTouchable();
+ void o2_ifStateUnlocked();
+ void o2_ifStateIntrinsicOff();
void o2_isGreater();
void o2_isGreaterEqual();
void o2_isLess();
@@ -170,10 +170,10 @@ protected:
void o2_setCameraAt();
void o2_setObjPreposition();
void o2_setOwnerOf();
- void o2_setState01();
- void o2_setState02();
- void o2_setState04();
- void o2_setState08();
+ void o2_setStatePickupable();
+ void o2_setStateUntouchable();
+ void o2_setStateLocked();
+ void o2_setStateIntrinsicOn();
void o2_startScript();
void o2_stopScript();
void o2_subtract();
More information about the Scummvm-git-logs
mailing list