[Scummvm-git-logs] scummvm master -> 1f851955dcf6dcc054be4ba4f4aaf8413da78c34
mgerhardy
noreply at scummvm.org
Sat Mar 23 14:51:21 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8c114416d8 TWINE: lba2 opcodes
1f851955dc TWINE: renamed variables to match original sources
Commit: 8c114416d8eb4cf7cdda34497cf5650ad219cdfc
https://github.com/scummvm/scummvm/commit/8c114416d8eb4cf7cdda34497cf5650ad219cdfc
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-03-23T15:44:22+01:00
Commit Message:
TWINE: lba2 opcodes
Changed paths:
engines/twine/scene/actor.h
engines/twine/script/script_life_v2.cpp
engines/twine/script/script_life_v2.h
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 5cb046c9559..20a12d158a6 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -86,22 +86,30 @@ struct StaticFlagsStruct {
/** Actors dynamic flags structure */
struct DynamicFlagsStruct {
- uint16 bWaitHitFrame : 1; // 0x0001 WAIT_HIT_FRAME - wait for hit frame
- uint16 bIsHitting : 1; // 0x0002 OK_HIT - hit frame anim
- uint16 bAnimEnded : 1; // 0x0004 ANIM_END - anim ended in the current loop (will be looped in the next engine loop)
- uint16 bAnimNewFrame : 1; // 0x0008 NEW_FRAME - new frame anim reached
- uint16 bIsDrawn : 1; // 0x0010 WAS_DRAWN - actor has been drawn in this loop
- uint16 bIsDead : 1; // 0x0020 OBJ_DEAD - is dead
- uint16 bIsSpriteMoving : 1; // 0x0040 AUTO_STOP_DOOR - door is opening or closing (wait to reach the destination position)
- uint16 bIsRotationByAnim : 1; // 0x0080 ANIM_MASTER_ROT - actor rotation is managed by its animaation not by the engine
- uint16 bIsFalling : 1; // 0x0100 FALLING - is falling on scene
- uint16 bIsTargetable : 1; // 0x0200
- uint16 bIsBlinking : 1; // 0x0400
- uint16 bWasWalkingBeforeFalling : 1; // 0x0800
- uint16 bUnk1000 : 1; // 0x1000
- uint16 bUnk2000 : 1; // 0x2000
- uint16 bUnk4000 : 1; // 0x4000
- uint16 bUnk8000 : 1; // 0x8000
+ uint32 bWaitHitFrame : 1; // 0x0001 WAIT_HIT_FRAME - wait for hit frame
+ uint32 bIsHitting : 1; // 0x0002 OK_HIT - hit frame anim
+ uint32 bAnimEnded : 1; // 0x0004 ANIM_END - anim ended in the current loop (will be looped in the next engine loop)
+ uint32 bAnimNewFrame : 1; // 0x0008 NEW_FRAME - new frame anim reached
+ uint32 bIsDrawn : 1; // 0x0010 WAS_DRAWN - actor has been drawn in this loop
+ uint32 bIsDead : 1; // 0x0020 OBJ_DEAD - is dead
+ uint32 bIsSpriteMoving : 1; // 0x0040 AUTO_STOP_DOOR - door is opening or closing (wait to reach the destination position)
+ uint32 bIsRotationByAnim : 1; // 0x0080 ANIM_MASTER_ROT - actor rotation is managed by its animation not by the engine
+ uint32 bIsFalling : 1; // 0x0100 FALLING - is falling on scene
+ uint32 bIsTargetable : 1; // 0x0200 OK_SUPER_HIT (lba2)
+ uint32 bIsBlinking : 1; // 0x0400 FRAME_SHIELD (lba2)
+ uint32 bWasWalkingBeforeFalling : 1; // 0x0800 DRAW_SHADOW (lba2) - bWasWalkingBeforeFalling in lba1
+ uint32 bUnk1000 : 1; // 0x1000 ANIM_MASTER_GRAVITY (lba2)
+ uint32 bUnk2000 : 1; // 0x2000 SKATING (lba2) Ouch! I slip in a forbidden collision
+ uint32 bUnk4000 : 1; // 0x4000 OK_RENVOIE (lba2) ready to send back a projectile
+ uint32 bUnk8000 : 1; // 0x8000 LEFT_JUMP (lba2) ready to jump from the left foot
+ uint32 bRIGHT_JUMP : 1; // RIGHT_JUMP (1<<16) // (lba2) ready to jump from the right foot
+ uint32 bWAIT_SUPER_HIT : 1; // WAIT_SUPER_HIT (1<<17) // (lba2) waiting for the end of the animation before giving another super hit
+ uint32 bTRACK_MASTER_ROT : 1; // TRACK_MASTER_ROT (1<<18) // (lba2) it's the track that manages the direction
+ uint32 bFLY_JETPACK : 1; // FLY_JETPACK (1<<19) // (lba2) flying with the Jetpack
+ uint32 bDONT_PICK_CODE_JEU : 1; // DONT_PICK_CODE_JEU (1<<20) // (lba2) Cheat - Conveyor Belt Zones
+ uint32 bMANUAL_INTER_FRAME : 1; // MANUAL_INTER_FRAME (1<<21) // (lba2) Manually performs the ObjectSetInterFrame()
+ uint32 bWAIT_COORD : 1; // WAIT_COORD (1<<22) // (lba2) waiting to have been displayed to pass the coordinates from one point to an extra
+ uint32 bCHECK_FALLING : 1; // CHECK_FALLING (1<<23) // (lba2) forces object to test FALLING during a frame
};
/**
@@ -205,9 +213,9 @@ public:
uint8 *_lifeScript = nullptr;
int32 _lifeScriptSize = 0;
- int32 _labelIdx = 0; // script label index
- int32 _currentLabelPtr = 0; // pointer to LABEL offset
- int32 _pausedTrackPtr = 0;
+ int32 _labelIdx = 0; // script label index - LabelTrack
+ int32 _currentLabelPtr = 0; // pointer to LABEL offset - OffsetLabelTrack
+ int32 _pausedTrackPtr = 0; // MemoLabelTrack
/**
* colliding actor id
diff --git a/engines/twine/script/script_life_v2.cpp b/engines/twine/script/script_life_v2.cpp
index 4fb49c6ccaa..67d9f6de7e2 100644
--- a/engines/twine/script/script_life_v2.cpp
+++ b/engines/twine/script/script_life_v2.cpp
@@ -223,10 +223,208 @@ int32 ScriptLifeV2::lTRACK_TO_VAR_GAME(TwinEEngine *engine, LifeScriptContext &c
return 0;
}
-int32 ScriptLifeV2::lVAR_GAME_TO_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
+#define TM_END 0
+#define TM_NOP 1
+#define TM_BODY 2
+#define TM_ANIM 3
+#define TM_GOTO_POINT 4
+#define TM_WAIT_ANIM 5
+#define TM_LOOP 6
+#define TM_ANGLE 7
+#define TM_POS_POINT 8
+#define TM_LABEL 9
+#define TM_GOTO 10
+#define TM_STOP 11
+#define TM_GOTO_SYM_POINT 12
+#define TM_WAIT_NB_ANIM 13
+#define TM_SAMPLE 14
+#define TM_GOTO_POINT_3D 15
+#define TM_SPEED 16
+#define TM_BACKGROUND 17
+#define TM_WAIT_NB_SECOND 18
+#define TM_NO_BODY 19
+#define TM_BETA 20
+#define TM_OPEN_LEFT 21
+#define TM_OPEN_RIGHT 22
+#define TM_OPEN_UP 23
+#define TM_OPEN_DOWN 24
+#define TM_CLOSE 25
+#define TM_WAIT_DOOR 26
+#define TM_SAMPLE_RND 27
+#define TM_SAMPLE_ALWAYS 28
+#define TM_SAMPLE_STOP 29
+#define TM_PLAY_ACF 30
+#define TM_REPEAT_SAMPLE 31
+#define TM_SIMPLE_SAMPLE 32
+#define TM_FACE_TWINSEN 33
+#define TM_ANGLE_RND 34
+#define TM_REM 35
+#define TM_WAIT_NB_DIZIEME 36
+#define TM_DO 37
+#define TM_SPRITE 38
+#define TM_WAIT_NB_SECOND_RND 39
+#define TM_AFF_TIMER 40
+#define TM_SET_FRAME 41
+#define TM_SET_FRAME_3DS 42
+#define TM_SET_START_3DS 43
+#define TM_SET_END_3DS 44
+#define TM_START_ANIM_3DS 45
+#define TM_STOP_ANIM_3DS 46
+#define TM_WAIT_ANIM_3DS 47
+#define TM_WAIT_FRAME_3DS 48
+#define TM_WAIT_NB_DIZIEME_RND 49
+#define TM_DECALAGE 50
+#define TM_FREQUENCE 51
+#define TM_VOLUME 52
+
+// Allows forcing a track to a label instead of an offset (basically, like in the tool!)
+int16 ScriptLifeV2::searchOffsetTrack(ActorStruct *ptrobj, uint8 label) {
+ uint8 *ptrtrack;
+ int16 offsettrack = 0;
+ uint8 macro;
+
+ for (;;) {
+ ptrtrack = ptrobj->_moveScript + offsettrack;
+
+ macro = *ptrtrack++;
+ offsettrack++;
+
+ switch (macro) {
+ case TM_LABEL:
+ if (*ptrtrack == label) {
+ ptrobj->_labelIdx = label; /* label */
+ ptrobj->_currentLabelPtr = (int16)(offsettrack - 1);
+ return ((int16)(offsettrack - 1));
+ }
+ offsettrack++;
+ break;
+
+ case TM_BODY:
+ case TM_GOTO_POINT:
+ case TM_GOTO_POINT_3D:
+ case TM_GOTO_SYM_POINT:
+ case TM_POS_POINT:
+ case TM_BACKGROUND:
+ case TM_SET_FRAME:
+ case TM_SET_FRAME_3DS:
+ case TM_SET_START_3DS:
+ case TM_SET_END_3DS:
+ case TM_START_ANIM_3DS:
+ case TM_WAIT_FRAME_3DS:
+ case TM_VOLUME:
+ offsettrack++;
+ break;
+
+ case TM_ANIM:
+ case TM_SAMPLE:
+ case TM_SAMPLE_RND:
+ case TM_SAMPLE_ALWAYS:
+ case TM_SAMPLE_STOP:
+ case TM_REPEAT_SAMPLE:
+ case TM_SIMPLE_SAMPLE:
+ case TM_WAIT_NB_ANIM:
+ case TM_ANGLE:
+ case TM_FACE_TWINSEN:
+ case TM_OPEN_LEFT:
+ case TM_OPEN_RIGHT:
+ case TM_OPEN_UP:
+ case TM_OPEN_DOWN:
+ case TM_BETA:
+ case TM_GOTO:
+ case TM_SPEED:
+ case TM_SPRITE:
+ case TM_DECALAGE:
+ case TM_FREQUENCE:
+ offsettrack += 2;
+ break;
+
+ case TM_ANGLE_RND:
+ case TM_LOOP:
+ offsettrack += 4;
+ break;
+
+ case TM_WAIT_NB_SECOND:
+ case TM_WAIT_NB_SECOND_RND:
+ case TM_WAIT_NB_DIZIEME:
+ case TM_WAIT_NB_DIZIEME_RND:
+ offsettrack += 5;
+ break;
+
+ case TM_PLAY_ACF: {
+ char *ptr, c;
+ char string[256];
+ int32 n;
+
+ ptr = string;
+ n = 0;
+ do {
+ c = *ptrtrack++;
+ *ptr++ = c;
+ n++;
+ } while (c != 0);
+
+ offsettrack += n;
+ break;
+ }
+ case TM_END:
+ return -1; // label not found
+ }
+ }
return -1;
}
+void ScriptLifeV2::cleanTrack(ActorStruct *ptrobj) {
+ if (ptrobj->_offsetTrack != -1) {
+ ptrobj->_dynamicFlags.bTRACK_MASTER_ROT = 0;
+
+ uint8 *ptrtrack = ptrobj->_moveScript + ptrobj->_offsetTrack;
+
+ switch (*ptrtrack) {
+ case TM_FACE_TWINSEN:
+ *(int16 *)(ptrtrack + 1) = -1;
+ break;
+
+ case TM_WAIT_NB_ANIM:
+ *(uint8 *)(ptrtrack + 2) = 0;
+ break;
+
+ case TM_WAIT_NB_SECOND:
+ case TM_WAIT_NB_DIZIEME:
+ case TM_WAIT_NB_SECOND_RND:
+ case TM_WAIT_NB_DIZIEME_RND:
+ *(uint32 *)(ptrtrack + 2) = 0;
+ break;
+
+ case TM_ANGLE:
+ *(int16 *)(ptrtrack + 1) &= 0x7FFF;
+ break;
+
+ case TM_ANGLE_RND:
+ *(int16 *)(ptrtrack + 3) = -1;
+ break;
+
+ case TM_LOOP:
+ *(ptrtrack + 2) = *(ptrtrack + 1);
+ break;
+ }
+ }
+}
+
+int32 ScriptLifeV2::lVAR_GAME_TO_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
+ cleanTrack(ctx.actor);
+
+ const uint8 num = ctx.stream.readByte();
+ debugC(3, kDebugLevels::kDebugScripts, "LIFE::lVAR_GAME_TO_TRACK(%i)", (int)num);
+ ctx.actor->_offsetTrack = searchOffsetTrack(ctx.actor,
+ engine->_gameState->hasGameFlag(num));
+
+ // Shielding against bug of the traveling merchant
+ if (ctx.actor->_offsetTrack < 0) {
+ ctx.actor->_offsetTrack = searchOffsetTrack(ctx.actor, 0);
+ }
+ return 0;
+}
+
int32 ScriptLifeV2::lANIM_TEXTURE(TwinEEngine *engine, LifeScriptContext &ctx) {
return -1;
}
@@ -652,7 +850,8 @@ int32 ScriptLifeV2::lEND_MESSAGE(TwinEEngine *engine, LifeScriptContext &ctx) {
}
int32 ScriptLifeV2::lEND_MESSAGE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
- /*num = */ ctx.stream.readByte();
+ const uint8 num = ctx.stream.readByte();
+ debugC(3, kDebugLevels::kDebugScripts, "LIFE::lEND_MESSAGE_OBJ(%i)", (int)num);
return 0;
}
diff --git a/engines/twine/script/script_life_v2.h b/engines/twine/script/script_life_v2.h
index 9131edf978a..f58177b3c45 100644
--- a/engines/twine/script/script_life_v2.h
+++ b/engines/twine/script/script_life_v2.h
@@ -29,6 +29,10 @@ namespace TwinE {
class TwinEEngine;
class ScriptLifeV2 : public ScriptLife {
+private:
+ static int16 searchOffsetTrack(ActorStruct *ptrobj, uint8 label);
+ static void cleanTrack(ActorStruct *ptrobj);
+
public:
static int32 lPLAY_MUSIC(TwinEEngine *engine, LifeScriptContext &ctx);
static int32 lTRACK_TO_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx);
Commit: 1f851955dcf6dcc054be4ba4f4aaf8413da78c34
https://github.com/scummvm/scummvm/commit/1f851955dcf6dcc054be4ba4f4aaf8413da78c34
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-03-23T15:50:36+01:00
Commit Message:
TWINE: renamed variables to match original sources
Changed paths:
engines/twine/renderer/redraw.cpp
engines/twine/scene/actor.cpp
engines/twine/scene/actor.h
engines/twine/scene/animations.cpp
engines/twine/scene/collision.cpp
engines/twine/scene/grid.cpp
engines/twine/scene/movements.cpp
engines/twine/scene/scene.cpp
engines/twine/script/script_life.cpp
engines/twine/script/script_life_v2.cpp
engines/twine/script/script_move.cpp
engines/twine/script/script_move.h
engines/twine/twine.cpp
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index b04cad3fb14..980c02cd266 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -245,7 +245,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool flagflip) {
int32 drawListPos = 0;
for (int32 a = 0; a < _engine->_scene->_nbObjets; a++) {
ActorStruct *actor = _engine->_scene->getActor(a);
- actor->_dynamicFlags.bIsDrawn = 0; // reset visible state
+ actor->_workFlags.bIsDrawn = 0; // reset visible state
if (_engine->_grid->_useCellingGrid != -1 && actor->_pos.y > _engine->_scene->_sceneZones[_engine->_grid->_cellingGridIdx].maxs.y) {
continue;
@@ -256,7 +256,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool flagflip) {
const IVec3 &projPos = _engine->_renderer->projectPoint(actor->posObj() - _engine->_grid->_worldCube);
// check if actor is visible on screen, otherwise don't display it
if (projPos.x > VIEW_X0 && projPos.x < VIEW_X1(_engine) && projPos.y > VIEW_Y0 && projPos.y < VIEW_Y1(_engine)) {
- actor->_dynamicFlags.bIsDrawn = 1;
+ actor->_workFlags.bIsDrawn = 1;
}
continue;
}
@@ -421,7 +421,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
}
if (_engine->_interface->setClip(renderRect)) {
- actor->_dynamicFlags.bIsDrawn = 1;
+ actor->_workFlags.bIsDrawn = 1;
const int32 tempX = (actor->_pos.x + DEMI_BRICK_XZ) / SIZE_BRICK_XZ;
int32 tempY = actor->_pos.y / SIZE_BRICK_Y;
@@ -475,7 +475,7 @@ void Redraw::processDrawListActorSprites(const DrawListStruct &drawCmd, bool bgR
if (validClip) {
_engine->_grid->drawSprite(0, renderRect.left, renderRect.top, spritePtr);
- actor->_dynamicFlags.bIsDrawn = 1;
+ actor->_workFlags.bIsDrawn = 1;
if (actor->_staticFlags.bUsesClipping) {
const int32 tmpX = (actor->_animStep.x + DEMI_BRICK_XZ) / SIZE_BRICK_XZ;
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 96931b91469..f7587b661c6 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -47,7 +47,7 @@ Actor::Actor(TwinEEngine *engine) : _engine(engine) {
void Actor::restartHeroScene() {
ActorStruct *sceneHero = _engine->_scene->_sceneHero;
sceneHero->_controlMode = ControlMode::kManual;
- memset(&sceneHero->_dynamicFlags, 0, sizeof(sceneHero->_dynamicFlags));
+ memset(&sceneHero->_workFlags, 0, sizeof(sceneHero->_workFlags));
memset(&sceneHero->_staticFlags, 0, sizeof(sceneHero->_staticFlags));
sceneHero->_staticFlags.bComputeCollisionWithObj = 1;
@@ -58,7 +58,7 @@ void Actor::restartHeroScene() {
sceneHero->_armor = 1;
sceneHero->_offsetTrack = -1;
- sceneHero->_labelIdx = -1;
+ sceneHero->_labelTrack = -1;
sceneHero->_offsetLife = 0;
sceneHero->_zoneSce = -1;
sceneHero->_beta = _previousHeroAngle;
@@ -242,7 +242,7 @@ void Actor::startInitObj(int16 actorIdx) {
if (actor->_staticFlags.bIsSpriteActor) {
if (actor->_strengthOfHit != 0) {
- actor->_dynamicFlags.bIsHitting = 1;
+ actor->_workFlags.bIsHitting = 1;
}
actor->_body = -1;
@@ -271,7 +271,7 @@ void Actor::startInitObj(int16 actorIdx) {
}
actor->_offsetTrack = -1;
- actor->_labelIdx = -1;
+ actor->_labelTrack = -1;
actor->_offsetLife = 0;
}
@@ -283,7 +283,7 @@ void Actor::initObject(int16 actorIdx) {
actor->_pos = IVec3(0, SIZE_BRICK_Y, 0);
memset(&actor->_staticFlags, 0, sizeof(StaticFlagsStruct));
- memset(&actor->_dynamicFlags, 0, sizeof(DynamicFlagsStruct));
+ memset(&actor->_workFlags, 0, sizeof(DynamicFlagsStruct));
memset(&actor->_bonusParameter, 0, sizeof(BonusParameter));
_engine->_movements->initRealAngle(LBAAngles::ANGLE_0, LBAAngles::ANGLE_0, LBAAngles::ANGLE_0, &actor->realAngle);
@@ -356,7 +356,7 @@ void Actor::giveExtraBonus(int32 actorIdx) {
if (bonusSprite == -1) {
return;
}
- if (actor->_dynamicFlags.bIsDead) {
+ if (actor->_workFlags.bIsDead) {
_engine->_extra->addExtraBonus(actor->posObj(), LBAAngles::ANGLE_90, LBAAngles::ANGLE_0, bonusSprite, actor->_bonusAmount);
_engine->_sound->playSample(Samples::ItemPopup, 1, actor->posObj(), actorIdx);
} else {
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 20a12d158a6..f40e996c1f5 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -151,7 +151,7 @@ private:
public:
StaticFlagsStruct _staticFlags;
- DynamicFlagsStruct _dynamicFlags;
+ DynamicFlagsStruct _workFlags;
inline ShapeType brickShape() const { return _col; }
inline void setCollision(ShapeType shapeType) {
@@ -205,7 +205,7 @@ public:
IVec3 _oldPos; // OldPosX, OldPosY, OldPosZ
int32 _offsetTrack = -1;
- uint8 *_moveScript = nullptr;
+ uint8 *_ptrTrack = nullptr;
int32 _moveScriptSize = 0;
int32 _offsetLife = 0;
@@ -213,9 +213,9 @@ public:
uint8 *_lifeScript = nullptr;
int32 _lifeScriptSize = 0;
- int32 _labelIdx = 0; // script label index - LabelTrack
- int32 _currentLabelPtr = 0; // pointer to LABEL offset - OffsetLabelTrack
- int32 _pausedTrackPtr = 0; // MemoLabelTrack
+ int32 _labelTrack = 0; // script label index
+ int32 _offsetLabelTrack = 0; // pointer to LABEL offset
+ int32 _memoLabelTrack = 0;
/**
* colliding actor id
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 54f16f63d82..c1913091f83 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -276,7 +276,7 @@ void Animations::processAnimActions(int32 actorIdx) { // GereAnimAction
case ActionType::ACTION_HITTING:
if (action.animFrame - 1 == actor->_frame) {
actor->_strengthOfHit = action.strength;
- actor->_dynamicFlags.bIsHitting = 1;
+ actor->_workFlags.bIsHitting = 1;
}
break;
case ActionType::ACTION_SAMPLE:
@@ -330,7 +330,7 @@ void Animations::processAnimActions(int32 actorIdx) { // GereAnimAction
case ActionType::ACTION_HERO_HITTING:
if (action.animFrame - 1 == actor->_frame) {
actor->_strengthOfHit = magicLevelStrengthOfHit[_engine->_gameState->_magicLevelIdx];
- actor->_dynamicFlags.bIsHitting = 1;
+ actor->_workFlags.bIsHitting = 1;
}
break;
case ActionType::ACTION_THROW_3D:
@@ -448,9 +448,9 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType flag, AnimationTypes
actor->_flagAnim = flag;
actor->_frame = 0;
- actor->_dynamicFlags.bIsHitting = 0;
- actor->_dynamicFlags.bAnimEnded = 0;
- actor->_dynamicFlags.bAnimNewFrame = 1;
+ actor->_workFlags.bIsHitting = 0;
+ actor->_workFlags.bAnimEnded = 0;
+ actor->_workFlags.bAnimNewFrame = 1;
processAnimActions(actorIdx);
@@ -472,12 +472,12 @@ void Animations::doAnim(int32 actorIdx) {
IVec3 &processActor = actor->_processActor;
if (actor->_staticFlags.bIsSpriteActor) {
if (actor->_strengthOfHit) {
- actor->_dynamicFlags.bIsHitting = 1;
+ actor->_workFlags.bIsHitting = 1;
}
processActor = actor->posObj();
- if (!actor->_dynamicFlags.bIsFalling) {
+ if (!actor->_workFlags.bIsFalling) {
if (actor->_speed) {
int32 xAxisRotation = actor->realAngle.getRealValueFromTime(_engine->timerRef);
if (!xAxisRotation) {
@@ -499,7 +499,7 @@ void Animations::doAnim(int32 actorIdx) {
_engine->_movements->setActorAngle(LBAAngles::ANGLE_0, actor->_speed, LBAAngles::ANGLE_17, &actor->realAngle);
- if (actor->_dynamicFlags.bIsSpriteMoving) {
+ if (actor->_workFlags.bIsSpriteMoving) {
if (actor->_doorWidth) { // open door
if (getDistance2D(processActor.x, processActor.z, actor->_animStep.x, actor->_animStep.z) >= actor->_doorWidth) {
if (actor->_beta == LBAAngles::ANGLE_0) { // down
@@ -512,7 +512,7 @@ void Animations::doAnim(int32 actorIdx) {
processActor.x = actor->_animStep.x - actor->_doorWidth;
}
- actor->_dynamicFlags.bIsSpriteMoving = 0;
+ actor->_workFlags.bIsSpriteMoving = 0;
actor->_speed = 0;
}
} else { // close door
@@ -539,7 +539,7 @@ void Animations::doAnim(int32 actorIdx) {
if (updatePos) {
processActor = actor->_animStep;
- actor->_dynamicFlags.bIsSpriteMoving = 0;
+ actor->_workFlags.bIsSpriteMoving = 0;
actor->_speed = 0;
}
}
@@ -567,9 +567,9 @@ void Animations::doAnim(int32 actorIdx) {
}
if (_animMasterRot) {
- actor->_dynamicFlags.bIsRotationByAnim = 1;
+ actor->_workFlags.bIsRotationByAnim = 1;
} else {
- actor->_dynamicFlags.bIsRotationByAnim = 0;
+ actor->_workFlags.bIsRotationByAnim = 0;
}
actor->_beta = ClampAngle(actor->_beta + _animStepBeta - actor->_animStepBeta);
@@ -584,19 +584,19 @@ void Animations::doAnim(int32 actorIdx) {
actor->_animStep = _currentStep;
- actor->_dynamicFlags.bAnimEnded = 0;
- actor->_dynamicFlags.bAnimNewFrame = 0;
+ actor->_workFlags.bAnimEnded = 0;
+ actor->_workFlags.bAnimNewFrame = 0;
if (keyFramePassed) {
actor->_frame++;
- actor->_dynamicFlags.bAnimNewFrame = 1;
+ actor->_workFlags.bAnimNewFrame = 1;
// if actor have animation actions to process
processAnimActions(actorIdx);
int16 numKeyframe = actor->_frame;
if (numKeyframe == (int16)animData.getNumKeyframes()) {
- actor->_dynamicFlags.bIsHitting = 0;
+ actor->_workFlags.bIsHitting = 0;
if (actor->_flagAnim == AnimType::kAnimationTypeRepeat) {
actor->_frame = animData.getLoopFrame();
@@ -618,7 +618,7 @@ void Animations::doAnim(int32 actorIdx) {
processAnimActions(actorIdx);
- actor->_dynamicFlags.bAnimEnded = 1;
+ actor->_workFlags.bAnimEnded = 1;
}
actor->_animStepBeta = LBAAngles::ANGLE_0;
@@ -641,7 +641,7 @@ void Animations::doAnim(int32 actorIdx) {
}
// actor falling Y speed
- if (actor->_dynamicFlags.bIsFalling) {
+ if (actor->_workFlags.bIsFalling) {
processActor = oldPos;
processActor.y += _engine->_stepFalling; // add step to fall
}
@@ -664,7 +664,7 @@ void Animations::doAnim(int32 actorIdx) {
collision->checkObjCol(actorIdx);
}
- if (actor->_carryBy != -1 && actor->_dynamicFlags.bIsFalling) {
+ if (actor->_carryBy != -1 && actor->_workFlags.bIsFalling) {
collision->receptionObj(actorIdx);
}
@@ -693,7 +693,7 @@ void Animations::doAnim(int32 actorIdx) {
}
// process wall hit while running
- if (col1 && !actor->_dynamicFlags.bIsFalling && IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_genAnim == AnimationTypes::kForward) {
+ if (col1 && !actor->_workFlags.bIsFalling && IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_genAnim == AnimationTypes::kForward) {
IVec2 destPos = _engine->_renderer->rotate(actor->_boundingBox.mins.x, actor->_boundingBox.mins.z, actor->_beta + LBAAngles::ANGLE_315 + LBAAngles::ANGLE_180);
destPos.x += processActor.x;
@@ -718,7 +718,7 @@ void Animations::doAnim(int32 actorIdx) {
if (col != ShapeType::kNone) {
if (col == ShapeType::kSolid) {
- if (actor->_dynamicFlags.bIsFalling) {
+ if (actor->_workFlags.bIsFalling) {
collision->receptionObj(actorIdx);
processActor.y = (collision->_collision.y * SIZE_BRICK_Y) + SIZE_BRICK_Y;
} else {
@@ -741,27 +741,27 @@ void Animations::doAnim(int32 actorIdx) {
}
}
} else {
- if (actor->_dynamicFlags.bIsFalling) {
+ if (actor->_workFlags.bIsFalling) {
collision->receptionObj(actorIdx);
}
collision->reajustPos(processActor, col);
}
- actor->_dynamicFlags.bIsFalling = 0;
+ actor->_workFlags.bIsFalling = 0;
} else {
if (actor->_staticFlags.bCanFall && actor->_carryBy == -1) {
col = _engine->_grid->worldColBrick(processActor.x, processActor.y - 1, processActor.z);
if (col != ShapeType::kNone) {
- if (actor->_dynamicFlags.bIsFalling) {
+ if (actor->_workFlags.bIsFalling) {
collision->receptionObj(actorIdx);
}
collision->reajustPos(processActor, col);
} else {
- if (!actor->_dynamicFlags.bIsRotationByAnim) {
- actor->_dynamicFlags.bIsFalling = 1;
+ if (!actor->_workFlags.bIsRotationByAnim) {
+ actor->_workFlags.bIsFalling = 1;
if (IS_HERO(actorIdx) && _engine->_scene->_startYFalling == 0) {
_engine->_scene->_startYFalling = processActor.y;
@@ -774,7 +774,7 @@ void Animations::doAnim(int32 actorIdx) {
int32 fallHeight = processActor.y - y;
if (fallHeight <= (2 * SIZE_BRICK_Y) && actor->_genAnim == AnimationTypes::kForward) {
- actor->_dynamicFlags.bWasWalkingBeforeFalling = 1;
+ actor->_workFlags.bWasWalkingBeforeFalling = 1;
} else {
initAnim(AnimationTypes::kFall, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, actorIdx);
}
diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index 1c72fb1a704..959a69c54bc 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -225,7 +225,7 @@ void Collision::handlePushing(IVec3 &processActor, const IVec3 &minsTest, const
if (newAngle >= LBAAngles::ANGLE_315 || newAngle < LBAAngles::ANGLE_45) {
processActor.z = minsTest.z - ptrobj->_boundingBox.maxs.z;
}
- } else if (!ptrobj->_dynamicFlags.bIsFalling) {
+ } else if (!ptrobj->_workFlags.bIsFalling) {
// refuse pos
processActor = ptrobj->_oldPos;
}
@@ -298,7 +298,7 @@ int32 Collision::checkObjCol(int32 actorIdx) {
ptrobj->_objCol = a; // mark as collision with actor a
if (ptrobjt->_staticFlags.bIsCarrierActor) {
- if (ptrobj->_dynamicFlags.bIsFalling) {
+ if (ptrobj->_workFlags.bIsFalling) {
// I touch a carrier
processActor.y = maxsTest.y - ptrobj->_boundingBox.mins.y + 1;
ptrobj->_carryBy = a;
@@ -321,7 +321,7 @@ int32 Collision::checkObjCol(int32 actorIdx) {
}
// test moves ZV further if hit
- if (ptrobj->_dynamicFlags.bIsHitting) {
+ if (ptrobj->_workFlags.bIsHitting) {
const IVec2 &destPos = _engine->_renderer->rotate(0, 200, ptrobj->_beta);
mins = processActor + ptrobj->_boundingBox.mins;
mins.x += destPos.x;
@@ -340,7 +340,7 @@ int32 Collision::checkObjCol(int32 actorIdx) {
const IVec3 maxsTest = actorTest->posObj() + actorTest->_boundingBox.maxs;
if (mins.x < maxsTest.x && maxs.x > minsTest.x && mins.y < maxsTest.y && maxs.y > minsTest.y && mins.z < maxsTest.z && maxs.z > minsTest.z) {
_engine->_actor->hitObj(actorIdx, a, ptrobj->_strengthOfHit, ptrobj->_beta + LBAAngles::ANGLE_180);
- ptrobj->_dynamicFlags.bIsHitting = 0;
+ ptrobj->_workFlags.bIsHitting = 0;
}
}
}
@@ -432,7 +432,7 @@ void Collision::receptionObj(int actorIdx) {
} else if (fall > 2 * SIZE_BRICK_Y) {
_engine->_animations->initAnim(AnimationTypes::kLanding, AnimType::kAnimationAllThen, AnimationTypes::kStanding, actorIdx);
} else {
- if (actor->_dynamicFlags.bWasWalkingBeforeFalling) {
+ if (actor->_workFlags.bWasWalkingBeforeFalling) {
// try to not interrupt walk animation if Twinsen falls down from small height
_engine->_animations->initAnim(AnimationTypes::kForward, AnimType::kAnimationTypeRepeat, AnimationTypes::kStanding, actorIdx);
} else {
@@ -445,8 +445,8 @@ void Collision::receptionObj(int actorIdx) {
_engine->_animations->initAnim(AnimationTypes::kLanding, AnimType::kAnimationAllThen, actor->_nextGenAnim, actorIdx);
}
- actor->_dynamicFlags.bIsFalling = 0;
- actor->_dynamicFlags.bWasWalkingBeforeFalling = 0;
+ actor->_workFlags.bIsFalling = 0;
+ actor->_workFlags.bWasWalkingBeforeFalling = 0;
}
int32 Collision::extraCheckObjCol(ExtraListStruct *extra, int32 actorIdx) {
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index bf0d39b5e26..0191806dfaa 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -744,7 +744,7 @@ bool Grid::shouldCheckWaterCol(int32 actorIdx) const {
if (_engine->_actor->_heroBehaviour != HeroBehaviourType::kProtoPack
&& ptrobj->_staticFlags.bComputeCollisionWithFloor
&& !ptrobj->_staticFlags.bIsHidden
- && !ptrobj->_dynamicFlags.bIsFalling
+ && !ptrobj->_workFlags.bIsFalling
&& ptrobj->_carryBy == -1) {
return true;
}
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index e3111d5047c..95732c25f5b 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -357,7 +357,7 @@ void Movements::processManualMovementExecution(int actorIdx) {
if (actor->_genAnim == AnimationTypes::kStanding) {
_engine->_animations->initAnim(AnimationTypes::kTurnLeft, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, actorIdx);
} else {
- if (!actor->_dynamicFlags.bIsRotationByAnim) {
+ if (!actor->_workFlags.bIsRotationByAnim) {
actor->_beta = actor->realAngle.getRealAngle(_engine->timerRef);
}
}
@@ -366,7 +366,7 @@ void Movements::processManualMovementExecution(int actorIdx) {
if (actor->_genAnim == AnimationTypes::kStanding) {
_engine->_animations->initAnim(AnimationTypes::kTurnRight, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, actorIdx);
} else {
- if (!actor->_dynamicFlags.bIsRotationByAnim) {
+ if (!actor->_workFlags.bIsRotationByAnim) {
actor->_beta = actor->realAngle.getRealAngle(_engine->timerRef);
}
}
@@ -427,7 +427,7 @@ void Movements::processFollowAction(int actorIdx) {
void Movements::processRandomAction(int actorIdx) {
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- if (actor->_dynamicFlags.bIsRotationByAnim) {
+ if (actor->_workFlags.bIsRotationByAnim) {
return;
}
@@ -479,7 +479,7 @@ void Movements::doDir(int32 actorIdx) {
return;
}
- if (actor->_dynamicFlags.bIsFalling) {
+ if (actor->_workFlags.bIsFalling) {
if (actor->_controlMode == ControlMode::kManual) {
manualRealAngle(actor);
// TODO: _lastJoyFlag = _joyFlag;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 71655566b3f..1572243c914 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -182,7 +182,7 @@ bool Scene::loadSceneLBA2() {
_sceneHeroPos.z = stream.readSint16LE();
_sceneHero->_moveScriptSize = (int16)stream.readUint16LE();
- _sceneHero->_moveScript = _currentScene + stream.pos();
+ _sceneHero->_ptrTrack = _currentScene + stream.pos();
stream.skip(_sceneHero->_moveScriptSize);
_sceneHero->_lifeScriptSize = (int16)stream.readUint16LE();
@@ -229,7 +229,7 @@ bool Scene::loadSceneLBA2() {
act->setLife(stream.readByte());
act->_moveScriptSize = (int16)stream.readUint16LE();
- act->_moveScript = _currentScene + stream.pos();
+ act->_ptrTrack = _currentScene + stream.pos();
stream.skip(act->_moveScriptSize);
act->_lifeScriptSize = (int16)stream.readUint16LE();
@@ -315,7 +315,7 @@ bool Scene::loadSceneLBA1() {
_sceneHeroPos.z = (int16)stream.readUint16LE();
_sceneHero->_moveScriptSize = (int16)stream.readUint16LE();
- _sceneHero->_moveScript = _currentScene + stream.pos();
+ _sceneHero->_ptrTrack = _currentScene + stream.pos();
stream.skip(_sceneHero->_moveScriptSize);
_sceneHero->_lifeScriptSize = (int16)stream.readUint16LE();
@@ -357,7 +357,7 @@ bool Scene::loadSceneLBA1() {
act->setLife(stream.readByte());
act->_moveScriptSize = (int16)stream.readUint16LE();
- act->_moveScript = _currentScene + stream.pos();
+ act->_ptrTrack = _currentScene + stream.pos();
stream.skip(act->_moveScriptSize);
act->_lifeScriptSize = (int16)stream.readUint16LE();
@@ -483,7 +483,7 @@ void Scene::dumpSceneScripts() const {
for (int32 a = 0; a < _nbObjets; ++a) {
const ActorStruct &actor = _sceneActors[a];
dumpSceneScript("life", a, actor._lifeScript, actor._lifeScriptSize);
- dumpSceneScript("move", a, actor._moveScript, actor._moveScriptSize);
+ dumpSceneScript("move", a, actor._ptrTrack, actor._moveScriptSize);
}
}
@@ -543,7 +543,7 @@ void Scene::changeScene() {
_sceneHero->_zoneSce = -1;
_sceneHero->_offsetLife = 0;
_sceneHero->_offsetTrack = -1;
- _sceneHero->_labelIdx = -1;
+ _sceneHero->_labelTrack = -1;
initScene(_needChangeScene);
if (ConfMan.getBool("dump_scripts")) {
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index 1039ae478da..a84dc24c9f4 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -144,7 +144,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
debugCN(3, kDebugLevels::kDebugScripts, "distance(%i, ", actorIdx);
conditionValueSize = ReturnType::RET_S16;
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (!otherActor->_dynamicFlags.bIsDead) {
+ if (!otherActor->_workFlags.bIsDead) {
if (ABS(ctx.actor->_pos.y - otherActor->_pos.y) >= 1500) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
} else {
@@ -194,12 +194,12 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
case kcL_TRACK:
debugCN(3, kDebugLevels::kDebugScripts, "track(");
conditionValueSize = ReturnType::RET_U8;
- engine->_scene->_currentScriptValue = ctx.actor->_labelIdx;
+ engine->_scene->_currentScriptValue = ctx.actor->_labelTrack;
break;
case kcL_TRACK_OBJ: {
int32 actorIdx = ctx.stream.readByte();
debugCN(3, kDebugLevels::kDebugScripts, "track_obj(%i, ", actorIdx);
- engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_labelIdx;
+ engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_labelTrack;
break;
}
case kcFLAG_CUBE: {
@@ -217,7 +217,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
- if (targetActor->_dynamicFlags.bIsDead) {
+ if (targetActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
break;
}
@@ -328,7 +328,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
- if (!targetActor->_dynamicFlags.bIsDead) {
+ if (!targetActor->_workFlags.bIsDead) {
// Returns int32, so we check for integer overflow
int32 distance = getDistance3D(ctx.actor->posObj(), targetActor->posObj());
if (ABS(distance) > MAX_TARGET_ACTOR_DISTANCE) {
@@ -420,7 +420,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
case kcOBJECT_DISPLAYED: {
int32 actorIdx = ctx.stream.readByte();
- engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_dynamicFlags.bIsDrawn ? 1 : 0;
+ engine->_scene->_currentScriptValue = engine->_scene->getActor(actorIdx)->_workFlags.bIsDrawn ? 1 : 0;
break;
}
case kcPROCESSOR:
@@ -431,7 +431,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (otherActor->_dynamicFlags.bIsDead) {
+ if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
break;
}
@@ -446,7 +446,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (otherActor->_dynamicFlags.bIsDead) {
+ if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
break;
}
@@ -461,7 +461,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
int32 actorIdx = ctx.stream.readByte();
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (otherActor->_dynamicFlags.bIsDead) {
+ if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = MAX_TARGET_ACTOR_DISTANCE;
break;
}
@@ -475,7 +475,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
break;
}
case kcCOL_DECORS:
- if (ctx.actor->_dynamicFlags.bIsDead) {
+ if (ctx.actor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = 255;
break;
}
@@ -485,7 +485,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
case kcCOL_DECORS_OBJ: {
int32 actorIdx = ctx.stream.readByte();
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (otherActor->_dynamicFlags.bIsDead) {
+ if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = 255;
break;
}
@@ -524,7 +524,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
conditionValueSize = ReturnType::RET_S16;
ActorStruct *otherActor = engine->_scene->getActor(actorIdx);
- if (otherActor->_dynamicFlags.bIsDead) {
+ if (otherActor->_workFlags.bIsDead) {
engine->_scene->_currentScriptValue = 32000;
break;
}
@@ -1090,7 +1090,7 @@ int32 ScriptLife::lKILL_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_actor->processActorCarrier(otherActorIdx);
ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
- otherActor->_dynamicFlags.bIsDead = 1;
+ otherActor->_workFlags.bIsDead = 1;
otherActor->_body = -1;
otherActor->_zoneSce = -1;
otherActor->setLife(0);
@@ -1105,7 +1105,7 @@ int32 ScriptLife::lKILL_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLife::lSUICIDE(TwinEEngine *engine, LifeScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "LIFE::SUICIDE()");
engine->_actor->processActorCarrier(ctx.actorIdx);
- ctx.actor->_dynamicFlags.bIsDead = 1;
+ ctx.actor->_workFlags.bIsDead = 1;
ctx.actor->_body = -1;
ctx.actor->_zoneSce = -1;
ctx.actor->setLife(0);
@@ -1172,8 +1172,8 @@ int32 ScriptLife::lEND_LIFE(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x2A
*/
int32 ScriptLife::lSTOP_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::STOP_L_TRACK(%i)", (int)ctx.actor->_currentLabelPtr);
- ctx.actor->_pausedTrackPtr = ctx.actor->_currentLabelPtr;
+ debugC(3, kDebugLevels::kDebugScripts, "LIFE::STOP_L_TRACK(%i)", (int)ctx.actor->_offsetLabelTrack);
+ ctx.actor->_memoLabelTrack = ctx.actor->_offsetLabelTrack;
ctx.actor->_offsetTrack = -1;
return 0;
}
@@ -1183,8 +1183,8 @@ int32 ScriptLife::lSTOP_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x2B
*/
int32 ScriptLife::lRESTORE_L_TRACK(TwinEEngine *engine, LifeScriptContext &ctx) {
- debugC(3, kDebugLevels::kDebugScripts, "LIFE::RESTORE_L_TRACK(%i)", (int)ctx.actor->_pausedTrackPtr);
- ctx.actor->_offsetTrack = ctx.actor->_pausedTrackPtr;
+ debugC(3, kDebugLevels::kDebugScripts, "LIFE::RESTORE_L_TRACK(%i)", (int)ctx.actor->_memoLabelTrack);
+ ctx.actor->_offsetTrack = ctx.actor->_memoLabelTrack;
return 0;
}
@@ -1247,7 +1247,7 @@ int32 ScriptLife::lSET_DOOR_LEFT(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_beta = LBAAngles::ANGLE_270;
ctx.actor->_pos.x = ctx.actor->_animStep.x - distance;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 0;
+ ctx.actor->_workFlags.bIsSpriteMoving = 0;
ctx.actor->_speed = 0;
return 0;
@@ -1263,7 +1263,7 @@ int32 ScriptLife::lSET_DOOR_RIGHT(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_beta = LBAAngles::ANGLE_90;
ctx.actor->_pos.x = ctx.actor->_animStep.x + distance;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 0;
+ ctx.actor->_workFlags.bIsSpriteMoving = 0;
ctx.actor->_speed = 0;
return 0;
@@ -1279,7 +1279,7 @@ int32 ScriptLife::lSET_DOOR_UP(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_beta = LBAAngles::ANGLE_180;
ctx.actor->_pos.z = ctx.actor->_animStep.z - distance;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 0;
+ ctx.actor->_workFlags.bIsSpriteMoving = 0;
ctx.actor->_speed = 0;
return 0;
@@ -1295,7 +1295,7 @@ int32 ScriptLife::lSET_DOOR_DOWN(TwinEEngine *engine, LifeScriptContext &ctx) {
ctx.actor->_beta = LBAAngles::ANGLE_0;
ctx.actor->_pos.z = ctx.actor->_animStep.z + distance;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 0;
+ ctx.actor->_workFlags.bIsSpriteMoving = 0;
ctx.actor->_speed = 0;
return 0;
@@ -1621,7 +1621,7 @@ int32 ScriptLife::lINIT_PINGOUIN(TwinEEngine *engine, LifeScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "LIFE::INIT_PINGOUIN(%i)", (int)penguinActor);
engine->_scene->_mecaPenguinIdx = penguinActor;
ActorStruct *penguin = engine->_scene->getActor(penguinActor);
- penguin->_dynamicFlags.bIsDead = 1;
+ penguin->_workFlags.bIsDead = 1;
penguin->_body = -1;
penguin->_zoneSce = -1;
return 0;
@@ -1948,7 +1948,7 @@ int32 ScriptLife::lHOLOMAP_TRAJ(TwinEEngine *engine, LifeScriptContext &ctx) {
* @note Opcode @c 0x61
*/
int32 ScriptLife::lGAME_OVER(TwinEEngine *engine, LifeScriptContext &ctx) {
- engine->_scene->_sceneHero->_dynamicFlags.bAnimEnded = 1;
+ engine->_scene->_sceneHero->_workFlags.bAnimEnded = 1;
engine->_scene->_sceneHero->setLife(0);
engine->_gameState->setLeafs(0);
debugC(3, kDebugLevels::kDebugScripts, "LIFE::GAME_OVER()");
diff --git a/engines/twine/script/script_life_v2.cpp b/engines/twine/script/script_life_v2.cpp
index 67d9f6de7e2..ec19683cf23 100644
--- a/engines/twine/script/script_life_v2.cpp
+++ b/engines/twine/script/script_life_v2.cpp
@@ -219,7 +219,7 @@ int32 ScriptLifeV2::lPLAY_MUSIC(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 ScriptLifeV2::lTRACK_TO_VAR_GAME(TwinEEngine *engine, LifeScriptContext &ctx) {
const int32 num = ctx.stream.readByte();
debugC(3, kDebugLevels::kDebugScripts, "LIFE::lTRACK_TO_VAR_GAME(%i)", (int)num);
- engine->_gameState->setGameFlag(num, MAX<int32>(0, ctx.actor->_labelIdx));
+ engine->_gameState->setGameFlag(num, MAX<int32>(0, ctx.actor->_labelTrack));
return 0;
}
@@ -284,7 +284,7 @@ int16 ScriptLifeV2::searchOffsetTrack(ActorStruct *ptrobj, uint8 label) {
uint8 macro;
for (;;) {
- ptrtrack = ptrobj->_moveScript + offsettrack;
+ ptrtrack = ptrobj->_ptrTrack + offsettrack;
macro = *ptrtrack++;
offsettrack++;
@@ -292,8 +292,8 @@ int16 ScriptLifeV2::searchOffsetTrack(ActorStruct *ptrobj, uint8 label) {
switch (macro) {
case TM_LABEL:
if (*ptrtrack == label) {
- ptrobj->_labelIdx = label; /* label */
- ptrobj->_currentLabelPtr = (int16)(offsettrack - 1);
+ ptrobj->_labelTrack = label; /* label */
+ ptrobj->_offsetLabelTrack = (int16)(offsettrack - 1);
return ((int16)(offsettrack - 1));
}
offsettrack++;
@@ -375,9 +375,9 @@ int16 ScriptLifeV2::searchOffsetTrack(ActorStruct *ptrobj, uint8 label) {
void ScriptLifeV2::cleanTrack(ActorStruct *ptrobj) {
if (ptrobj->_offsetTrack != -1) {
- ptrobj->_dynamicFlags.bTRACK_MASTER_ROT = 0;
+ ptrobj->_workFlags.bTRACK_MASTER_ROT = 0;
- uint8 *ptrtrack = ptrobj->_moveScript + ptrobj->_offsetTrack;
+ uint8 *ptrtrack = ptrobj->_ptrTrack + ptrobj->_offsetTrack;
switch (*ptrtrack) {
case TM_FACE_TWINSEN:
diff --git a/engines/twine/script/script_move.cpp b/engines/twine/script/script_move.cpp
index 7ba1db9f3b8..d37a26c091d 100644
--- a/engines/twine/script/script_move.cpp
+++ b/engines/twine/script/script_move.cpp
@@ -118,7 +118,7 @@ int32 ScriptMove::mGOTO_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
int32 ScriptMove::mWAIT_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_ANIM()");
- if (!ctx.actor->_dynamicFlags.bAnimEnded) {
+ if (!ctx.actor->_workFlags.bAnimEnded) {
ctx.undo(0);
} else {
engine->_movements->clearRealAngle(ctx.actor);
@@ -182,11 +182,11 @@ int32 ScriptMove::mPOS_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x09
*/
int32 ScriptMove::mLABEL(TwinEEngine *engine, MoveScriptContext &ctx) {
- ctx.actor->_labelIdx = ctx.stream.readByte();
- ctx.actor->_currentLabelPtr = ctx.stream.pos() - 2;
- debugC(3, kDebugLevels::kDebugScripts, "MOVE::LABEL(%i)", (int)ctx.actor->_labelIdx);
+ ctx.actor->_labelTrack = ctx.stream.readByte();
+ ctx.actor->_offsetLabelTrack = ctx.stream.pos() - 2;
+ debugC(3, kDebugLevels::kDebugScripts, "MOVE::LABEL(%i)", (int)ctx.actor->_labelTrack);
if (engine->_scene->_currentSceneIdx == LBA1SceneId::Proxima_Island_Museum && ctx.actor->_actorIdx == 2 &&
- (ctx.actor->_labelIdx == 0 || ctx.actor->_labelIdx == 1)) {
+ (ctx.actor->_labelTrack == 0 || ctx.actor->_labelTrack == 1)) {
engine->unlockAchievement("LBA_ACH_004");
}
return 0;
@@ -251,7 +251,7 @@ int32 ScriptMove::mWAIT_NUM_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
const int32 animRepeats = ctx.stream.readByte();
int32 animPos = ctx.stream.readByte();
debugC(3, kDebugLevels::kDebugScripts, "MOVE::WAIT_NUM_ANIM(%i, %i)", (int)animRepeats, animPos);
- if (ctx.actor->_dynamicFlags.bAnimEnded) {
+ if (ctx.actor->_workFlags.bAnimEnded) {
animPos++;
if (animPos == animRepeats) {
@@ -335,14 +335,14 @@ int32 ScriptMove::mBACKGROUND(TwinEEngine *engine, MoveScriptContext &ctx) {
if (val != 0) {
if (!ctx.actor->_staticFlags.bIsBackgrounded) {
ctx.actor->_staticFlags.bIsBackgrounded = 1;
- if (ctx.actor->_dynamicFlags.bIsDrawn) {
+ if (ctx.actor->_workFlags.bIsDrawn) {
engine->_redraw->_firstTime = true;
}
}
} else {
if (ctx.actor->_staticFlags.bIsBackgrounded) {
ctx.actor->_staticFlags.bIsBackgrounded = 0;
- if (ctx.actor->_dynamicFlags.bIsDrawn) {
+ if (ctx.actor->_workFlags.bIsDrawn) {
engine->_redraw->_firstTime = true;
}
}
@@ -410,7 +410,7 @@ int32 ScriptMove::mOPEN_GENERIC(TwinEEngine *engine, MoveScriptContext &ctx, int
if (ctx.actor->_staticFlags.bIsSpriteActor && ctx.actor->_staticFlags.bUsesClipping) {
ctx.actor->_beta = angle;
ctx.actor->_doorWidth = doorStatus;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 1;
+ ctx.actor->_workFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = 1000;
engine->_movements->setActorAngle(LBAAngles::ANGLE_0, LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
}
@@ -462,7 +462,7 @@ int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "MOVE::CLOSE()");
if (ctx.actor->_staticFlags.bIsSpriteActor && ctx.actor->_staticFlags.bUsesClipping) {
ctx.actor->_doorWidth = 0;
- ctx.actor->_dynamicFlags.bIsSpriteMoving = 1;
+ ctx.actor->_workFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = -1000;
engine->_movements->setActorAngle(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
}
diff --git a/engines/twine/script/script_move.h b/engines/twine/script/script_move.h
index 25d269346c2..e77da56ab47 100644
--- a/engines/twine/script/script_move.h
+++ b/engines/twine/script/script_move.h
@@ -34,7 +34,7 @@ struct MoveScriptContext {
Common::MemorySeekableReadWriteStream stream;
- MoveScriptContext(int32 _actorIdx, ActorStruct *_actor) : actorIdx(_actorIdx), actor(_actor), stream(actor->_moveScript, actor->_moveScriptSize) {
+ MoveScriptContext(int32 _actorIdx, ActorStruct *_actor) : actorIdx(_actorIdx), actor(_actor), stream(actor->_ptrTrack, actor->_moveScriptSize) {
assert(actor->_offsetTrack >= 0);
stream.skip(actor->_offsetTrack);
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 7771f334b25..aeb7e3379e9 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -781,7 +781,7 @@ void TwinEEngine::processInventoryAction() {
// the problem is that the value set to 1 even if the penguin is not yet spawned
// this might either be a problem with initObject() not being called for the penguin
// or some other flaw that doesn't ignore the penguin until spawned
- penguin->_dynamicFlags.bIsFalling = 0;
+ penguin->_workFlags.bIsFalling = 0;
penguin->_beta = _scene->_sceneHero->_beta;
debug("penguin angle: %i", penguin->_beta);
@@ -790,7 +790,7 @@ void TwinEEngine::processInventoryAction() {
penguin->setLife(kActorMaxLife);
penguin->_genBody = BodyType::btNone;
_actor->initBody(BodyType::btNormal, _scene->_mecaPenguinIdx);
- penguin->_dynamicFlags.bIsDead = 0;
+ penguin->_workFlags.bIsDead = 0;
penguin->setCollision(ShapeType::kNone);
_movements->initRealAngleConst(penguin->_beta, penguin->_beta, penguin->_speed, &penguin->realAngle);
_gameState->removeItem(InventoryItems::kiPenguin);
@@ -1017,7 +1017,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
for (int32 a = 0; a < _scene->_nbObjets; a++) {
ActorStruct *actor = _scene->getActor(a);
- if (actor->_dynamicFlags.bIsDead) {
+ if (actor->_workFlags.bIsDead) {
continue;
}
@@ -1093,7 +1093,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
if (actor->_lifePoint <= 0) {
if (IS_HERO(a)) {
- if (actor->_dynamicFlags.bAnimEnded) {
+ if (actor->_workFlags.bAnimEnded) {
if (_gameState->_inventoryNumLeafs > 0) { // use clover leaf automaticaly
_scene->_sceneHero->_pos = _scene->_newHeroPos;
@@ -1133,7 +1133,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
}
} else {
_actor->processActorCarrier(a);
- actor->_dynamicFlags.bIsDead = 1;
+ actor->_workFlags.bIsDead = 1;
actor->_body = -1;
actor->_zoneSce = -1;
}
More information about the Scummvm-git-logs
mailing list