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

mgerhardy noreply at scummvm.org
Mon Oct 14 19:15:41 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:
bdee243b95 TWINE: renamed method to match original sources
fec46ac970 TWINE: renamed member to match original sources


Commit: bdee243b954c98058469ae2a787f47a2f94e3b80
    https://github.com/scummvm/scummvm/commit/bdee243b954c98058469ae2a787f47a2f94e3b80
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-14T21:07:44+02:00

Commit Message:
TWINE: renamed method to match original sources

Changed paths:
    engines/twine/twine.cpp
    engines/twine/twine.h


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 21cdec4d773..e20f2421de6 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -325,7 +325,7 @@ Common::Error TwinEEngine::run() {
 	_renderer->init(w, h);
 	_grid->init(w, h);
 	initAll();
-	playIntro();
+	introduction();
 	_sound->stopSamples();
 	saveFrontBuffer();
 
@@ -593,7 +593,7 @@ void TwinEEngine::clearScreenMinMax(Common::Rect &rect) {
 	rect.bottom = -0x7D00;
 }
 
-void TwinEEngine::playIntro() {
+void TwinEEngine::introduction() {
 	_input->enableKeyMap(cutsceneKeyMapId);
 	// Display company logo
 	bool abort = false;
diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index 5de3c3ed387..2a7064a9908 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -226,7 +226,7 @@ private:
 	void initConfigurations();
 	/** Initialize all needed stuffs at first time running engine */
 	void initAll();
-	void playIntro();
+	void introduction();
 	void processActorSamplePosition(int32 actorIdx);
 	/** Allocate video memory, both front and back buffers */
 	void allocVideoMemory(int32 w, int32 h);


Commit: fec46ac970f02eaf50eea03d3de81c16fc00afd1
    https://github.com/scummvm/scummvm/commit/fec46ac970f02eaf50eea03d3de81c16fc00afd1
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-14T21:11:53+02:00

Commit Message:
TWINE: renamed member to match original sources

Changed paths:
    engines/twine/debugger/debugtools.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.cpp
    engines/twine/script/script_move.cpp
    engines/twine/twine.cpp


diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index 427e095487e..aedb3402a42 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -493,7 +493,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
 
 		ImGuiEx::InputIVec3("Pos", actor->_posObj);
 		ImGuiEx::InputAngle("Rotation", &actor->_beta);
-		ImGuiEx::InputInt("Speed", &actor->_speed);
+		ImGuiEx::InputInt("Rotation speed", &actor->_srot);
 		ImGuiEx::InputInt("Life", &actor->_lifePoint);
 		ImGuiEx::InputInt("Armor", &actor->_armor);
 		ImGuiEx::InputBoundingBox(actorIdx, "Bounding box", actor->_boundingBox);
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index 04d0e95b9c3..2ed1e66088e 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -192,8 +192,8 @@ public:
 	int32 _strengthOfHit = 0;
 	int32 _hitBy = -1;
 	BonusParameter _bonusParameter;
-	int32 _beta = 0; // facing angle of actor. Minumum is 0 (SW). Going counter clock wise (BETA in original sources)
-	int32 _speed = 40; // SRot - speed of movement
+	int32 _beta = 0; // facing angle of actor. Minumum is 0 (SW). Going counter clock wise
+	int32 _srot = 40; // speed of rotation
 	ControlMode _controlMode = ControlMode::kNoMove; // Move
 	int32 _delayInMillis = 0;
 	int32 _cropLeft = 0;      // Info
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index e3206bafd07..e0253f6b7a0 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -475,7 +475,7 @@ void Animations::doAnim(int32 actorIdx) {
 		processActor = actor->posObj();
 
 		if (!actor->_workFlags.bIsFalling) {
-			if (actor->_speed) {
+			if (actor->_srot) {
 				int32 xAxisRotation = actor->realAngle.getRealValueFromTime(_engine->timerRef);
 				if (!xAxisRotation) {
 					if (actor->realAngle.endValue > 0) {
@@ -494,7 +494,7 @@ void Animations::doAnim(int32 actorIdx) {
 				processActor.x = actor->_posObj.x + destPos.x;
 				processActor.z = actor->_posObj.z + destPos.y;
 
-				_engine->_movements->initRealValue(LBAAngles::ANGLE_0, actor->_speed, LBAAngles::ANGLE_17, &actor->realAngle);
+				_engine->_movements->initRealValue(LBAAngles::ANGLE_0, actor->_srot, LBAAngles::ANGLE_17, &actor->realAngle);
 
 				if (actor->_workFlags.bIsSpriteMoving) {
 					if (actor->_doorWidth) { // open door
@@ -510,7 +510,7 @@ void Animations::doAnim(int32 actorIdx) {
 							}
 
 							actor->_workFlags.bIsSpriteMoving = 0;
-							actor->_speed = 0;
+							actor->_srot = 0;
 						}
 					} else { // close door
 						bool updatePos = false;
@@ -537,7 +537,7 @@ void Animations::doAnim(int32 actorIdx) {
 							processActor = actor->_animStep;
 
 							actor->_workFlags.bIsSpriteMoving = 0;
-							actor->_speed = 0;
+							actor->_srot = 0;
 						}
 					}
 				}
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index f3826db8c70..6ed20af3cfc 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -394,7 +394,7 @@ void Movements::processManualRotationExecution(int actorIdx) {
 		tempAngle = LBAAngles::ANGLE_0;
 	}
 
-	initRealAngleConst(actor->_beta, actor->_beta + tempAngle, actor->_speed, &actor->realAngle);
+	initRealAngleConst(actor->_beta, actor->_beta + tempAngle, actor->_srot, &actor->realAngle);
 }
 
 void Movements::processManualAction(int actorIdx) {
@@ -422,7 +422,7 @@ void Movements::processFollowAction(int actorIdx) {
 	if (actor->_staticFlags.bSprite3D) {
 		actor->_beta = newAngle;
 	} else {
-		initRealAngleConst(actor->_beta, newAngle, actor->_speed, &actor->realAngle);
+		initRealAngleConst(actor->_beta, newAngle, actor->_srot, &actor->realAngle);
 	}
 }
 
@@ -434,7 +434,7 @@ void Movements::processRandomAction(int actorIdx) {
 
 	if (actor->brickCausesDamage()) {
 		const int32 angle = ClampAngle(actor->_beta + (_engine->getRandomNumber() & (LBAAngles::ANGLE_180 - 1)) - LBAAngles::ANGLE_90 + LBAAngles::ANGLE_180);
-		initRealAngleConst(actor->_beta, angle, actor->_speed, &actor->realAngle);
+		initRealAngleConst(actor->_beta, angle, actor->_srot, &actor->realAngle);
 		actor->_delayInMillis = _engine->timerRef + _engine->getRandomNumber(_engine->toSeconds(6)) + _engine->toSeconds(6);
 		_engine->_animations->initAnim(AnimationTypes::kStanding, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, actorIdx);
 	}
@@ -443,7 +443,7 @@ void Movements::processRandomAction(int actorIdx) {
 		_engine->_animations->initAnim(AnimationTypes::kForward, AnimType::kAnimationTypeRepeat, AnimationTypes::kAnimInvalid, actorIdx);
 		if (_engine->timerRef > actor->_delayInMillis) {
 			const int32 angle = ClampAngle(actor->_beta + (_engine->getRandomNumber() & (LBAAngles::ANGLE_180 - 1)) - LBAAngles::ANGLE_90);
-			initRealAngleConst(actor->_beta, angle, actor->_speed, &actor->realAngle);
+			initRealAngleConst(actor->_beta, angle, actor->_srot, &actor->realAngle);
 			actor->_delayInMillis = _engine->timerRef + _engine->getRandomNumber(_engine->toSeconds(6)) + _engine->toSeconds(6);
 		}
 	}
@@ -471,7 +471,7 @@ void Movements::manualRealAngle(ActorStruct *actor) {
 		tempAngle = -LBAAngles::ANGLE_90;
 	}
 
-	initRealAngleConst(actor->_beta, actor->_beta + tempAngle, actor->_speed, &actor->realAngle);
+	initRealAngleConst(actor->_beta, actor->_beta + tempAngle, actor->_srot, &actor->realAngle);
 }
 
 void Movements::doDir(int32 actorIdx) {
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index b8490ebcae4..9d039846f92 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -250,7 +250,7 @@ bool Scene::loadSceneLBA2() {
 		act->_strengthOfHit = stream.readByte();
 		setBonusParameterFlags(act, stream.readUint16LE());
 		act->_beta = (int16)stream.readUint16LE();
-		act->_speed = (int16)stream.readUint16LE(); // srot
+		act->_srot = (int16)stream.readUint16LE();
 		act->_controlMode = (ControlMode)stream.readByte(); // move
 		act->_cropLeft = stream.readSint16LE();
 		act->_delayInMillis = act->_cropLeft; // TODO: this might not be needed
@@ -385,7 +385,7 @@ bool Scene::loadSceneLBA1() {
 		setBonusParameterFlags(act, stream.readUint16LE());
 		act->_bonusParameter.givenNothing = 0;
 		act->_beta = (int16)stream.readUint16LE();
-		act->_speed = (int16)stream.readUint16LE();
+		act->_srot = (int16)stream.readUint16LE();
 		act->_controlMode = (ControlMode)stream.readUint16LE();
 		act->_cropLeft = stream.readSint16LE();
 		act->_delayInMillis = act->_cropLeft; // TODO: this might not be needed
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index 0fdb8377ede..9238d98f54f 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -1246,7 +1246,7 @@ int32 ScriptLife::lSET_DOOR_LEFT(TwinEEngine *engine, LifeScriptContext &ctx) {
 	ctx.actor->_beta = LBAAngles::ANGLE_270;
 	ctx.actor->_posObj.x = ctx.actor->_animStep.x - distance;
 	ctx.actor->_workFlags.bIsSpriteMoving = 0;
-	ctx.actor->_speed = 0;
+	ctx.actor->_srot = 0;
 
 	return 0;
 }
@@ -1262,7 +1262,7 @@ int32 ScriptLife::lSET_DOOR_RIGHT(TwinEEngine *engine, LifeScriptContext &ctx) {
 	ctx.actor->_beta = LBAAngles::ANGLE_90;
 	ctx.actor->_posObj.x = ctx.actor->_animStep.x + distance;
 	ctx.actor->_workFlags.bIsSpriteMoving = 0;
-	ctx.actor->_speed = 0;
+	ctx.actor->_srot = 0;
 
 	return 0;
 }
@@ -1278,7 +1278,7 @@ int32 ScriptLife::lSET_DOOR_UP(TwinEEngine *engine, LifeScriptContext &ctx) {
 	ctx.actor->_beta = LBAAngles::ANGLE_180;
 	ctx.actor->_posObj.z = ctx.actor->_animStep.z - distance;
 	ctx.actor->_workFlags.bIsSpriteMoving = 0;
-	ctx.actor->_speed = 0;
+	ctx.actor->_srot = 0;
 
 	return 0;
 }
@@ -1294,7 +1294,7 @@ int32 ScriptLife::lSET_DOOR_DOWN(TwinEEngine *engine, LifeScriptContext &ctx) {
 	ctx.actor->_beta = LBAAngles::ANGLE_0;
 	ctx.actor->_posObj.z = ctx.actor->_animStep.z + distance;
 	ctx.actor->_workFlags.bIsSpriteMoving = 0;
-	ctx.actor->_speed = 0;
+	ctx.actor->_srot = 0;
 
 	return 0;
 }
diff --git a/engines/twine/script/script_move.cpp b/engines/twine/script/script_move.cpp
index e15b0f2b16f..9b8512faaf7 100644
--- a/engines/twine/script/script_move.cpp
+++ b/engines/twine/script/script_move.cpp
@@ -101,7 +101,7 @@ int32 ScriptMove::mGOTO_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
 	if (ctx.actor->_staticFlags.bSprite3D) {
 		ctx.actor->_beta = newAngle;
 	} else {
-		engine->_movements->initRealAngleConst(ctx.actor->_beta, newAngle, ctx.actor->_speed, &ctx.actor->realAngle);
+		engine->_movements->initRealAngleConst(ctx.actor->_beta, newAngle, ctx.actor->_srot, &ctx.actor->realAngle);
 	}
 
 	if (engine->_movements->_targetActorDistance > 500) {
@@ -149,7 +149,7 @@ int32 ScriptMove::mANGLE(TwinEEngine *engine, MoveScriptContext &ctx) {
 	}
 	engine->_scene->_currentScriptValue = angle;
 	if (ctx.actor->realAngle.timeValue == 0) {
-		engine->_movements->initRealAngleConst(ctx.actor->_beta, angle, ctx.actor->_speed, &ctx.actor->realAngle);
+		engine->_movements->initRealAngleConst(ctx.actor->_beta, angle, ctx.actor->_srot, &ctx.actor->realAngle);
 	}
 	if (ctx.actor->_beta == angle) {
 		engine->_movements->clearRealAngle(ctx.actor);
@@ -169,7 +169,7 @@ int32 ScriptMove::mPOS_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
 
 	const IVec3 &sp = engine->_scene->_sceneTracks[engine->_scene->_currentScriptValue];
 	if (ctx.actor->_staticFlags.bSprite3D) {
-		ctx.actor->_speed = 0;
+		ctx.actor->_srot = 0;
 	}
 
 	ctx.actor->_posObj = sp;
@@ -231,7 +231,7 @@ int32 ScriptMove::mGOTO_SYM_POINT(TwinEEngine *engine, MoveScriptContext &ctx) {
 	if (ctx.actor->_staticFlags.bSprite3D) {
 		ctx.actor->_beta = newAngle;
 	} else {
-		engine->_movements->initRealAngleConst(ctx.actor->_beta, newAngle, ctx.actor->_speed, &ctx.actor->realAngle);
+		engine->_movements->initRealAngleConst(ctx.actor->_beta, newAngle, ctx.actor->_srot, &ctx.actor->realAngle);
 	}
 
 	if (engine->_movements->_targetActorDistance > 500) {
@@ -315,11 +315,11 @@ int32 ScriptMove::mGOTO_POINT_3D(TwinEEngine *engine, MoveScriptContext &ctx) {
  * @note Opcode @c 0x10
  */
 int32 ScriptMove::mSPEED(TwinEEngine *engine, MoveScriptContext &ctx) {
-	ctx.actor->_speed = ctx.stream.readSint16LE();
-	debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SPEED(%i)", (int)ctx.actor->_speed);
+	ctx.actor->_srot = ctx.stream.readSint16LE();
+	debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::SPEED(%i)", (int)ctx.actor->_srot);
 
 	if (ctx.actor->_staticFlags.bSprite3D) {
-		engine->_movements->initRealValue(LBAAngles::ANGLE_0, ctx.actor->_speed, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
+		engine->_movements->initRealValue(LBAAngles::ANGLE_0, ctx.actor->_srot, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
 	}
 
 	return 0;
@@ -411,7 +411,7 @@ int32 ScriptMove::mOPEN_GENERIC(TwinEEngine *engine, MoveScriptContext &ctx, int
 		ctx.actor->_beta = angle;
 		ctx.actor->_doorWidth = doorStatus;
 		ctx.actor->_workFlags.bIsSpriteMoving = 1;
-		ctx.actor->_speed = 1000;
+		ctx.actor->_srot = 1000;
 		engine->_movements->initRealValue(LBAAngles::ANGLE_0, LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
 	}
 	if (engine->_scene->_numCube == LBA1SceneId::Proxima_Island_Museum && ctx.actor->_actorIdx == 16) {
@@ -463,7 +463,7 @@ int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
 	if (ctx.actor->_staticFlags.bSprite3D && ctx.actor->_staticFlags.bSpriteClip) {
 		ctx.actor->_doorWidth = 0;
 		ctx.actor->_workFlags.bIsSpriteMoving = 1;
-		ctx.actor->_speed = -1000;
+		ctx.actor->_srot = -1000;
 		engine->_movements->initRealValue(LBAAngles::ANGLE_0, -LBAAngles::ANGLE_351, LBAAngles::ANGLE_17, &ctx.actor->realAngle);
 	}
 	return 0;
@@ -476,7 +476,7 @@ int32 ScriptMove::mCLOSE(TwinEEngine *engine, MoveScriptContext &ctx) {
 int32 ScriptMove::mWAIT_DOOR(TwinEEngine *engine, MoveScriptContext &ctx) {
 	debugC(3, kDebugLevels::kDebugScriptsMove, "MOVE::WAIT_DOOR()");
 	if (ctx.actor->_staticFlags.bSprite3D && ctx.actor->_staticFlags.bSpriteClip) {
-		if (ctx.actor->_speed) {
+		if (ctx.actor->_srot) {
 			ctx.undo(0);
 			return 1;
 		}
@@ -582,7 +582,7 @@ int32 ScriptMove::mFACE_HERO(TwinEEngine *engine, MoveScriptContext &ctx) {
 	engine->_scene->_currentScriptValue = angle;
 	if (engine->_scene->_currentScriptValue == -1 && ctx.actor->realAngle.timeValue == 0) {
 		engine->_scene->_currentScriptValue = engine->_movements->getAngle(ctx.actor->posObj(), engine->_scene->_sceneHero->posObj());
-		engine->_movements->initRealAngleConst(ctx.actor->_beta, engine->_scene->_currentScriptValue, ctx.actor->_speed, &ctx.actor->realAngle);
+		engine->_movements->initRealAngleConst(ctx.actor->_beta, engine->_scene->_currentScriptValue, ctx.actor->_srot, &ctx.actor->realAngle);
 		ctx.stream.rewind(2);
 		ctx.stream.writeSint16LE(engine->_scene->_currentScriptValue);
 	}
@@ -620,7 +620,7 @@ int32 ScriptMove::mANGLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
 			engine->_scene->_currentScriptValue = ClampAngle(newAngle - engine->getRandomNumber(val1));
 		}
 
-		engine->_movements->initRealAngleConst(ctx.actor->_beta, engine->_scene->_currentScriptValue, ctx.actor->_speed, &ctx.actor->realAngle);
+		engine->_movements->initRealAngleConst(ctx.actor->_beta, engine->_scene->_currentScriptValue, ctx.actor->_srot, &ctx.actor->realAngle);
 		ctx.stream.rewind(2);
 		ctx.stream.writeSint16LE(engine->_scene->_currentScriptValue);
 	}
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index e20f2421de6..778a9fa43a4 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -829,7 +829,7 @@ void TwinEEngine::processInventoryAction() {
 			_actor->initBody(BodyType::btNormal, _scene->_mecaPenguinIdx);
 			penguin->_workFlags.bIsDead = 0;
 			penguin->setCollision(ShapeType::kNone);
-			_movements->initRealAngleConst(penguin->_beta, penguin->_beta, penguin->_speed, &penguin->realAngle);
+			_movements->initRealAngleConst(penguin->_beta, penguin->_beta, penguin->_srot, &penguin->realAngle);
 			_gameState->removeItem(InventoryItems::kiPenguin);
 			penguin->_delayInMillis = timerRef + toSeconds(30);
 		}




More information about the Scummvm-git-logs mailing list