[Scummvm-git-logs] scummvm master -> 05f1b2e6cfa817d2d3ad2041dce24dc6d175d505

mgerhardy noreply at scummvm.org
Thu Jun 2 06:17:10 UTC 2022


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:
b9a38cdb4d TWINE: fixed wrong checks in initModelActor regarding the body type
05f1b2e6cf TWINE: improved readability


Commit: b9a38cdb4dba24f933ad89d5535540d1c4d31901
    https://github.com/scummvm/scummvm/commit/b9a38cdb4dba24f933ad89d5535540d1c4d31901
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-01T23:14:15+02:00

Commit Message:
TWINE: fixed wrong checks in initModelActor regarding the body type

Changed paths:
    engines/twine/scene/actor.cpp


diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 5ed220e2630..0caf7441e03 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -170,7 +170,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->_armor != 0 && localActor->_armor != 1) {
+	if (IS_HERO(actorIdx) && _heroBehaviour == HeroBehaviourType::kProtoPack && localActor->_body != BodyType::btTunic && localActor->_body != BodyType::btNormal) {
 		setBehaviour(HeroBehaviourType::kNormal);
 	}
 


Commit: 05f1b2e6cfa817d2d3ad2041dce24dc6d175d505
    https://github.com/scummvm/scummvm/commit/05f1b2e6cfa817d2d3ad2041dce24dc6d175d505
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2022-06-01T23:20:35+02:00

Commit Message:
TWINE: improved readability

Changed paths:
    engines/twine/scene/actor.cpp


diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 0caf7441e03..af058ec5a2c 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -197,26 +197,24 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
 		const BodyData &bd = _engine->_resources->_bodyData[localActor->_entity];
 		localActor->_boudingBox = bd.bbox;
 
-		int32 result = 0;
+		int32 size = 0;
 		const int32 distX = localActor->_boudingBox.maxs.x - localActor->_boudingBox.mins.x;
 		const int32 distZ = localActor->_boudingBox.maxs.z - localActor->_boudingBox.mins.z;
 		if (localActor->_staticFlags.bUseMiniZv) {
 			// take smaller for bound
-			result = MIN(distX, distZ);
-
-			result = ABS(result);
-			result >>= 1;
+			if (distX < distZ)
+				size = distX / 2;
+			else
+				size = distZ / 2;
 		} else {
 			// take average for bound
-			result = distZ + distX;
-			result = ABS(result);
-			result >>= 2;
+			size = (distZ + distX) / 4;
 		}
 
-		localActor->_boudingBox.mins.x = -result;
-		localActor->_boudingBox.maxs.x = result;
-		localActor->_boudingBox.mins.z = -result;
-		localActor->_boudingBox.maxs.z = result;
+		localActor->_boudingBox.mins.x = -size;
+		localActor->_boudingBox.maxs.x = size;
+		localActor->_boudingBox.mins.z = -size;
+		localActor->_boudingBox.maxs.z = size;
 	}
 }
 




More information about the Scummvm-git-logs mailing list