[Scummvm-git-logs] scummvm master -> 7edae880f8d2dc599f48cdcd080cddc720af5ff9
mgerhardy
noreply at scummvm.org
Sun Jun 12 20:22:40 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4e73580f53 TWINE: renamed member to match original sources
a2e48126d1 TWINE: getBrickShape is now in sync with original sources
7edae880f8 TWINE: fixed end game items for normal new game in classic edition
Commit: 4e73580f53a0a29c06eb6f63d0c2958665171bf3
https://github.com/scummvm/scummvm/commit/4e73580f53a0a29c06eb6f63d0c2958665171bf3
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-12T22:22:34+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/animations.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 9bc2a7ae684..66f68a106c5 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -125,7 +125,7 @@ void Actor::setBehaviour(HeroBehaviourType behaviour) {
initModelActor(bodyIdx, OWN_ACTOR_SCENE_INDEX);
- sceneHero->_anim = AnimationTypes::kAnimNone;
+ sceneHero->_genAnim = AnimationTypes::kAnimNone;
sceneHero->_animType = AnimType::kAnimationTypeLoop;
_engine->_animations->initAnim(AnimationTypes::kStanding, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, OWN_ACTOR_SCENE_INDEX);
@@ -246,7 +246,7 @@ void Actor::initActor(int16 actorIdx) {
actor->_animType = AnimType::kAnimationTypeLoop;
if (actor->_body != -1) {
- _engine->_animations->initAnim(actor->_anim, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
+ _engine->_animations->initAnim(actor->_genAnim, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
}
_engine->_movements->setActorAngleSafe(actor->_angle, actor->_angle, ANGLE_0, &actor->_move);
@@ -285,7 +285,7 @@ void Actor::hitObj(int32 actorIdx, int32 actorIdxAttacked, int32 strengthOfHit,
actor->_hitBy = actorIdx;
if (actor->_armor <= strengthOfHit) {
- if (actor->_anim == AnimationTypes::kBigHit || actor->_anim == AnimationTypes::kHit2) {
+ if (actor->_genAnim == AnimationTypes::kBigHit || actor->_genAnim == AnimationTypes::kHit2) {
const int32 tmpAnimPos = actor->_animPosition;
if (actor->_animExtra != AnimationTypes::kStanding) {
_engine->_animations->processAnimActions(actorIdxAttacked);
@@ -401,15 +401,15 @@ int32 ActorMoveStruct::getRealValue(int32 time) {
}
bool ActorStruct::isAttackAnimationActive() const {
- return _anim == AnimationTypes::kRightPunch || _anim == AnimationTypes::kLeftPunch || _anim == AnimationTypes::kKick;
+ return _genAnim == AnimationTypes::kRightPunch || _genAnim == AnimationTypes::kLeftPunch || _genAnim == AnimationTypes::kKick;
}
bool ActorStruct::isAttackWeaponAnimationActive() const {
- return _anim == AnimationTypes::kSabreAttack || _anim == AnimationTypes::kThrowBall || _anim == AnimationTypes::kSabreUnknown;
+ return _genAnim == AnimationTypes::kSabreAttack || _genAnim == AnimationTypes::kThrowBall || _genAnim == AnimationTypes::kSabreUnknown;
}
bool ActorStruct::isJumpAnimationActive() const {
- return _anim == AnimationTypes::kJump;
+ return _genAnim == AnimationTypes::kJump;
}
} // namespace TwinE
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 0ee77cdea7b..98a27542449 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -141,7 +141,7 @@ struct BonusParameter {
class ActorStruct {
private:
ShapeType _brickShape = ShapeType::kNone; // field_3
- bool _brickCausesDamage = false;
+ bool _brickCausesDamage = false; // TODO: this is a bitmask with multiple values in the original source
EntityData _entityData;
public:
@@ -169,7 +169,7 @@ public:
int32 _body = -1; // costumeIndex - index into bodyTable
BodyType _genBody = BodyType::btNormal;
- AnimationTypes _anim = AnimationTypes::kAnimNone;
+ AnimationTypes _genAnim = AnimationTypes::kAnimNone;
AnimationTypes _animExtra = AnimationTypes::kStanding;
AnimationTypes _animExtraPtr = AnimationTypes::kAnimNone;
int32 _sprite = 0;
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 25a73830436..5bb651b00c4 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -397,12 +397,12 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType animType, AnimationTy
return false;
}
- if (newAnim == actor->_anim && actor->_previousAnimIdx != -1) {
+ if (newAnim == actor->_genAnim && actor->_previousAnimIdx != -1) {
return true;
}
if (animExtra == AnimationTypes::kAnimInvalid && actor->_animType != AnimType::kAnimationAllThen) {
- animExtra = actor->_anim;
+ animExtra = actor->_genAnim;
}
int32 animIndex = getBodyAnimIndex(newAnim, actorIdx);
@@ -419,7 +419,7 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType animType, AnimationTy
if (animType == AnimType::kAnimationInsert) {
animType = AnimType::kAnimationAllThen;
- animExtra = actor->_anim;
+ animExtra = actor->_genAnim;
if (animExtra == AnimationTypes::kThrowBall || animExtra == AnimationTypes::kFall || animExtra == AnimationTypes::kLanding || animExtra == AnimationTypes::kLandingHit) {
animExtra = AnimationTypes::kStanding;
@@ -439,7 +439,7 @@ bool Animations::initAnim(AnimationTypes newAnim, AnimType animType, AnimationTy
}
actor->_previousAnimIdx = animIndex;
- actor->_anim = newAnim;
+ actor->_genAnim = newAnim;
actor->_animExtra = animExtra;
actor->_animExtraPtr = _currentActorAnimExtraPtr;
actor->_animType = animType;
@@ -601,12 +601,12 @@ void Animations::doAnim(int32 actorIdx) {
if (actor->_animType == AnimType::kAnimationTypeLoop) {
actor->_animPosition = animData.getLoopFrame();
} else {
- actor->_anim = actor->_animExtra;
- actor->_previousAnimIdx = getBodyAnimIndex(actor->_anim, actorIdx);
+ actor->_genAnim = actor->_animExtra;
+ actor->_previousAnimIdx = getBodyAnimIndex(actor->_genAnim, actorIdx);
if (actor->_previousAnimIdx == -1) {
actor->_previousAnimIdx = getBodyAnimIndex(AnimationTypes::kStanding, actorIdx);
- actor->_anim = AnimationTypes::kStanding;
+ actor->_genAnim = AnimationTypes::kStanding;
}
actor->_animExtraPtr = _currentActorAnimExtraPtr;
@@ -687,7 +687,7 @@ void Animations::doAnim(int32 actorIdx) {
processActor = processActorSave;
// process wall hit while running
- if (_engine->_collision->_causeActorDamage && !actor->_dynamicFlags.bIsFalling && IS_HERO(_currentlyProcessedActorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_anim == AnimationTypes::kForward) {
+ if (_engine->_collision->_causeActorDamage && !actor->_dynamicFlags.bIsFalling && IS_HERO(_currentlyProcessedActorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_genAnim == AnimationTypes::kForward) {
IVec3 destPos = _engine->_movements->rotateActor(actor->_boundingBox.mins.x, actor->_boundingBox.mins.z, actor->_angle + ANGLE_360 + ANGLE_135);
destPos.x += processActor.x;
@@ -716,7 +716,7 @@ void Animations::doAnim(int32 actorIdx) {
_engine->_collision->receptionObj();
processActor.y = (_engine->_collision->_collision.y * SIZE_BRICK_Y) + SIZE_BRICK_Y;
} else {
- if (IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_anim == AnimationTypes::kForward && _engine->_cfgfile.WallCollision) { // avoid wall hit damage
+ if (IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour == HeroBehaviourType::kAthletic && actor->_genAnim == AnimationTypes::kForward && _engine->_cfgfile.WallCollision) { // avoid wall hit damage
_engine->_extra->initSpecial(actor->_pos.x, actor->_pos.y + 1000, actor->_pos.z, ExtraSpecialType::kHitStars);
initAnim(AnimationTypes::kBigHit, AnimType::kAnimationAllThen, AnimationTypes::kStanding, _currentlyProcessedActorIdx);
_engine->_movements->_lastJoyFlag = true;
@@ -767,7 +767,7 @@ void Animations::doAnim(int32 actorIdx) {
y = (y + SIZE_BRICK_Y) & ~(SIZE_BRICK_Y - 1);
int32 fallHeight = processActor.y - y;
- if (fallHeight <= (2 * SIZE_BRICK_Y) && actor->_anim == AnimationTypes::kForward) {
+ if (fallHeight <= (2 * SIZE_BRICK_Y) && actor->_genAnim == AnimationTypes::kForward) {
actor->_dynamicFlags.bWasWalkingBeforeFalling = 1;
} else {
initAnim(AnimationTypes::kFall, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 547703642df..241ac87d957 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -225,7 +225,7 @@ bool Movements::processBehaviourExecution(int actorIdx) {
_lastJoyFlag = true;
actor->_angle = actor->_move.getRealAngle(_engine->_lbaTime);
// TODO: previousLoopActionKey must be handled properly
- if (!_previousLoopActionKey || actor->_anim == AnimationTypes::kStanding) {
+ if (!_previousLoopActionKey || actor->_genAnim == AnimationTypes::kStanding) {
const int32 aggresiveMode = _engine->getRandomNumber(3);
switch (aggresiveMode) {
@@ -319,7 +319,7 @@ void Movements::processManualMovementExecution(int actorIdx) {
}
if (_engine->_input->isActionActive(TwinEActionType::TurnLeft)) {
- if (actor->_anim == AnimationTypes::kStanding) {
+ if (actor->_genAnim == AnimationTypes::kStanding) {
_engine->_animations->initAnim(AnimationTypes::kTurnLeft, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
} else {
if (!actor->_dynamicFlags.bIsRotationByAnim) {
@@ -328,7 +328,7 @@ void Movements::processManualMovementExecution(int actorIdx) {
}
_lastJoyFlag = true;
} else if (_engine->_input->isActionActive(TwinEActionType::TurnRight)) {
- if (actor->_anim == AnimationTypes::kStanding) {
+ if (actor->_genAnim == AnimationTypes::kStanding) {
_engine->_animations->initAnim(AnimationTypes::kTurnRight, AnimType::kAnimationTypeLoop, AnimationTypes::kAnimInvalid, actorIdx);
} else {
if (!actor->_dynamicFlags.bIsRotationByAnim) {
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index f1430e5ca9b..c97bb7a8ecc 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -196,7 +196,7 @@ bool Scene::loadSceneLBA2() {
act->loadModel((int16)stream.readUint16LE(), false);
act->_genBody = (BodyType)stream.readSint16LE();
- act->_anim = (AnimationTypes)stream.readByte();
+ act->_genAnim = (AnimationTypes)stream.readByte();
act->_sprite = (int16)stream.readUint16LE();
act->_pos.x = (int16)stream.readUint16LE();
act->_pos.y = (int16)stream.readUint16LE();
@@ -328,7 +328,7 @@ bool Scene::loadSceneLBA1() {
act->loadModel(stream.readUint16LE(), true);
act->_genBody = (BodyType)stream.readByte();
- act->_anim = (AnimationTypes)stream.readByte();
+ act->_genAnim = (AnimationTypes)stream.readByte();
act->_sprite = (int16)stream.readUint16LE();
act->_pos.x = (int16)stream.readUint16LE();
act->_pos.y = (int16)stream.readUint16LE();
@@ -772,7 +772,7 @@ void Scene::checkZoneSce(int32 actorIdx) {
}
break;
case ZoneType::kLadder:
- if (IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour != HeroBehaviourType::kProtoPack && (actor->_anim == AnimationTypes::kForward || actor->_anim == AnimationTypes::kTopLadder || actor->_anim == AnimationTypes::kClimbLadder)) {
+ if (IS_HERO(actorIdx) && _engine->_actor->_heroBehaviour != HeroBehaviourType::kProtoPack && (actor->_genAnim == AnimationTypes::kForward || actor->_genAnim == AnimationTypes::kTopLadder || actor->_genAnim == AnimationTypes::kClimbLadder)) {
IVec3 destPos = _engine->_movements->rotateActor(actor->_boundingBox.mins.x, actor->_boundingBox.mins.z, actor->_angle + ANGLE_360 + ANGLE_135);
destPos.x += actor->_processActor.x;
destPos.z += actor->_processActor.z;
diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index ef26f6eec37..5670f63e775 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -199,12 +199,12 @@ static int32 processLifeConditions(TwinEEngine *engine, LifeScriptContext &ctx)
}
case kcANIM:
debugCN(3, kDebugLevels::kDebugScripts, "anim(");
- engine->_scene->_currentScriptValue = (int16)ctx.actor->_anim;
+ engine->_scene->_currentScriptValue = (int16)ctx.actor->_genAnim;
break;
case kcANIM_OBJ: {
int32 actorIdx = ctx.stream.readByte();
debugCN(3, kDebugLevels::kDebugScripts, "anim_obj(%i, ", actorIdx);
- engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_anim;
+ engine->_scene->_currentScriptValue = (int16)engine->_scene->getActor(actorIdx)->_genAnim;
break;
}
case kcL_TRACK:
@@ -1759,7 +1759,7 @@ static int32 lANIM_SET(TwinEEngine *engine, LifeScriptContext &ctx) {
const AnimationTypes animIdx = (AnimationTypes)ctx.stream.readByte();
debugC(3, kDebugLevels::kDebugScripts, "LIFE::ANIM_SET(%i)", (int)animIdx);
- ctx.actor->_anim = AnimationTypes::kAnimNone;
+ ctx.actor->_genAnim = AnimationTypes::kAnimNone;
ctx.actor->_previousAnimIdx = -1;
engine->_animations->initAnim(animIdx, AnimType::kAnimationTypeLoop, AnimationTypes::kStanding, ctx.actorIdx);
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index a7fa8c993d6..40fe1178393 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -972,7 +972,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
if (brickSound == WATER_BRICK) {
if (IS_HERO(a)) {
// we are dying if we aren't using the protopack to fly over water
- if (_actor->_heroBehaviour != HeroBehaviourType::kProtoPack || actor->_anim != AnimationTypes::kForward) {
+ if (_actor->_heroBehaviour != HeroBehaviourType::kProtoPack || actor->_genAnim != AnimationTypes::kForward) {
if (!_actor->_cropBottomScreen) {
_animations->initAnim(AnimationTypes::kDrawn, AnimType::kAnimationSet, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
}
Commit: a2e48126d1b9d26b60a1806397a19373c23873e6
https://github.com/scummvm/scummvm/commit/a2e48126d1b9d26b60a1806397a19373c23873e6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-12T22:22:34+02:00
Commit Message:
TWINE: getBrickShape is now in sync with original sources
see d3e81901e6ab980e1a8b654d46e159c7b2bbb4cd
Changed paths:
engines/twine/scene/grid.cpp
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index f4adaa87b67..b9610d8a2bc 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -706,15 +706,19 @@ BlockEntry Grid::getBlockEntry(int32 x, int32 y, int32 z) const {
ShapeType Grid::worldColBrick(int32 x, int32 y, int32 z) {
const IVec3 &collision = updateCollisionCoordinates(x, y, z);
+ if (collision.y <= -1) {
+ return ShapeType::kSolid;
+ }
+
if (collision.x < 0 || collision.x >= SIZE_CUBE_X) {
return ShapeType::kNone;
}
- if (collision.y <= -1) {
- return ShapeType::kSolid;
+ if (collision.y < 0 || collision.y >= SIZE_CUBE_Y) {
+ return ShapeType::kNone;
}
- if (collision.y < 0 || collision.y >= SIZE_CUBE_Y || collision.z < 0 || collision.z >= SIZE_CUBE_Z) {
+ if (collision.z < 0 || collision.z >= SIZE_CUBE_Z) {
return ShapeType::kNone;
}
Commit: 7edae880f8d2dc599f48cdcd080cddc720af5ff9
https://github.com/scummvm/scummvm/commit/7edae880f8d2dc599f48cdcd080cddc720af5ff9
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-12T22:22:34+02:00
Commit Message:
TWINE: fixed end game items for normal new game in classic edition
Changed paths:
engines/twine/menu/menu.cpp
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 0b9f83eaeff..08a431aff31 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -766,12 +766,17 @@ int32 Menu::newGameClassicMenu() {
return 0;
}
case (int32)TextId::kNewGamePlus:
- case (int32)TextId::kNewGame: {
_engine->_gameState->_endGameItems = true;
if (_engine->_menuOptions->newGameMenu()) {
return 1;
}
break;
+ case (int32)TextId::kNewGame: {
+ _engine->_gameState->_endGameItems = false;
+ if (_engine->_menuOptions->newGameMenu()) {
+ return 1;
+ }
+ break;
}
case kQuitEngine:
return kQuitEngine;
More information about the Scummvm-git-logs
mailing list