[Scummvm-git-logs] scummvm master -> 8ac2ed039fc3e3a3bbdf373d309153bee67b306b

mgerhardy noreply at scummvm.org
Wed Oct 16 18:36:02 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:
fd56abaf3b TWINE: fade the holomap trajectory
8ac2ed039f TWINE: renamed members and methods to match original sources


Commit: fd56abaf3b2f85970087aa72184a76442a9d2763
    https://github.com/scummvm/scummvm/commit/fd56abaf3b2f85970087aa72184a76442a9d2763
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-16T20:35:41+02:00

Commit Message:
TWINE: fade the holomap trajectory

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


diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 7b9d18813e1..7dd49a8f521 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -605,6 +605,11 @@ void Scene::changeCube() {
 		_engine->_screens->setBlackPal();
 		_engine->_holomap->holoTraj(_numHolomapTraj);
 		_numHolomapTraj = -1;
+		_engine->_screens->_flagFade = true;
+	} else {
+		// TODO lbawin can do a fade here (if activated)
+		// _engine->_screens->_flagFade = true;
+
 	}
 
 	if (_newCube == LBA1SceneId::Citadel_Island_end_sequence_1 || _newCube == LBA1SceneId::Citadel_Island_end_sequence_2) {


Commit: 8ac2ed039fc3e3a3bbdf373d309153bee67b306b
    https://github.com/scummvm/scummvm/commit/8ac2ed039fc3e3a3bbdf373d309153bee67b306b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2024-10-16T20:35:41+02:00

Commit Message:
TWINE: renamed members and methods to match original sources

Changed paths:
    engines/twine/debugger/console.cpp
    engines/twine/debugger/debugtools.cpp
    engines/twine/menu/menu.cpp
    engines/twine/renderer/redraw.cpp
    engines/twine/renderer/redraw.h
    engines/twine/scene/actor.cpp
    engines/twine/scene/actor.h
    engines/twine/scene/animations.cpp
    engines/twine/scene/buggy.cpp
    engines/twine/scene/gamestate.cpp
    engines/twine/scene/gamestate.h
    engines/twine/scene/grid.cpp
    engines/twine/scene/movements.cpp
    engines/twine/scene/scene.cpp
    engines/twine/scene/scene.h
    engines/twine/script/script_life.cpp
    engines/twine/script/script_life_v2.cpp
    engines/twine/twine.cpp


diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 9a4a173e580..43db25a809c 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -368,7 +368,7 @@ bool TwinEConsole::doChangeScene(int argc, const char **argv) {
 		return true;
 	}
 	_engine->_scene->_newCube = atoi(argv[1]);
-	_engine->_scene->_heroPositionType = ScenePositionType::kScene;
+	_engine->_scene->_flagChgCube = ScenePositionType::kScene;
 	_engine->_scene->changeCube();
 	return true;
 }
diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index ad7f3007475..1ca93908783 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -456,7 +456,7 @@ static void sceneDetailsWindows(TwinEEngine *engine) {
 		ImGuiEx::InputInt("Alpha light", &scene->_alphaLight);
 		ImGuiEx::InputInt("Beta light", &scene->_betaLight);
 		ImGuiEx::InputInt("Fall Y position", &scene->_startYFalling);
-		ImGui::Text("Hero position type: %i", (int)scene->_heroPositionType);
+		ImGui::Text("Hero position type: %i", (int)scene->_flagChgCube);
 	}
 	ImGui::End();
 }
@@ -511,7 +511,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
 				ImGui::TableNextColumn();
 				ImGui::Text("Control mode");
 				ImGui::TableNextColumn();
-				ImGui::Text("%i", actor->_controlMode);
+				ImGui::Text("%i", actor->_move);
 				ImGui::TableNextColumn();
 				ImGui::Text("Delay");
 				ImGui::TableNextColumn();
