[Scummvm-git-logs] scummvm master -> a713e02474b78d8c78198f36b99aec218c7ad81f

mgerhardy martin.gerhardy at gmail.com
Fri Mar 12 20:04:50 UTC 2021


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:
d1805f2828 TWINE: reduced scope
72ddd3ec46 TWINE: added operators to DrawListStruct for easier use of algorithms from common/
67a9213531 TWINE: reversed missing parts of life script
4fca870a30 TWINE: use addLife method
a713e02474 TWINE: die if fall height is too much


Commit: d1805f282875e9ddd25d18936381dcecfd2cf469
    https://github.com/scummvm/scummvm/commit/d1805f282875e9ddd25d18936381dcecfd2cf469
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-12T21:02:23+01:00

Commit Message:
TWINE: reduced scope

Changed paths:
    engines/twine/holomap.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index 510bd2aace..e68e54f1a4 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -430,10 +430,6 @@ void Holomap::renderLocations(int xRot, int yRot, int zRot, bool lower) {
 	int n = 0;
 	for (int locationIdx = 0; locationIdx < NUM_LOCATIONS; ++locationIdx) {
 		if ((_engine->_gameState->holomapFlags[locationIdx] & 0x80) || locationIdx == _engine->_scene->currentSceneIdx) {
-			uint8 flags = _engine->_gameState->holomapFlags[locationIdx] & 1;
-			if (locationIdx == _engine->_scene->currentSceneIdx) {
-				flags |= 2u; // model type
-			}
 			const Location &loc = _locations[locationIdx];
 			_engine->_renderer->setBaseRotation(loc.x, loc.y, 0);
 			_engine->_renderer->getBaseRotationPosition(0, 0, loc.z + 1000);
@@ -461,6 +457,10 @@ void Holomap::renderLocations(int xRot, int yRot, int zRot, bool lower) {
 					continue;
 				}
 			}
+			uint8 flags = _engine->_gameState->holomapFlags[locationIdx] & 1;
+			if (locationIdx == _engine->_scene->currentSceneIdx) {
+				flags |= 2u; // model type
+			}
 			DrawListStruct &drawList = _engine->_redraw->drawList[n];
 			drawList.posValue = zpos1_copy2;
 			drawList.actorIdx = locationIdx;


Commit: 72ddd3ec46dae9b9fda2c8ccd933d1eb35358da8
    https://github.com/scummvm/scummvm/commit/72ddd3ec46dae9b9fda2c8ccd933d1eb35358da8
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-12T21:02:23+01:00

Commit Message:
TWINE: added operators to DrawListStruct for easier use of algorithms from common/

Changed paths:
    engines/twine/renderer/redraw.h


diff --git a/engines/twine/renderer/redraw.h b/engines/twine/renderer/redraw.h
index 135828c16c..3187e95b44 100644
--- a/engines/twine/renderer/redraw.h
+++ b/engines/twine/renderer/redraw.h
@@ -65,6 +65,14 @@ struct DrawListStruct {
 	uint16 field_C = 0;
 	uint16 field_E = 0;
 	uint16 field_10 = 0;
+
+	inline bool operator==(const DrawListStruct& other) const {
+		return posValue == other.posValue;
+	}
+
+	inline bool operator<(const DrawListStruct& other) const {
+		return posValue < other.posValue;
+	}
 };
 
 class TwinEEngine;


Commit: 67a9213531d24d0cab234b524af851f23e931c93
    https://github.com/scummvm/scummvm/commit/67a9213531d24d0cab234b524af851f23e931c93
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-12T21:02:23+01:00

Commit Message:
TWINE: reversed missing parts of life script

Changed paths:
    engines/twine/script/script_life_v1.cpp


diff --git a/engines/twine/script/script_life_v1.cpp b/engines/twine/script/script_life_v1.cpp
index 5b2f1321ee..6dcc1f37fd 100644
--- a/engines/twine/script/script_life_v1.cpp
+++ b/engines/twine/script/script_life_v1.cpp
@@ -317,8 +317,11 @@ static int32 processLifeConditions(TwinEEngine *engine, LifeScriptContext &ctx)
 		}
 		break;
 	}
-	case 23: // unused
+	case 23:
+		engine->_scene->currentScriptValue = engine->_gameState->magicLevelIdx;
+		break;
 	case 24:
+		engine->_scene->currentScriptValue = engine->_gameState->inventoryMagicPoints;
 		break;
 	case kcUSE_INVENTORY: {
 		int32 item = ctx.stream.readByte();


Commit: 4fca870a307ce1e6025f2e18179a12683eb9c83f
    https://github.com/scummvm/scummvm/commit/4fca870a307ce1e6025f2e18179a12683eb9c83f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-12T21:02:23+01:00

Commit Message:
TWINE: use addLife method

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


diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index 8d1cab5471..96aaa2bd1a 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -751,7 +751,7 @@ void Animations::processActorAnimations(int32 actorIdx) { // DoAnim
 						_engine->_movements->heroMoved = true;
 					}
 
-					actor->life--;
+					actor->addLife(-1);
 				}
 			}
 		}
@@ -769,7 +769,7 @@ void Animations::processActorAnimations(int32 actorIdx) { // DoAnim
 						_engine->_extra->addExtraSpecial(actor->pos.x, actor->pos.y + 1000, actor->pos.z, ExtraSpecialType::kHitStars);
 						initAnim(AnimationTypes::kBigHit, kAnimationType_2, AnimationTypes::kStanding, currentlyProcessedActorIdx);
 						_engine->_movements->heroMoved = true;
-						actor->life--;
+						actor->addLife(-1);
 					}
 
 					// no Z coordinate issue


Commit: a713e02474b78d8c78198f36b99aec218c7ad81f
    https://github.com/scummvm/scummvm/commit/a713e02474b78d8c78198f36b99aec218c7ad81f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-03-12T21:02:23+01:00

Commit Message:
TWINE: die if fall height is too much

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


diff --git a/engines/twine/scene/collision.cpp b/engines/twine/scene/collision.cpp
index baac84b29e..6f56b8d465 100644
--- a/engines/twine/scene/collision.cpp
+++ b/engines/twine/scene/collision.cpp
@@ -446,7 +446,11 @@ void Collision::stopFalling() { // ReceptionObj()
 
 		if (fall >= BRICK_HEIGHT * 8) {
 			_engine->_extra->addExtraSpecial(_engine->_actor->processActorPtr->pos.x, _engine->_actor->processActorPtr->pos.y + 1000, _engine->_actor->processActorPtr->pos.z, ExtraSpecialType::kHitStars);
-			_engine->_actor->processActorPtr->addLife(-1);
+			if (fall >= BRICK_HEIGHT * 16) {
+				_engine->_actor->processActorPtr->setLife(0);
+			} else {
+				_engine->_actor->processActorPtr->addLife(-1);
+			}
 			_engine->_animations->initAnim(AnimationTypes::kLandingHit, kAnimationType_2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);
 		} else if (fall > 10) {
 			_engine->_animations->initAnim(AnimationTypes::kLanding, kAnimationType_2, AnimationTypes::kStanding, _engine->_animations->currentlyProcessedActorIdx);




More information about the Scummvm-git-logs mailing list