[Scummvm-git-logs] scummvm master -> 7caf4425affccf721c9b45e1139513af0652b12d
mgerhardy
noreply at scummvm.org
Sat Jun 11 10:45:35 UTC 2022
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c2825bfc45 TWINE: renamed variables and added comments from the original code
cb4eae873c TWINE: renamed member
fe56c0d0fa TWINE: renamed member to match original sources
0f411e7669 TWINE: renamed member to match original sources
7caf4425af TWINE: renamed variable
Commit: c2825bfc45361ea9a027dd786fb9e6ae90c557b3
https://github.com/scummvm/scummvm/commit/c2825bfc45361ea9a027dd786fb9e6ae90c557b3
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-11T12:43:33+02:00
Commit Message:
TWINE: renamed variables and added comments from the original code
Changed paths:
engines/twine/renderer/redraw.cpp
engines/twine/scene/actor.h
engines/twine/scene/animations.cpp
engines/twine/scene/extra.h
engines/twine/scene/scene.cpp
engines/twine/script/script_life_v1.cpp
engines/twine/script/script_move_v1.cpp
engines/twine/twine.cpp
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index aca6e8c8056..777e95f0516 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -189,7 +189,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool bgRedraw) {
int32 drawListPos = 0;
for (int32 a = 0; a < _engine->_scene->_sceneNumActors; a++) {
ActorStruct *actor = _engine->_scene->getActor(a);
- actor->_dynamicFlags.bIsVisible = 0; // reset visible state
+ actor->_dynamicFlags.bIsDrawn = 0; // reset visible state
if (_engine->_grid->_useCellingGrid != -1 && actor->_pos.y > _engine->_scene->_sceneZones[_engine->_grid->_cellingGridIdx].maxs.y) {
continue;
@@ -201,7 +201,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool bgRedraw) {
// check if actor is visible on screen, otherwise don't display it
if (projPos.x > -50 && projPos.x < _engine->width() + 40 && projPos.y > -30 && projPos.y < _engine->height() + 100) {
- actor->_dynamicFlags.bIsVisible = 1;
+ actor->_dynamicFlags.bIsDrawn = 1;
}
continue;
}
@@ -361,7 +361,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
}
if (_engine->_interface->setClip(renderRect)) {
- actor->_dynamicFlags.bIsVisible = 1;
+ actor->_dynamicFlags.bIsDrawn = 1;
const int32 tempX = (actor->_pos.x + BRICK_HEIGHT) / BRICK_SIZE;
int32 tempY = actor->_pos.y / BRICK_HEIGHT;
@@ -415,7 +415,7 @@ void Redraw::processDrawListActorSprites(const DrawListStruct &drawCmd, bool bgR
if (validClip) {
_engine->_grid->drawSprite(0, renderRect.left, renderRect.top, spritePtr);
- actor->_dynamicFlags.bIsVisible = 1;
+ actor->_dynamicFlags.bIsDrawn = 1;
if (actor->_staticFlags.bUsesClipping) {
const int32 tmpX = (actor->_animStep.x + BRICK_HEIGHT) / BRICK_SIZE;
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 35417e4a782..17162aa1bab 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -63,23 +63,23 @@ struct AnimTimerDataStruct {
/** Actors static flags structure */
struct StaticFlagsStruct {
- uint32 bComputeCollisionWithObj : 1; // 0x000001
- uint32 bComputeCollisionWithBricks : 1; // 0x000002
- uint32 bIsZonable : 1; // 0x000004
- uint32 bUsesClipping : 1; // 0x000008
- uint32 bCanBePushed : 1; // 0x000010
- uint32 bComputeLowCollision : 1; // 0x000020
- uint32 bCanDrown : 1; // 0x000040
+ uint32 bComputeCollisionWithObj : 1; // 0x000001 CHECK_OBJ_COL
+ uint32 bComputeCollisionWithBricks : 1; // 0x000002 CHECK_BRICK_COL
+ uint32 bIsZonable : 1; // 0x000004 CHECK_ZONE - testing of scenaric areas
+ uint32 bUsesClipping : 1; // 0x000008 SPRITE_CLIP - (doors) fixed clip area
+ uint32 bCanBePushed : 1; // 0x000010 PUSHABLE
+ uint32 bComputeLowCollision : 1; // 0x000020 COL_BASSE
+ uint32 bCanDrown : 1; // 0x000040 CHECK_CODE_JEU
uint32 bComputeCollisionWithFloor : 1; // 0x000080
uint32 bUnk0100 : 1; // 0x000100
- uint32 bIsHidden : 1; // 0x000200
- uint32 bIsSpriteActor : 1; // 0x000400
- uint32 bCanFall : 1; // 0x000800
- uint32 bDoesntCastShadow : 1; // 0x001000
- uint32 bIsBackgrounded : 1; // 0x002000
- uint32 bIsCarrierActor : 1; // 0x004000
+ uint32 bIsHidden : 1; // 0x000200 INVISIBLE - not drawn but all computed
+ uint32 bIsSpriteActor : 1; // 0x000400 SPRITE_3D - a sprite not a 3D object
+ uint32 bCanFall : 1; // 0x000800 OBJ_FALLABLE
+ uint32 bDoesntCastShadow : 1; // 0x001000 NO_SHADOW - no auto shadow
+ uint32 bIsBackgrounded : 1; // 0x002000 OBJ_BACKGROUND - is embedded in the decor the 1st time
+ uint32 bIsCarrierActor : 1; // 0x004000 OBJ_CARRIER - can carry and move an obj
// take smaller value for bound, or if not set take average for bound
- uint32 bUseMiniZv : 1; // 0x008000
+ uint32 bUseMiniZv : 1; // 0x008000 MINI_ZV - square on smaller dimension (if 3D object)
uint32 bHasInvalidPosition : 1; // 0x010000
uint32 bNoElectricShock : 1; // 0x020000
uint32 bHasSpriteAnim3D : 1; // 0x040000
@@ -90,15 +90,15 @@ struct StaticFlagsStruct {
/** Actors dynamic flags structure */
struct DynamicFlagsStruct {
- uint16 bWaitHitFrame : 1; // 0x0001 wait for hit frame
- uint16 bIsHitting : 1; // 0x0002 hit frame anim
- uint16 bAnimEnded : 1; // 0x0004 anim ended in the current loop (will be looped in the next engine loop)
- uint16 bAnimFrameReached : 1; // 0x0008 new frame anim reached
- uint16 bIsVisible : 1; // 0x0010 actor has been drawn in this loop
- uint16 bIsDead : 1; // 0x0020 is dead
- uint16 bIsSpriteMoving : 1; // 0x0040 door is opening or closing (wait to reach the destination position)
- uint16 bIsRotationByAnim : 1; // 0x0080 actor rotation is managed by its animaation not by the engine
- uint16 bIsFalling : 1; // 0x0100 is falling on scene
+ 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 bAnimFrameReached : 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
@@ -119,10 +119,10 @@ struct DynamicFlagsStruct {
* will be chosen randomly each time player uses Action.
*/
struct BonusParameter {
- uint16 unk1 : 1;
- uint16 unk2 : 1;
- uint16 unk3 : 1;
- uint16 unk4 : 1;
+ uint16 givenNothing : 1;
+ uint16 unk2 : 1; // unused in lba1
+ uint16 unk3 : 1; // unused in lba1
+ uint16 unk4 : 1; // unused in lba1
uint16 kashes : 1;
uint16 lifepoints : 1;
uint16 magicpoints : 1;
@@ -221,7 +221,7 @@ public:
int32 _lastRotationAngle = ANGLE_0;
IVec3 _animStep;
int32 _previousAnimIdx = 0;
- int32 _doorStatus = 0;
+ int32 _doorWidth = 0;
int32 _animPosition = 0;
AnimType _animType = AnimType::kAnimationTypeLoop;
int32 _spriteActorRotation = 0;
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 7d42a163eda..684e64ff65c 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -499,18 +499,17 @@ void Animations::processActorAnimations(int32 actorIdx) {
_engine->_movements->setActorAngle(ANGLE_0, actor->_speed, ANGLE_17, &actor->_move);
- // AUTO_STOP_DOOR
if (actor->_dynamicFlags.bIsSpriteMoving) {
- if (actor->_doorStatus) { // open door
- if (getDistance2D(processActor.x, processActor.z, actor->_animStep.x, actor->_animStep.z) >= actor->_doorStatus) {
+ if (actor->_doorWidth) { // open door
+ if (getDistance2D(processActor.x, processActor.z, actor->_animStep.x, actor->_animStep.z) >= actor->_doorWidth) {
if (actor->_angle == ANGLE_0) { // down
- processActor.z = actor->_animStep.z + actor->_doorStatus;
+ processActor.z = actor->_animStep.z + actor->_doorWidth;
} else if (actor->_angle == ANGLE_90) { // right
- processActor.x = actor->_animStep.x + actor->_doorStatus;
+ processActor.x = actor->_animStep.x + actor->_doorWidth;
} else if (actor->_angle == ANGLE_180) { // up
- processActor.z = actor->_animStep.z - actor->_doorStatus;
+ processActor.z = actor->_animStep.z - actor->_doorWidth;
} else if (actor->_angle == ANGLE_270) { // left
- processActor.x = actor->_animStep.x - actor->_doorStatus;
+ processActor.x = actor->_animStep.x - actor->_doorWidth;
}
actor->_dynamicFlags.bIsSpriteMoving = 0;
diff --git a/engines/twine/scene/extra.h b/engines/twine/scene/extra.h
index 870e9e588a6..d6a6d7b83b5 100644
--- a/engines/twine/scene/extra.h
+++ b/engines/twine/scene/extra.h
@@ -70,16 +70,16 @@ struct ExtraListStruct {
ActorMoveStruct trackActorMove;
uint16 type = 0; /**< ExtraType bitmask */
- int16 angle = 0; // field_16
- int32 spawnTime = 0;
+ int16 angle = 0; // weight
+ int32 spawnTime = 0; // memo timer 50hz
union payload { // field_ 1C
int16 lifeTime;
int16 actorIdx;
int16 extraIdx;
int16 unknown;
} payload{0};
- int16 strengthOfHit = 0; // field_1E
- int16 info1 = 0; // field_20
+ int16 strengthOfHit = 0; // apply damage if != 0
+ int16 info1 = 0; // various - number for zone giver
};
class TwinEEngine;
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 88a3adc4bd2..8dabe945ad6 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -90,7 +90,7 @@ void Scene::setActorStaticFlags(ActorStruct *act, uint32 staticFlags) {
act->_staticFlags.bDoesntCastShadow = 1;
}
if (staticFlags & 0x2000) {
- //act->staticFlags.bIsBackgrounded = 1;
+ act->_staticFlags.bIsBackgrounded = 1;
}
if (staticFlags & 0x4000) {
act->_staticFlags.bIsCarrierActor = 1;
@@ -120,7 +120,7 @@ void Scene::setActorStaticFlags(ActorStruct *act, uint32 staticFlags) {
void Scene::setBonusParameterFlags(ActorStruct *act, uint16 bonusFlags) {
if (bonusFlags & 0x1) {
- act->_bonusParameter.unk1 = 1;
+ act->_bonusParameter.givenNothing = 1;
}
if (bonusFlags & 0x2) {
act->_bonusParameter.unk2 = 1;
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 10038cd0b6e..4c0e96beb1b 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -1120,7 +1120,7 @@ static int32 lGIVE_BONUS(TwinEEngine *engine, LifeScriptContext &ctx) {
}
if (flag != 0) {
- ctx.actor->_bonusParameter.unk1 = 1;
+ ctx.actor->_bonusParameter.givenNothing = 1;
}
return 0;
diff --git a/engines/twine/script/script_move_v1.cpp b/engines/twine/script/script_move_v1.cpp
index 7aaf3a942a4..f108cedf7d6 100644
--- a/engines/twine/script/script_move_v1.cpp
+++ b/engines/twine/script/script_move_v1.cpp
@@ -359,14 +359,14 @@ static int32 mBACKGROUND(TwinEEngine *engine, MoveScriptContext &ctx) {
if (val != 0) {
if (!ctx.actor->_staticFlags.bIsBackgrounded) {
ctx.actor->_staticFlags.bIsBackgrounded = 1;
- if (ctx.actor->_dynamicFlags.bIsVisible) {
+ if (ctx.actor->_dynamicFlags.bIsDrawn) {
engine->_redraw->_reqBgRedraw = true;
}
}
} else {
if (ctx.actor->_staticFlags.bIsBackgrounded) {
ctx.actor->_staticFlags.bIsBackgrounded = 0;
- if (ctx.actor->_dynamicFlags.bIsVisible) {
+ if (ctx.actor->_dynamicFlags.bIsDrawn) {
engine->_redraw->_reqBgRedraw = true;
}
}
@@ -433,7 +433,7 @@ static int32 mOPEN_GENERIC(TwinEEngine *engine, MoveScriptContext &ctx, int32 an
debugC(3, kDebugLevels::kDebugScripts, "MOVE::OPEN(%i, %i)", (int)doorStatus, angle);
if (ctx.actor->_staticFlags.bIsSpriteActor && ctx.actor->_staticFlags.bUsesClipping) {
ctx.actor->_angle = angle;
- ctx.actor->_doorStatus = doorStatus;
+ ctx.actor->_doorWidth = doorStatus;
ctx.actor->_dynamicFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = 1000;
engine->_movements->setActorAngle(ANGLE_0, ANGLE_351, ANGLE_17, &ctx.actor->_move);
@@ -485,7 +485,7 @@ static int32 mOPEN_DOWN(TwinEEngine *engine, MoveScriptContext &ctx) {
static int32 mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "MOVE::CLOSE()");
if (ctx.actor->_staticFlags.bIsSpriteActor && ctx.actor->_staticFlags.bUsesClipping) {
- ctx.actor->_doorStatus = 0;
+ ctx.actor->_doorWidth = 0;
ctx.actor->_dynamicFlags.bIsSpriteMoving = 1;
ctx.actor->_speed = -1000;
engine->_movements->setActorAngle(ANGLE_0, -ANGLE_351, ANGLE_17, &ctx.actor->_move);
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 0f1a7c2f434..0bbf1f0cb3d 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -936,7 +936,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
}
}
- if (!actor->_bonusParameter.unk1 && (actor->_bonusParameter.cloverleaf || actor->_bonusParameter.kashes || actor->_bonusParameter.key || actor->_bonusParameter.lifepoints || actor->_bonusParameter.magicpoints)) {
+ if (!actor->_bonusParameter.givenNothing && (actor->_bonusParameter.cloverleaf || actor->_bonusParameter.kashes || actor->_bonusParameter.key || actor->_bonusParameter.lifepoints || actor->_bonusParameter.magicpoints)) {
_actor->processActorExtraBonus(a);
}
}
@@ -985,7 +985,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
} else {
_sound->playSample(Samples::Explode, 1, actor->pos(), a);
if (actor->_bonusParameter.cloverleaf || actor->_bonusParameter.kashes || actor->_bonusParameter.key || actor->_bonusParameter.lifepoints || actor->_bonusParameter.magicpoints) {
- if (!actor->_bonusParameter.unk1) {
+ if (!actor->_bonusParameter.givenNothing) {
_actor->processActorExtraBonus(a);
}
actor->setLife(0);
Commit: cb4eae873c16d7e8e564f4244474cee0a83e1def
https://github.com/scummvm/scummvm/commit/cb4eae873c16d7e8e564f4244474cee0a83e1def
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-11T12:43:53+02:00
Commit Message:
TWINE: renamed member
Changed paths:
engines/twine/parser/entity.cpp
engines/twine/parser/entity.h
engines/twine/scene/actor.cpp
diff --git a/engines/twine/parser/entity.cpp b/engines/twine/parser/entity.cpp
index 2f0f7c3bd96..45e390cb9c2 100644
--- a/engines/twine/parser/entity.cpp
+++ b/engines/twine/parser/entity.cpp
@@ -29,7 +29,7 @@ bool EntityData::loadBody(Common::SeekableReadStream &stream) {
body.index = stream.readByte();
const int32 pos = stream.pos();
uint8 size = stream.readByte();
- body.bodyIndex = (int16)stream.readUint16LE();
+ body.hqrBodyIndex = (int16)stream.readUint16LE();
const uint8 numActions = stream.readByte();
for (uint8 i = 0U; i < numActions; ++i) {
if ((ActionType)stream.readByte() == ActionType::ACTION_ZV) {
diff --git a/engines/twine/parser/entity.h b/engines/twine/parser/entity.h
index cf78310ff9d..9fbc91822f0 100644
--- a/engines/twine/parser/entity.h
+++ b/engines/twine/parser/entity.h
@@ -33,7 +33,7 @@ namespace TwinE {
struct EntityBody {
int index; /**< index in file3d.hqr */
ActorBoundingBox actorBoundingBox;
- int bodyIndex; /**< index in body.hqr */
+ int hqrBodyIndex; /**< index in body.hqr */
};
struct EntityAnim {
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index cfb9e18bada..563a414b58a 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -160,7 +160,7 @@ int32 Actor::initBody(BodyType bodyIdx, int32 actorIdx, ActorBoundingBox &actorB
return -1;
}
actorBoundingBox = body->actorBoundingBox;
- return body->bodyIndex;
+ return body->hqrBodyIndex;
}
void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
@@ -176,8 +176,8 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
}
ActorBoundingBox actorBoundingBox;
- const int32 entityIdx = initBody(bodyIdx, actorIdx, actorBoundingBox);
- if (entityIdx == -1) {
+ const int32 newBody = initBody(bodyIdx, actorIdx, actorBoundingBox);
+ if (newBody == -1) {
localActor->_body = BodyType::btNone;
localActor->_entity = -1;
localActor->_boundingBox = BoundingBox();
@@ -185,11 +185,11 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
return;
}
- if (localActor->_entity == entityIdx) {
+ if (localActor->_entity == newBody) {
return;
}
- localActor->_entity = entityIdx;
+ localActor->_entity = newBody;
localActor->_body = bodyIdx;
if (actorBoundingBox.hasBoundingBox) {
Commit: fe56c0d0fab61e30aaacff23a9c654b184d481fc
https://github.com/scummvm/scummvm/commit/fe56c0d0fab61e30aaacff23a9c654b184d481fc
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-11T12:44:17+02:00
Commit Message:
TWINE: renamed member to match original sources
Changed paths:
engines/twine/scene/actor.cpp
engines/twine/scene/actor.h
engines/twine/scene/gamestate.cpp
engines/twine/scene/movements.cpp
engines/twine/scene/scene.cpp
engines/twine/script/script_life_v1.cpp
engines/twine/twine.cpp
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 563a414b58a..222ce4d7056 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -118,10 +118,10 @@ void Actor::setBehaviour(HeroBehaviourType behaviour) {
break;
};
- const BodyType bodyIdx = sceneHero->_body;
+ const BodyType bodyIdx = sceneHero->_genBody;
sceneHero->_entity = -1;
- sceneHero->_body = BodyType::btNone;
+ sceneHero->_genBody = BodyType::btNone;
initModelActor(bodyIdx, OWN_ACTOR_SCENE_INDEX);
@@ -178,7 +178,7 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
ActorBoundingBox actorBoundingBox;
const int32 newBody = initBody(bodyIdx, actorIdx, actorBoundingBox);
if (newBody == -1) {
- localActor->_body = BodyType::btNone;
+ localActor->_genBody = BodyType::btNone;
localActor->_entity = -1;
localActor->_boundingBox = BoundingBox();
debug("Failed to initialize body %i for actor %i", (int)bodyIdx, actorIdx);
@@ -190,7 +190,7 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
}
localActor->_entity = newBody;
- localActor->_body = bodyIdx;
+ localActor->_genBody = bodyIdx;
if (actorBoundingBox.hasBoundingBox) {
localActor->_boundingBox = actorBoundingBox.bbox;
@@ -239,8 +239,8 @@ void Actor::initActor(int16 actorIdx) {
} else {
actor->_entity = -1;
- debug(1, "Init actor %i with model %i", actorIdx, (int)actor->_body);
- initModelActor(actor->_body, actorIdx);
+ debug(1, "Init actor %i with model %i", actorIdx, (int)actor->_genBody);
+ initModelActor(actor->_genBody, actorIdx);
actor->_previousAnimIdx = -1;
actor->_animType = AnimType::kAnimationTypeLoop;
@@ -261,7 +261,7 @@ void Actor::resetActor(int16 actorIdx) {
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
actor->_actorIdx = actorIdx;
- actor->_body = BodyType::btNormal;
+ actor->_genBody = BodyType::btNormal;
actor->_anim = AnimationTypes::kStanding;
actor->_pos = IVec3(0, -1, 0);
actor->_spriteActorRotation = 0;
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 17162aa1bab..1ef553864a0 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -168,7 +168,7 @@ public:
const IVec3 &pos() const;
int32 _entity = 0; // costumeIndex - index into bodyTable
- BodyType _body = BodyType::btNormal;
+ BodyType _genBody = BodyType::btNormal;
AnimationTypes _anim = AnimationTypes::kAnimNone;
AnimationTypes _animExtra = AnimationTypes::kStanding;
AnimationTypes _animExtraPtr = AnimationTypes::kAnimNone;
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index b1514ad4904..183fbdc8c15 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -95,7 +95,7 @@ void GameState::initHeroVars() {
_usingSabre = false;
- _engine->_scene->_sceneHero->_body = BodyType::btNormal;
+ _engine->_scene->_sceneHero->_genBody = BodyType::btNormal;
_engine->_scene->_sceneHero->setLife(kActorMaxLife);
_engine->_scene->_sceneHero->_talkColor = COLOR_BRIGHT_BLUE;
}
@@ -193,7 +193,7 @@ bool GameState::loadGame(Common::SeekableReadStream *file) {
_engine->_scene->_newHeroPos.z = file->readSint16LE();
_engine->_scene->_sceneHero->_angle = ToAngle(file->readSint16LE());
_engine->_actor->_previousHeroAngle = _engine->_scene->_sceneHero->_angle;
- _engine->_scene->_sceneHero->_body = (BodyType)file->readByte();
+ _engine->_scene->_sceneHero->_genBody = (BodyType)file->readByte();
const byte numHolomapFlags = file->readByte(); // number of holomap locations
if (numHolomapFlags != NUM_LOCATIONS) {
@@ -260,7 +260,7 @@ bool GameState::saveGame(Common::WriteStream *file) {
file->writeSint16LE(_engine->_scene->_newHeroPos.y);
file->writeSint16LE(_engine->_scene->_newHeroPos.z);
file->writeSint16LE(FromAngle(_engine->_scene->_sceneHero->_angle));
- file->writeByte((uint8)_engine->_scene->_sceneHero->_body);
+ file->writeByte((uint8)_engine->_scene->_sceneHero->_genBody);
// number of holomap locations
file->writeByte(NUM_LOCATIONS);
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index acf9d398226..1635869aa87 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -275,7 +275,7 @@ bool Movements::processAttackExecution(int actorIdx) {
return true;
}
} else if (_engine->_gameState->hasItem(InventoryItems::kiUseSabre)) {
- if (actor->_body != BodyType::btSabre) {
+ if (actor->_genBody != BodyType::btSabre) {
_engine->_actor->initModelActor(BodyType::btSabre, actorIdx);
}
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 8dabe945ad6..f09b95e4630 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -195,7 +195,7 @@ bool Scene::loadSceneLBA2() {
act->loadModel((int16)stream.readUint16LE(), false);
- act->_body = (BodyType)stream.readSint16LE();
+ act->_genBody = (BodyType)stream.readSint16LE();
act->_anim = (AnimationTypes)stream.readByte();
act->_sprite = (int16)stream.readUint16LE();
act->_pos.x = (int16)stream.readUint16LE();
@@ -326,7 +326,7 @@ bool Scene::loadSceneLBA1() {
act->loadModel(stream.readUint16LE(), true);
- act->_body = (BodyType)stream.readByte();
+ act->_genBody = (BodyType)stream.readByte();
act->_anim = (AnimationTypes)stream.readByte();
act->_sprite = (int16)stream.readUint16LE();
act->_pos.x = (int16)stream.readUint16LE();
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 4c0e96beb1b..3a0b04fdb42 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -189,12 +189,12 @@ static int32 processLifeConditions(TwinEEngine *engine, LifeScriptContext &ctx)
}
case kcBODY:
debugCN(3, kDebugLevels::kDebugScripts, "body(");
- engine->_scene->_currentScriptValue = (int16)ctx.actor->_body;
+ engine->_scene->_currentScriptValue = (int16)ctx.actor->_genBody;
break;
case kcBODY_OBJ: {
int32 actorIdx = ctx.stream.readByte();
debugCN(3, kDebugLevels::kDebugScripts, "body_obj(%i, ", actorIdx);
- engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_body;
+ engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_genBody;
break;
}
case kcANIM:
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 0bbf1f0cb3d..c0c74574f74 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -674,7 +674,7 @@ void TwinEEngine::processInventoryAction() {
_gameState->_usingSabre = false;
break;
case kiUseSabre:
- if (_scene->_sceneHero->_body != BodyType::btSabre) {
+ if (_scene->_sceneHero->_genBody != BodyType::btSabre) {
if (_actor->_heroBehaviour == HeroBehaviourType::kProtoPack) {
_actor->setBehaviour(HeroBehaviourType::kNormal);
}
@@ -690,9 +690,9 @@ void TwinEEngine::processInventoryAction() {
}
case kiProtoPack:
if (_gameState->hasItem(InventoryItems::kiBookOfBu)) {
- _scene->_sceneHero->_body = BodyType::btNormal;
+ _scene->_sceneHero->_genBody = BodyType::btNormal;
} else {
- _scene->_sceneHero->_body = BodyType::btTunic;
+ _scene->_sceneHero->_genBody = BodyType::btTunic;
}
if (_actor->_heroBehaviour == HeroBehaviourType::kProtoPack) {
@@ -714,7 +714,7 @@ void TwinEEngine::processInventoryAction() {
if (!_collision->checkCollisionWithActors(_scene->_mecaPenguinIdx)) {
penguin->setLife(kActorMaxLife);
- penguin->_body = BodyType::btNone;
+ penguin->_genBody = BodyType::btNone;
_actor->initModelActor(BodyType::btNormal, _scene->_mecaPenguinIdx);
penguin->_dynamicFlags.bIsDead = 0;
penguin->setBrickShape(ShapeType::kNone);
@@ -850,9 +850,9 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
// use Proto-Pack
if (_input->toggleActionIfActive(TwinEActionType::UseProtoPack) && _gameState->hasItem(InventoryItems::kiProtoPack)) {
if (_gameState->hasItem(InventoryItems::kiBookOfBu)) {
- _scene->_sceneHero->_body = BodyType::btNormal;
+ _scene->_sceneHero->_genBody = BodyType::btNormal;
} else {
- _scene->_sceneHero->_body = BodyType::btTunic;
+ _scene->_sceneHero->_genBody = BodyType::btTunic;
}
if (_actor->_heroBehaviour == HeroBehaviourType::kProtoPack) {
Commit: 0f411e7669f5d3115d635a56011ae538db4668ec
https://github.com/scummvm/scummvm/commit/0f411e7669f5d3115d635a56011ae538db4668ec
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-11T12:44:22+02:00
Commit Message:
TWINE: renamed member to match original sources
Changed paths:
engines/twine/menu/menu.cpp
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/gamestate.cpp
engines/twine/scene/movements.cpp
engines/twine/script/script_life_v1.cpp
engines/twine/twine.cpp
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index f4ec5f1fd7a..0b9f83eaeff 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1101,7 +1101,7 @@ void Menu::processBehaviourMenu() {
_engine->_actor->setBehaviour(HeroBehaviourType::kNormal);
}
- _behaviourEntity = &_engine->_resources->_bodyData[_engine->_scene->_sceneHero->_entity];
+ _behaviourEntity = &_engine->_resources->_bodyData[_engine->_scene->_sceneHero->_body];
_engine->_actor->_heroAnimIdx[(byte)HeroBehaviourType::kNormal] = _engine->_actor->_heroAnimIdxNORMAL;
_engine->_actor->_heroAnimIdx[(byte)HeroBehaviourType::kAthletic] = _engine->_actor->_heroAnimIdxATHLETIC;
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 777e95f0516..4e5e0f29f3c 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -206,7 +206,7 @@ int32 Redraw::fillActorDrawingList(DrawListStruct *drawList, bool bgRedraw) {
continue;
}
// if the actor isn't set as hidden
- if (actor->_entity == -1 || actor->_staticFlags.bIsHidden) {
+ if (actor->_body == -1 || actor->_staticFlags.bIsHidden) {
continue;
}
// get actor position on screen
@@ -343,7 +343,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
if (actor->_previousAnimIdx >= 0) {
const AnimData &animData = _engine->_resources->_animData[actor->_previousAnimIdx];
- _engine->_animations->setModelAnimation(actor->_animPosition, animData, _engine->_resources->_bodyData[actor->_entity], &actor->_animTimerData);
+ _engine->_animations->setModelAnimation(actor->_animPosition, animData, _engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
}
const IVec3 &delta = actor->pos() - _engine->_grid->_camera;
@@ -355,7 +355,7 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
}
}
- if (!_engine->_renderer->renderIsoModel(delta.x, delta.y, delta.z, ANGLE_0, actor->_angle, ANGLE_0, _engine->_resources->_bodyData[actor->_entity], renderRect)) {
+ if (!_engine->_renderer->renderIsoModel(delta.x, delta.y, delta.z, ANGLE_0, actor->_angle, ANGLE_0, _engine->_resources->_bodyData[actor->_body], renderRect)) {
_engine->_interface->resetClip();
return;
}
@@ -386,9 +386,9 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
void Redraw::processDrawListActorSprites(const DrawListStruct &drawCmd, bool bgRedraw) {
int32 actorIdx = drawCmd.actorIdx;
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- const SpriteData &spriteData = _engine->_resources->_spriteData[actor->_entity];
+ const SpriteData &spriteData = _engine->_resources->_spriteData[actor->_body];
// TODO: using the raw pointer and not the SpriteData surface here is a workaround for issue https://bugs.scummvm.org/ticket/12024
- const uint8 *spritePtr = _engine->_resources->_spriteTable[actor->_entity];
+ const uint8 *spritePtr = _engine->_resources->_spriteTable[actor->_body];
// get actor position on screen
const IVec3 &projPos = _engine->_renderer->projectPositionOnScreen(actor->pos() - _engine->_grid->_camera);
@@ -397,7 +397,7 @@ void Redraw::processDrawListActorSprites(const DrawListStruct &drawCmd, bool bgR
const int32 spriteHeight = spriteData.surface().h;
// calculate sprite position on screen
- const SpriteDim *dim = _engine->_resources->_spriteBoundingBox.dim(actor->_entity);
+ const SpriteDim *dim = _engine->_resources->_spriteBoundingBox.dim(actor->_body);
Common::Rect renderRect;
renderRect.left = projPos.x + dim->x;
renderRect.top = projPos.y + dim->y;
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 222ce4d7056..50bf35f476d 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -120,7 +120,7 @@ void Actor::setBehaviour(HeroBehaviourType behaviour) {
const BodyType bodyIdx = sceneHero->_genBody;
- sceneHero->_entity = -1;
+ sceneHero->_body = -1;
sceneHero->_genBody = BodyType::btNone;
initModelActor(bodyIdx, OWN_ACTOR_SCENE_INDEX);
@@ -134,9 +134,9 @@ void Actor::setBehaviour(HeroBehaviourType behaviour) {
void Actor::initSpriteActor(int32 actorIdx) {
ActorStruct *localActor = _engine->_scene->getActor(actorIdx);
- if (localActor->_staticFlags.bIsSpriteActor && localActor->_sprite != -1 && localActor->_entity != localActor->_sprite) {
+ if (localActor->_staticFlags.bIsSpriteActor && localActor->_sprite != -1 && localActor->_body != localActor->_sprite) {
const BoundingBox *spritebbox = _engine->_resources->_spriteBoundingBox.bbox(localActor->_sprite);
- localActor->_entity = localActor->_sprite;
+ localActor->_body = localActor->_sprite;
localActor->_boundingBox = *spritebbox;
}
}
@@ -179,23 +179,23 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
const int32 newBody = initBody(bodyIdx, actorIdx, actorBoundingBox);
if (newBody == -1) {
localActor->_genBody = BodyType::btNone;
- localActor->_entity = -1;
+ localActor->_body = -1;
localActor->_boundingBox = BoundingBox();
debug("Failed to initialize body %i for actor %i", (int)bodyIdx, actorIdx);
return;
}
- if (localActor->_entity == newBody) {
+ if (localActor->_body == newBody) {
return;
}
- localActor->_entity = newBody;
+ localActor->_body = newBody;
localActor->_genBody = bodyIdx;
if (actorBoundingBox.hasBoundingBox) {
localActor->_boundingBox = actorBoundingBox.bbox;
} else {
- const BodyData &bd = _engine->_resources->_bodyData[localActor->_entity];
+ const BodyData &bd = _engine->_resources->_bodyData[localActor->_body];
localActor->_boundingBox = bd.bbox;
int32 size = 0;
@@ -227,7 +227,7 @@ void Actor::initActor(int16 actorIdx) {
actor->_dynamicFlags.bIsHitting = 1;
}
- actor->_entity = -1;
+ actor->_body = -1;
initSpriteActor(actorIdx);
@@ -237,7 +237,7 @@ void Actor::initActor(int16 actorIdx) {
actor->_animStep = actor->pos();
}
} else {
- actor->_entity = -1;
+ actor->_body = -1;
debug(1, "Init actor %i with model %i", actorIdx, (int)actor->_genBody);
initModelActor(actor->_genBody, actorIdx);
@@ -245,7 +245,7 @@ void Actor::initActor(int16 actorIdx) {
actor->_previousAnimIdx = -1;
actor->_animType = AnimType::kAnimationTypeLoop;
- if (actor->_entity != -1) {
+ if (actor->_body != -1) {
_engine->_animations->initAnim(actor->_anim, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
}
@@ -291,7 +291,7 @@ void Actor::resetActor(int16 actorIdx) {
actor->_hitBy = -1;
actor->_lastRotationAngle = ANGLE_0;
actor->_animStep = IVec3();
- actor->_entity = -1;
+ actor->_body = -1;
actor->_previousAnimIdx = -1;
actor->_animType = AnimType::kAnimationTypeLoop;
actor->_animPosition = 0;
@@ -381,7 +381,7 @@ void Actor::processActorExtraBonus(int32 actorIdx) {
}
void ActorStruct::loadModel(int32 modelIndex, bool lba1) {
- _entity = modelIndex;
+ _body = modelIndex;
if (!_staticFlags.bIsSpriteActor) {
debug(1, "Init actor with model %i", modelIndex);
if (!_entityData.loadFromHQR(Resources::HQR_FILE3D_FILE, modelIndex, lba1)) {
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 1ef553864a0..82aac36790c 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -167,7 +167,7 @@ public:
const IVec3 &pos() const;
- int32 _entity = 0; // costumeIndex - index into bodyTable
+ int32 _body = 0; // costumeIndex - index into bodyTable
BodyType _genBody = BodyType::btNormal;
AnimationTypes _anim = AnimationTypes::kAnimNone;
AnimationTypes _animExtra = AnimationTypes::kStanding;
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 684e64ff65c..689eef56a61 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -389,7 +389,7 @@ void Animations::processAnimActions(int32 actorIdx) {
bool Animations::initAnim(AnimationTypes newAnim, AnimType animType, AnimationTypes animExtra, int32 actorIdx) {
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- if (actor->_entity == -1) {
+ if (actor->_body == -1) {
return false;
}
@@ -432,10 +432,10 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType animType, AnimationTy
if (actor->_previousAnimIdx == -1) {
// if no previous animation
- setAnimAtKeyframe(0, _engine->_resources->_animData[animIndex], _engine->_resources->_bodyData[actor->_entity], &actor->_animTimerData);
+ setAnimAtKeyframe(0, _engine->_resources->_animData[animIndex], _engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
} else {
// interpolation between animations
- stockAnimation(_engine->_resources->_bodyData[actor->_entity], &actor->_animTimerData);
+ stockAnimation(_engine->_resources->_bodyData[actor->_body], &actor->_animTimerData);
}
actor->_previousAnimIdx = animIndex;
@@ -462,7 +462,7 @@ void Animations::processActorAnimations(int32 actorIdx) {
_currentlyProcessedActorIdx = actorIdx;
_engine->_actor->_processActorPtr = actor;
- if (actor->_entity == -1) {
+ if (actor->_body == -1) {
return;
}
@@ -562,7 +562,7 @@ void Animations::processActorAnimations(int32 actorIdx) {
const AnimData &animData = _engine->_resources->_animData[actor->_previousAnimIdx];
bool keyFramePassed = false;
- if (_engine->_resources->_bodyData[actor->_entity].isAnimated()) {
+ if (_engine->_resources->_bodyData[actor->_body].isAnimated()) {
keyFramePassed = verifyAnimAtKeyframe(actor->_animPosition, animData, &actor->_animTimerData);
}
diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index ef83195d84f..fc86f462aa2 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -244,7 +244,7 @@ int32 Collision::checkCollisionWithActors(int32 actorIdx) {
ActorStruct *actorTest = _engine->_scene->getActor(a);
// avoid current processed actor
- if (a != actorIdx && actorTest->_entity != -1 && !actor->_staticFlags.bIsHidden && actorTest->_carryBy != actorIdx) {
+ if (a != actorIdx && actorTest->_body != -1 && !actor->_staticFlags.bIsHidden && actorTest->_carryBy != actorIdx) {
const IVec3 &minsTest = actorTest->pos() + actorTest->_boundingBox.mins;
const IVec3 &maxsTest = actorTest->pos() + actorTest->_boundingBox.maxs;
@@ -279,7 +279,7 @@ int32 Collision::checkCollisionWithActors(int32 actorIdx) {
const ActorStruct *actorTest = _engine->_scene->getActor(a);
// avoid current processed actor
- if (a != actorIdx && actorTest->_entity != -1 && !actorTest->_staticFlags.bIsHidden && actorTest->_carryBy != actorIdx) {
+ if (a != actorIdx && actorTest->_body != -1 && !actorTest->_staticFlags.bIsHidden && actorTest->_carryBy != actorIdx) {
const IVec3 minsTest = actorTest->pos() + actorTest->_boundingBox.mins;
const IVec3 maxsTest = actorTest->pos() + 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) {
@@ -400,7 +400,7 @@ int32 Collision::checkExtraCollisionWithActors(ExtraListStruct *extra, int32 act
for (int32 a = 0; a < _engine->_scene->_sceneNumActors; a++) {
const ActorStruct *actorTest = _engine->_scene->getActor(a);
- if (a != actorIdx && actorTest->_entity != -1) {
+ if (a != actorIdx && actorTest->_body != -1) {
const IVec3 minsTest = actorTest->pos() + actorTest->_boundingBox.mins;
const IVec3 maxsTest = actorTest->pos() + actorTest->_boundingBox.maxs;
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 183fbdc8c15..1aa230e5112 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -320,7 +320,7 @@ void GameState::processFoundItem(InventoryItems item) {
itemCamera.y = _engine->_grid->_newCamera.y * BRICK_HEIGHT;
itemCamera.z = _engine->_grid->_newCamera.z * BRICK_SIZE;
- BodyData &bodyData = _engine->_resources->_bodyData[_engine->_scene->_sceneHero->_entity];
+ BodyData &bodyData = _engine->_resources->_bodyData[_engine->_scene->_sceneHero->_body];
const IVec3 bodyPos = _engine->_scene->_sceneHero->_pos - itemCamera;
Common::Rect modelRect;
_engine->_renderer->renderIsoModel(bodyPos, ANGLE_0, ANGLE_45, ANGLE_0, bodyData, modelRect);
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 1635869aa87..7e57191c8df 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -429,7 +429,7 @@ void Movements::processSameXZAction(int actorIdx) {
void Movements::processActorMovements(int32 actorIdx) {
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
- if (actor->_entity == -1) {
+ if (actor->_body == -1) {
return;
}
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 3a0b04fdb42..4aa655b93be 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -901,7 +901,7 @@ static int32 lKILL_OBJ(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_actor->processActorCarrier(otherActorIdx);
ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
otherActor->_dynamicFlags.bIsDead = 1;
- otherActor->_entity = -1;
+ otherActor->_body = -1;
otherActor->_zone = -1;
otherActor->setLife(0);
@@ -916,7 +916,7 @@ static int32 lSUICIDE(TwinEEngine *engine, LifeScriptContext &ctx) {
debugC(3, kDebugLevels::kDebugScripts, "LIFE::SUICIDE()");
engine->_actor->processActorCarrier(ctx.actorIdx);
ctx.actor->_dynamicFlags.bIsDead = 1;
- ctx.actor->_entity = -1;
+ ctx.actor->_body = -1;
ctx.actor->_zone = -1;
ctx.actor->setLife(0);
@@ -1436,7 +1436,7 @@ static int32 lINIT_PINGOUIN(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->_scene->_mecaPenguinIdx = penguinActor;
ActorStruct *penguin = engine->_scene->getActor(penguinActor);
penguin->_dynamicFlags.bIsDead = 1;
- penguin->_entity = -1;
+ penguin->_body = -1;
penguin->_zone = -1;
return 0;
}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index c0c74574f74..cadd3be1b6b 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -791,7 +791,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
}
} else {
// Process give up menu - Press ESC
- if (_input->toggleAbortAction() && _scene->_sceneHero->_life > 0 && _scene->_sceneHero->_entity != -1 && !_scene->_sceneHero->_staticFlags.bIsHidden) {
+ if (_input->toggleAbortAction() && _scene->_sceneHero->_life > 0 && _scene->_sceneHero->_body != -1 && !_scene->_sceneHero->_staticFlags.bIsHidden) {
ScopedEngineFreeze scopedFreeze(this);
exitSceneryView();
const int giveUp = _menu->giveupMenu();
@@ -812,7 +812,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
// inventory menu
_loopInventoryItem = -1;
- if (_input->isActionActive(TwinEActionType::InventoryMenu) && _scene->_sceneHero->_entity != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
+ if (_input->isActionActive(TwinEActionType::InventoryMenu) && _scene->_sceneHero->_body != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
processInventoryAction();
}
@@ -832,7 +832,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
_input->isActionActive(TwinEActionType::QuickBehaviourAthletic, false) ||
_input->isActionActive(TwinEActionType::QuickBehaviourAggressive, false) ||
_input->isActionActive(TwinEActionType::QuickBehaviourDiscreet, false)) &&
- _scene->_sceneHero->_entity != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
+ _scene->_sceneHero->_body != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
if (_input->isActionActive(TwinEActionType::QuickBehaviourNormal, false)) {
_actor->_heroBehaviour = HeroBehaviourType::kNormal;
} else if (_input->isActionActive(TwinEActionType::QuickBehaviourAthletic, false)) {
@@ -1037,7 +1037,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
} else {
_actor->processActorCarrier(a);
actor->_dynamicFlags.bIsDead = 1;
- actor->_entity = -1;
+ actor->_body = -1;
actor->_zone = -1;
}
}
Commit: 7caf4425affccf721c9b45e1139513af0652b12d
https://github.com/scummvm/scummvm/commit/7caf4425affccf721c9b45e1139513af0652b12d
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-11T12:44:26+02:00
Commit Message:
TWINE: renamed variable
Changed paths:
engines/twine/scene/actor.cpp
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 50bf35f476d..13b25351eae 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -171,7 +171,7 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
debug(1, "Load body %i for actor %i", (int)bodyIdx, actorIdx);
- if (IS_HERO(actorIdx) && _heroBehaviour == HeroBehaviourType::kProtoPack && localActor->_body != BodyType::btTunic && localActor->_body != BodyType::btNormal) {
+ if (IS_HERO(actorIdx) && _heroBehaviour == HeroBehaviourType::kProtoPack && localActor->_genBody != BodyType::btTunic && localActor->_genBody != BodyType::btNormal) {
setBehaviour(HeroBehaviourType::kNormal);
}
@@ -199,8 +199,8 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
localActor->_boundingBox = bd.bbox;
int32 size = 0;
- const int32 distX = localActor->_boundingBox.maxs.x - localActor->_boundingBox.mins.x;
- const int32 distZ = localActor->_boundingBox.maxs.z - localActor->_boundingBox.mins.z;
+ const int32 distX = bd.bbox.maxs.x - bd.bbox.mins.x;
+ const int32 distZ = bd.bbox.maxs.z - bd.bbox.mins.z;
if (localActor->_staticFlags.bUseMiniZv) {
// take smaller for bound
if (distX < distZ)
More information about the Scummvm-git-logs
mailing list