@@ -698,7 +698,7 @@ static void actorDetailsWindow(int &actorIdx, TwinEEngine *engine) {
 
 static void gameStateMenu(TwinEEngine *engine) {
 	if (ImGui::BeginMenu("Game State")) {
-		int keys = engine->_gameState->_inventoryNumKeys;
+		int keys = engine->_gameState->_nbLittleKeys;
 		if (ImGui::InputInt("Keys", &keys)) {
 			engine->_gameState->setKeys(keys);
 		}
diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index e781528751a..7a555c0ee67 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -1067,7 +1067,7 @@ void Menu::drawCoins(int32 left, int32 top) {
 }
 
 void Menu::drawKeys(int32 left, int32 top) {
-	const Common::String &inventoryNumKeys = Common::String::format("%d", _engine->_gameState->_inventoryNumKeys);
+	const Common::String &inventoryNumKeys = Common::String::format("%d", _engine->_gameState->_nbLittleKeys);
 	drawSpriteAndString(left, top, _engine->_resources->_spriteData[SPRITEHQR_KEY], inventoryNumKeys);
 }
 
diff --git a/engines/twine/renderer/redraw.cpp b/engines/twine/renderer/redraw.cpp
index 8a21e4de3c9..0bcb6d55ba5 100644
--- a/engines/twine/renderer/redraw.cpp
+++ b/engines/twine/renderer/redraw.cpp
@@ -872,42 +872,39 @@ void Redraw::renderText() {
 	addPhysBox(redraw);
 }
 
-void Redraw::drawScene(bool bgRedraw) { // AffScene
+void Redraw::drawScene(bool flagflip) { // AffScene
 	int32 tmp_projPosX = _projPosScreen.x;
 	int32 tmp_projPosY = _projPosScreen.y;
 
 	_engine->_interface->unsetClip();
 
-	if (bgRedraw) {
+	if (!flagflip) {
+		clsBoxes();
+	} else {
 		_engine->saveTimer(false);
 		if (_engine->_scene->_newCube != SCENE_CEILING_GRID_FADE_1 && _engine->_scene->_newCube != SCENE_CEILING_GRID_FADE_2) {
 			_engine->_screens->fadeToBlack(_engine->_screens->_ptrPal);
 		}
-		_engine->_screens->clearScreen();
 
 		_engine->_grid->redrawGrid();
-		const IVec3 &projPos = _engine->_renderer->projectPoint(-_engine->_grid->_worldCube);
-		_projPosScreen.x = projPos.x;
-		_projPosScreen.y = projPos.y;
 
 		updateOverlayTypePosition(tmp_projPosX, tmp_projPosY, _projPosScreen.x, _projPosScreen.y);
+
 		_engine->saveFrontBuffer();
 
 		if (_engine->_scene->_newCube != SCENE_CEILING_GRID_FADE_1 && _engine->_scene->_newCube != SCENE_CEILING_GRID_FADE_2) {
 			_engine->_screens->fadeToPal(_engine->_screens->_ptrPal);
 		}
-	} else {
-		clsBoxes();
 	}
 
 	DrawListStruct drawList[NUM_MAX_ACTORS + EXTRA_MAX_ENTRIES]; // ListTri[MAX_OBJECTS + MAX_EXTRAS]
-	int32 drawListPos = fillActorDrawingList(drawList, bgRedraw);
+	int32 drawListPos = fillActorDrawingList(drawList, flagflip);
 	drawListPos = fillExtraDrawingList(drawList, drawListPos);
 
 	_nbPhysBox = 0;
 	sortDrawingList(drawList, drawListPos);
 	correctZLevels(drawList, drawListPos);
-	processDrawList(drawList, drawListPos, bgRedraw);
+	processDrawList(drawList, drawListPos, flagflip);
 
 	_engine->_debugState->renderDebugView();
 
@@ -921,7 +918,7 @@ void Redraw::drawScene(bool bgRedraw) { // AffScene
 		_engine->_scene->_newCube = SCENE_CEILING_GRID_FADE_1;
 	}
 
-	if (bgRedraw) {
+	if (flagflip) {
 		moveNextAreas();
 		_engine->restoreTimer();
 	} else {
diff --git a/engines/twine/renderer/redraw.h b/engines/twine/renderer/redraw.h
index 4d41ed0a69c..678746f3bbb 100644
--- a/engines/twine/renderer/redraw.h
+++ b/engines/twine/renderer/redraw.h
@@ -113,8 +113,6 @@ private:
 	int32 _bubbleActor = -1;
 	int32 _bubbleSpriteIndex;
 
-	IVec3 _projPosScreen; // XpOrgw, YpOrgw
-
 	// big font shadow text in the lower left corner
 	Common::String _text;
 	int32 _textDisappearTime = -1;
@@ -151,6 +149,8 @@ public:
 	/** Request background redraw */
 	bool _firstTime = false;
 
+	IVec3 _projPosScreen; // XpOrgw, YpOrgw
+
 	/** Current number of redraw regions in the screen */
 	int32 _nbPhysBox = 0; // fullRedrawVar8
 	/** Number of redraw regions in the screen */
diff --git a/engines/twine/scene/actor.cpp b/engines/twine/scene/actor.cpp
index 08d978cc9d9..c5e7defa4d6 100644
--- a/engines/twine/scene/actor.cpp
+++ b/engines/twine/scene/actor.cpp
@@ -42,9 +42,9 @@ namespace TwinE {
 Actor::Actor(TwinEEngine *engine) : _engine(engine) {
 }
 
-void Actor::restartHeroScene() {
+void Actor::restartPerso() {
 	ActorStruct *sceneHero = _engine->_scene->_sceneHero;
-	sceneHero->_controlMode = ControlMode::kManual;
+	sceneHero->_move = ControlMode::kManual;
 	memset(&sceneHero->_workFlags, 0, sizeof(sceneHero->_workFlags));
 	memset(&sceneHero->_flags, 0, sizeof(sceneHero->_flags));
 
diff --git a/engines/twine/scene/actor.h b/engines/twine/scene/actor.h
index db621e689b9..199708f6fd3 100644
--- a/engines/twine/scene/actor.h
+++ b/engines/twine/scene/actor.h
@@ -194,7 +194,7 @@ public:
 	BonusParameter _bonusParameter;
 	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
+	ControlMode _move = ControlMode::kNoMove; // Move
 	int32 _delayInMillis = 0; // Info
 	int32 _cropLeft = 0;      // Info
 	int32 _cropTop = 0;       // Info1
@@ -326,7 +326,7 @@ public:
 	void setFrame(int32 actorIdx, uint32 frame);
 
 	/** Restart hero variables while opening new scenes */
-	void restartHeroScene();
+	void restartPerso();
 
 	/** Load hero 3D body and animations */
 	void loadHeroEntities();
diff --git a/engines/twine/scene/animations.cpp b/engines/twine/scene/animations.cpp
index c331fc2f66e..8d501179a37 100644
--- a/engines/twine/scene/animations.cpp
+++ b/engines/twine/scene/animations.cpp
@@ -59,9 +59,9 @@ int32 Animations::searchAnim(AnimationTypes animIdx, int32 actorIdx) {
 
 int16 Animations::patchInterAngle(int32 deltaTime, int32 keyFrameLength, int16 newAngle1, int16 lastAngle1) const {
 	const int16 lastAngle = ClampAngle(lastAngle1);
-	const int16 newAngle = ClampAngle(newAngle1);
+	const int16 nextAngle = ClampAngle(newAngle1);
 
-	int16 angleDiff = newAngle - lastAngle;
+	int16 angleDiff = nextAngle - lastAngle;
 
 	int16 computedAngle;
 	if (angleDiff) {
diff --git a/engines/twine/scene/buggy.cpp b/engines/twine/scene/buggy.cpp
index be73ddcc3ea..7cbe727ed3c 100644
--- a/engines/twine/scene/buggy.cpp
+++ b/engines/twine/scene/buggy.cpp
@@ -63,7 +63,7 @@ void Buggy::initBuggy(uint8 numobj, uint32 flaginit) {
 
 		NumBuggy = (uint8)(numobj | BUGGY_PRESENT);
 	} else if (NumBuggy) {
-		if (_engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX)->_controlMode != ControlMode::kBuggyManual && _engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX)->_controlMode != ControlMode::kBuggy) {
+		if (_engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX)->_move != ControlMode::kBuggyManual && _engine->_scene->getActor(OWN_ACTOR_SCENE_INDEX)->_move != ControlMode::kBuggy) {
 			int32 x, y;
 
 			if (_engine->_scene->_numCube == ptb->Cube) {
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 3d7aeeda26a..4d8a41a5e06 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -91,7 +91,7 @@ void GameState::initHeroVars() {
 	_inventoryNumLeafsBox = 2;
 	_inventoryNumLeafs = 2;
 	_goldPieces = 0;
-	_inventoryNumKeys = 0;
+	_nbLittleKeys = 0;
 	_magicPoint = 0;
 
 	_usingSabre = false;
@@ -125,7 +125,7 @@ void GameState::initEngineVars() {
 	_inventoryNumLeafsBox = 2;
 	_magicPoint = 0;
 	_goldPieces = 0;
-	_inventoryNumKeys = 0;
+	_nbLittleKeys = 0;
 	_inventoryNumGas = 0;
 
 	_engine->_actor->_cropBottomScreen = 0;
@@ -227,7 +227,7 @@ bool GameState::loadGame(Common::SeekableReadStream *file) {
 	}
 
 	_engine->_scene->_numCube = SCENE_CEILING_GRID_FADE_1;
-	_engine->_scene->_heroPositionType = ScenePositionType::kReborn;
+	_engine->_scene->_flagChgCube = ScenePositionType::kReborn;
 	return true;
 }
 
@@ -609,12 +609,12 @@ int16 GameState::setZlitos(int16 value) {
 }
 
 int16 GameState::setKeys(int16 value) {
-	_inventoryNumKeys = MAX<int16>(0, value);
-	return _inventoryNumKeys;
+	_nbLittleKeys = MAX<int16>(0, value);
+	return _nbLittleKeys;
 }
 
 void GameState::addKeys(int16 val) {
-	setKeys(_inventoryNumKeys + val);
+	setKeys(_nbLittleKeys + val);
 }
 
 void GameState::addKashes(int16 val) {
diff --git a/engines/twine/scene/gamestate.h b/engines/twine/scene/gamestate.h
index 872c07d0546..311117e540a 100644
--- a/engines/twine/scene/gamestate.h
+++ b/engines/twine/scene/gamestate.h
@@ -107,7 +107,7 @@ public:
 	int16 _magicLevelIdx = 0;
 
 	/** Store the number of inventory keys */
-	int16 _inventoryNumKeys = 0;
+	int16 _nbLittleKeys = 0;
 	/** Store the number of inventory kashes */
 	int16 _goldPieces = 0;
 	int16 _zlitosPieces = 0;
diff --git a/engines/twine/scene/grid.cpp b/engines/twine/scene/grid.cpp
index 6f06385b272..849a64c7359 100644
--- a/engines/twine/scene/grid.cpp
+++ b/engines/twine/scene/grid.cpp
@@ -674,12 +674,18 @@ void Grid::redrawGrid() { // AffGrille
 	_worldCube.y = _startCube.y * SIZE_BRICK_Y;
 	_worldCube.z = _startCube.z * SIZE_BRICK_XZ;
 
+	const IVec3 &projPos = _engine->_renderer->projectPoint(-_worldCube);
+	_engine->_redraw->_projPosScreen.x = projPos.x;
+	_engine->_redraw->_projPosScreen.y = projPos.y;
+
 	memset(_brickInfoBuffer, 0, _brickInfoBufferSize);
 
 	if (!_engine->_scene->_enableGridTileRendering) {
 		return;
 	}
 
+	_engine->_screens->clearScreen();
+
 	for (int32 z = 0; z < SIZE_CUBE_Z; z++) {
 		for (int32 x = 0; x < SIZE_CUBE_X; x++) {
 			for (int32 y = 0; y < SIZE_CUBE_Y; y++) {
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index 30759ea27eb..ab06facccb9 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -481,17 +481,17 @@ void Movements::doDir(int32 actorIdx) {
 	}
 
 	if (actor->_workFlags.bIsFalling) {
-		if (actor->_controlMode == ControlMode::kManual) {
+		if (actor->_move == ControlMode::kManual) {
 			manualRealAngle(actor);
 			// TODO: _lastJoyFlag = _joyFlag;
 		}
 		return;
 	}
-	if (!actor->_flags.bSprite3D && actor->_controlMode != ControlMode::kManual) {
+	if (!actor->_flags.bSprite3D && actor->_move != ControlMode::kManual) {
 		actor->_beta = actor->realAngle.getRealAngle(_engine->timerRef);
 	}
 
-	switch (actor->_controlMode) {
+	switch (actor->_move) {
 	case ControlMode::kManual:
 		processManualAction(actorIdx);
 		break;
@@ -519,7 +519,7 @@ void Movements::doDir(int32 actorIdx) {
 	case ControlMode::kTrackAttack: // unused
 		break;
 	default:
-		warning("Unknown control mode %d", (int)actor->_controlMode);
+		warning("Unknown control mode %d", (int)actor->_move);
 		break;
 	}
 }
diff --git a/engines/twine/scene/scene.cpp b/engines/twine/scene/scene.cpp
index 7dd49a8f521..da1da7a3fba 100644
--- a/engines/twine/scene/scene.cpp
+++ b/engines/twine/scene/scene.cpp
@@ -251,7 +251,7 @@ bool Scene::loadSceneLBA2() {
 		setBonusParameterFlags(act, stream.readUint16LE());
 		act->_beta = (int16)stream.readUint16LE();
 		act->_srot = (int16)stream.readUint16LE();
-		act->_controlMode = (ControlMode)stream.readByte(); // move
+		act->_move = (ControlMode)stream.readByte(); // move
 		act->_cropLeft = stream.readSint16LE();
 		act->_delayInMillis = act->_cropLeft; // TODO: this might not be needed
 		act->_cropTop = stream.readSint16LE();
@@ -386,7 +386,7 @@ bool Scene::loadSceneLBA1() {
 		act->_bonusParameter.givenNothing = 0;
 		act->_beta = (int16)stream.readUint16LE();
 		act->_srot = (int16)stream.readUint16LE();
-		act->_controlMode = (ControlMode)stream.readUint16LE();
+		act->_move = (ControlMode)stream.readUint16LE();
 		act->_cropLeft = stream.readSint16LE();
 		act->_delayInMillis = act->_cropLeft; // TODO: this might not be needed
 		act->_cropTop = stream.readSint16LE();
@@ -553,7 +553,7 @@ void Scene::changeCube() {
 					pos.x = zone->infoData.ChangeScene.x - zone->mins.x + track.x;
 					pos.y = zone->infoData.ChangeScene.y - zone->mins.y + track.y;
 					pos.z = zone->infoData.ChangeScene.z - zone->mins.z + track.z;
-					_engine->_scene->_heroPositionType = ScenePositionType::kZone;
+					_engine->_scene->_flagChgCube = ScenePositionType::kZone;
 					debug(2, "Using zone position %i:%i:%i", pos.x, pos.y, pos.z);
 				}
 			}
@@ -589,7 +589,7 @@ void Scene::changeCube() {
 	clearScene();
 	_engine->_actor->loadHeroEntities();
 
-	_sceneHero->_controlMode = ControlMode::kManual;
+	_sceneHero->_move = ControlMode::kManual;
 	_sceneHero->_zoneSce = -1;
 	_sceneHero->_offsetLife = 0;
 	_sceneHero->_offsetTrack = -1;
@@ -617,11 +617,17 @@ void Scene::changeCube() {
 	}
 
 	_engine->_text->initSceneTextBank();
+
+	debug(2, "Scene %i music track id: %i", _numCube, _cubeJingle);
+	if (_cubeJingle != 255) {
+		_engine->_music->playMusic(_cubeJingle);
+	}
+
 	_engine->_grid->initGrid(_newCube);
 
-	if (_heroPositionType == ScenePositionType::kZone) {
+	if (_flagChgCube == ScenePositionType::kZone) {
 		_newHeroPos = _zoneHeroPos;
-	} else if (_heroPositionType == ScenePositionType::kScene || _heroPositionType == ScenePositionType::kNoPosition) {
+	} else if (_flagChgCube == ScenePositionType::kScene || _flagChgCube == ScenePositionType::kNoPosition) {
 		_newHeroPos = _sceneHeroPos;
 	}
 
@@ -636,35 +642,33 @@ void Scene::changeCube() {
 		_engine->autoSave();
 	}
 
-	_engine->_actor->restartHeroScene();
+	_engine->_actor->restartPerso();
 
+	// StartInitAllObjs
 	for (int32 a = 1; a < _nbObjets; a++) {
 		_engine->_actor->startInitObj(a);
 	}
 
-	_engine->_gameState->_inventoryNumKeys = 0;
+	_engine->_gameState->_nbLittleKeys = 0;
+	_engine->_gameState->_magicBall = -1;
+	_engine->_movements->_lastJoyFlag = true;
+	_engine->_grid->_useCellingGrid = -1;
+	_engine->_grid->_cellingGridIdx = -1;
+	_engine->_redraw->_firstTime = true;
 	_engine->_cameraZone = false;
 
 	ActorStruct *followedActor = getActor(_numObjFollow);
 	_engine->_grid->centerOnActor(followedActor);
 
-	_engine->_gameState->_magicBall = -1;
-	_engine->_movements->_lastJoyFlag = true;
-	_engine->_grid->_useCellingGrid = -1;
-	_engine->_grid->_cellingGridIdx = -1;
 	_engine->_screens->_flagFade = true;
 	_engine->_renderer->setLightVector(_alphaLight, _betaLight, LBAAngles::ANGLE_0);
 
 	_newCube = SCENE_CEILING_GRID_FADE_1;
 	_enableGridTileRendering = true;
-	_heroPositionType = ScenePositionType::kNoPosition;
+	_flagChgCube = ScenePositionType::kNoPosition;
 	_zoneHeroPos = IVec3();
 	_sampleAmbienceTime = 0;
 
-	debug(2, "Scene %i music track id: %i", _numCube, _cubeJingle);
-	if (_cubeJingle != 255) {
-		_engine->_music->playMusic(_cubeJingle);
-	}
 	_engine->_gameState->handleLateGameItems();
 }
 
@@ -794,7 +798,7 @@ void Scene::checkZoneSce(int32 actorIdx) {
 					_zoneHeroPos.x = actor->_posObj.x - zone->mins.x + zone->infoData.ChangeScene.x;
 					_zoneHeroPos.y = actor->_posObj.y - zone->mins.y + zone->infoData.ChangeScene.y;
 					_zoneHeroPos.z = actor->_posObj.z - zone->mins.z + zone->infoData.ChangeScene.z;
-					_heroPositionType = ScenePositionType::kZone;
+					_flagChgCube = ScenePositionType::kZone;
 				}
 				break;
 			case ZoneType::kCamera:
diff --git a/engines/twine/scene/scene.h b/engines/twine/scene/scene.h
index a13b137b276..a7b98423354 100644
--- a/engines/twine/scene/scene.h
+++ b/engines/twine/scene/scene.h
@@ -186,7 +186,7 @@ public:
 	int16 _startYFalling = 0;
 
 	/** Hero type of position in scene */
-	ScenePositionType _heroPositionType = ScenePositionType::kNoPosition; // twinsenPositionModeInNewCube
+	ScenePositionType _flagChgCube = ScenePositionType::kNoPosition; // twinsenPositionModeInNewCube
 
 	// ACTORS
 	int32 _nbObjets = 0;
diff --git a/engines/twine/script/script_life.cpp b/engines/twine/script/script_life.cpp
index a2b56725669..80c29415aa8 100644
--- a/engines/twine/script/script_life.cpp
+++ b/engines/twine/script/script_life.cpp
@@ -317,7 +317,7 @@ static ReturnType processLifeConditions(TwinEEngine *engine, LifeScriptContext &
 	}
 	case kcNUM_LITTLE_KEYS:
 		debugCN(3, kDebugLevels::kDebugScriptsLife, "num_little_keys(");
-		engine->_scene->_currentScriptValue = engine->_gameState->_inventoryNumKeys;
+		engine->_scene->_currentScriptValue = engine->_gameState->_nbLittleKeys;
 		break;
 	case kcNUM_GOLD_PIECES:
 		debugCN(3, kDebugLevels::kDebugScriptsLife, "num_gold_pieces(");
@@ -958,8 +958,8 @@ int32 ScriptLife::lFALLABLE(TwinEEngine *engine, LifeScriptContext &ctx) {
 int32 ScriptLife::lSET_DIRMODE(TwinEEngine *engine, LifeScriptContext &ctx) {
 	const int32 controlMode = ctx.stream.readByte();
 
-	ctx.actor->_controlMode = (ControlMode)controlMode;
-	if (ctx.actor->_controlMode == ControlMode::kFollow) {
+	ctx.actor->_move = (ControlMode)controlMode;
+	if (ctx.actor->_move == ControlMode::kFollow) {
 		ctx.actor->_followedActor = ctx.stream.readByte();
 		debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE(%i, %i)", (int)controlMode, (int)ctx.actor->_followedActor);
 	} else {
@@ -978,9 +978,9 @@ int32 ScriptLife::lSET_DIRMODE_OBJ(TwinEEngine *engine, LifeScriptContext &ctx)
 	const int32 controlMode = ctx.stream.readByte();
 
 	ActorStruct *otherActor = engine->_scene->getActor(otherActorIdx);
-	otherActor->_controlMode = (ControlMode)controlMode;
+	otherActor->_move = (ControlMode)controlMode;
 	// TODO: should ControlMode::kSameXZ be taken into account, too - see processSameXZAction
-	if (otherActor->_controlMode == ControlMode::kFollow || ctx.actor->_controlMode == ControlMode::kFollow2) {
+	if (otherActor->_move == ControlMode::kFollow || ctx.actor->_move == ControlMode::kFollow2) {
 		otherActor->_followedActor = ctx.stream.readByte();
 		debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::SET_DIRMODE_OBJ(%i, %i, %i)", (int)otherActorIdx, (int)controlMode, (int)otherActor->_followedActor);
 	} else {
@@ -1326,7 +1326,7 @@ int32 ScriptLife::lCHANGE_CUBE(TwinEEngine *engine, LifeScriptContext &ctx) {
 	const int32 sceneIdx = ctx.stream.readByte();
 	debugC(3, kDebugLevels::kDebugScriptsLife, "LIFE::CHANGE_CUBE(%i)", (int)sceneIdx);
 	engine->_scene->_newCube = sceneIdx;
-	engine->_scene->_heroPositionType = ScenePositionType::kScene;
+	engine->_scene->_flagChgCube = ScenePositionType::kScene;
 	return 0;
 }
 
diff --git a/engines/twine/script/script_life_v2.cpp b/engines/twine/script/script_life_v2.cpp
index 363faaa2640..6394f8d7ce3 100644
--- a/engines/twine/script/script_life_v2.cpp
+++ b/engines/twine/script/script_life_v2.cpp
@@ -952,7 +952,7 @@ int32 ScriptLifeV2::lSET_RAIL(TwinEEngine *engine, LifeScriptContext &ctx) {
 int32 ScriptLifeV2::lINVERSE_BETA(TwinEEngine *engine, LifeScriptContext &ctx) {
 	ctx.actor->_beta = ClampAngle(ctx.actor->_beta + LBAAngles::ANGLE_180);
 
-	if (ctx.actor->_controlMode == ControlMode::kWagon) {
+	if (ctx.actor->_move == ControlMode::kWagon) {
 #if 0 // TODO:
 		ctx.actor->Info1 = 1; // reinit speed wagon
 
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index ce7b5bce2a0..e5771207aeb 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -352,7 +352,7 @@ Common::Error TwinEEngine::run() {
 			_text->_flagMessageShade = true;
 			_text->_renderTextTriangle = false;
 			_scene->_newCube = sceneIndex;
-			_scene->_heroPositionType = ScenePositionType::kScene;
+			_scene->_flagChgCube = ScenePositionType::kScene;
 			_state = EngineState::GameLoop;
 		}
 	}
@@ -368,7 +368,7 @@ Common::Error TwinEEngine::run() {
 		case EngineState::LoadedGame:
 			debug("Loaded game");
 			if (_scene->_newHeroPos.x == -1) {
-				_scene->_heroPositionType = ScenePositionType::kNoPosition;
+				_scene->_flagChgCube = ScenePositionType::kNoPosition;
 			}
 			_text->_renderTextTriangle = false;
 			_text->normalWinDial();
@@ -942,7 +942,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 
 		// inventory menu
 		_loopInventoryItem = -1;
-		if (_input->isActionActive(TwinEActionType::InventoryMenu) && _scene->_sceneHero->_body != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
+		if (_input->isActionActive(TwinEActionType::InventoryMenu) && _scene->_sceneHero->_body != -1 && _scene->_sceneHero->_move == ControlMode::kManual) {
 			processInventoryAction();
 		}
 
@@ -963,7 +963,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 			 _input->isActionActive(TwinEActionType::QuickBehaviourAthletic, false) ||
 			 _input->isActionActive(TwinEActionType::QuickBehaviourAggressive, false) ||
 			 _input->isActionActive(TwinEActionType::QuickBehaviourDiscreet, false)) &&
-			_scene->_sceneHero->_body != -1 && _scene->_sceneHero->_controlMode == ControlMode::kManual) {
+			_scene->_sceneHero->_body != -1 && _scene->_sceneHero->_move == ControlMode::kManual) {
 			if (_input->isActionActive(TwinEActionType::QuickBehaviourNormal, false)) {
 				_actor->_heroBehaviour = HeroBehaviourType::kNormal;
 			} else if (_input->isActionActive(TwinEActionType::QuickBehaviourAthletic, false)) {
@@ -1075,7 +1075,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 		if (actor->_lifePoint == 0) {
 			if (IS_HERO(a)) {
 				_animations->initAnim(AnimationTypes::kLandDeath, AnimType::kAnimationSet, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
-				actor->_controlMode = ControlMode::kNoMove;
+				actor->_move = ControlMode::kNoMove;
 #if 0 // TODO: enable me - found in the lba1 community release source code
 				// Disable collisions on Twinsen to allow other objects to continue their tracks
 				// while the death animation is playing
@@ -1145,7 +1145,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 							_animations->initAnim(AnimationTypes::kDrawn, AnimType::kAnimationSet, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
 						}
 						const IVec3 &projPos = _renderer->projectPoint(actor->posObj() - _grid->_worldCube);
-						actor->_controlMode = ControlMode::kNoMove;
+						actor->_move = ControlMode::kNoMove;
 						actor->setLife(-1);
 						_actor->_cropBottomScreen = projPos.y;
 						actor->_flags.bNoShadow = 1;
@@ -1173,7 +1173,7 @@ bool TwinEEngine::runGameEngine() { // mainLoopInteration
 
 						_grid->centerOnActor(_scene->_sceneHero);
 
-						_scene->_heroPositionType = ScenePositionType::kReborn;
+						_scene->_flagChgCube = ScenePositionType::kReborn;
 
 						_scene->_sceneHero->setLife(getMaxLife());
 						_redraw->_firstTime = true;




More information about the Scummvm-git-logs mailing list