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

mgerhardy noreply at scummvm.org
Tue Feb 11 19:46:28 UTC 2025


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:
cfca64a04f TWINE: renamed member to match original sources + added comments
c51da2090b TWINE: fixed segfault when restaring a game from the launcher a second time


Commit: cfca64a04f5ce5ac9364c23980991f5ee36fb345
    https://github.com/scummvm/scummvm/commit/cfca64a04f5ce5ac9364c23980991f5ee36fb345
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2025-02-11T20:46:07+01:00

Commit Message:
TWINE: renamed member to match original sources + added comments

Changed paths:
    engines/twine/input.h
    engines/twine/scene/gamestate.cpp
    engines/twine/scene/gamestate.h
    engines/twine/scene/movements.cpp
    engines/twine/shared.h
    engines/twine/twine.cpp


diff --git a/engines/twine/input.h b/engines/twine/input.h
index 3d510dfff86..a579f069bae 100644
--- a/engines/twine/input.h
+++ b/engines/twine/input.h
@@ -144,7 +144,7 @@ public:
 
 	bool isQuickBehaviourActionActive() const;
 	bool isMoveOrTurnActionActive() const;
-	bool isHeroActionActive() const;
+	bool isHeroActionActive() const; // MyFire & F_SPACE
 	bool resetHeroActions();
 
 	/**
diff --git a/engines/twine/scene/gamestate.cpp b/engines/twine/scene/gamestate.cpp
index 3e61d50a99b..95557a15cbf 100644
--- a/engines/twine/scene/gamestate.cpp
+++ b/engines/twine/scene/gamestate.cpp
@@ -94,7 +94,7 @@ void GameState::initHeroVars() {
 	_nbLittleKeys = 0;
 	_magicPoint = 0;
 
-	_usingSabre = false;
+	_weapon = false;
 
 	_engine->_scene->_sceneHero->_genBody = BodyType::btNormal;
 	_engine->_scene->_sceneHero->setLife(_engine->getMaxLife());
@@ -131,7 +131,7 @@ void GameState::initEngineVars() {
 	_engine->_actor->_cropBottomScreen = 0;
 
 	_magicLevelIdx = 0;
-	_usingSabre = false;
+	_weapon = false;
 
 	setChapter(0);
 
@@ -218,7 +218,7 @@ bool GameState::loadGame(Common::SeekableReadStream *file) {
 	file->read(_inventoryFlags, NUM_INVENTORY_ITEMS);
 
 	setLeafs(file->readByte());
-	_usingSabre = file->readByte();
+	_weapon = file->readByte();
 
 	if (saveFileVersion == 4) {
 		// the time the game was played
@@ -283,7 +283,7 @@ bool GameState::saveGame(Common::WriteStream *file) {
 	file->write(_inventoryFlags, NUM_INVENTORY_ITEMS);
 
 	file->writeByte(_inventoryNumLeafs);
-	file->writeByte(_usingSabre ? 1 : 0);
+	file->writeByte(_weapon ? 1 : 0);
 	file->writeByte(0);
 
 	return true;
diff --git a/engines/twine/scene/gamestate.h b/engines/twine/scene/gamestate.h
index 311117e540a..6938df72806 100644
--- a/engines/twine/scene/gamestate.h
+++ b/engines/twine/scene/gamestate.h
@@ -121,7 +121,7 @@ public:
 	int16 _inventoryNumGas = 0;
 
 	/** Its using FunFrock Sabre */
-	bool _usingSabre = false;
+	bool _weapon = false;
 	bool _endGameItems = false;
 
 	/**
diff --git a/engines/twine/scene/movements.cpp b/engines/twine/scene/movements.cpp
index da117bb440a..9bddb2487ec 100644
--- a/engines/twine/scene/movements.cpp
+++ b/engines/twine/scene/movements.cpp
@@ -291,13 +291,14 @@ void Movements::processBehaviourExecution(int actorIdx) {
 
 bool Movements::processAttackExecution(int actorIdx) {
 	ActorStruct *actor = _engine->_scene->getActor(actorIdx);
-	if (!_engine->_gameState->_usingSabre) {
+	if (!_engine->_gameState->_weapon) {
 		// Use Magic Ball
 		if (_engine->_gameState->hasItem(InventoryItems::kiMagicBall)) {
 			if (_engine->_gameState->_magicBall == -1) {
 				_engine->_animations->initAnim(AnimationTypes::kThrowBall, AnimType::kAnimationThen, AnimationTypes::kStanding, actorIdx);
 			}
 
+			_lastJoyFlag = true;
 			actor->_beta = actor->realAngle.getRealAngle(_engine->timerRef);
 			return true;
 		}
@@ -308,6 +309,7 @@ bool Movements::processAttackExecution(int actorIdx) {
 
 		_engine->_animations->initAnim(AnimationTypes::kSabreAttack, AnimType::kAnimationThen, AnimationTypes::kStanding, actorIdx);
 
+		_lastJoyFlag = true;
 		actor->_beta = actor->realAngle.getRealAngle(_engine->timerRef);
 		return true;
 	}
@@ -396,11 +398,9 @@ void Movements::processManualAction(int actorIdx) {
 		} else if (_engine->_input->toggleActionIfActive(TwinEActionType::SpecialAction)) {
 			_actionNormal = true;
 		}
-	}
-
-	if (_engine->_input->isActionActive(TwinEActionType::ThrowMagicBall) && !_engine->_gameState->inventoryDisabled()) {
-		if (processAttackExecution(actorIdx)) {
-			_lastJoyFlag = true;
+		// MyFire & F_ALT
+		if (_engine->_input->isActionActive(TwinEActionType::ThrowMagicBall) && !_engine->_gameState->inventoryDisabled()) {
+			processAttackExecution(actorIdx);
 		}
 	}
 
diff --git a/engines/twine/shared.h b/engines/twine/shared.h
index a1636c8f89e..045b0f73dc9 100644
--- a/engines/twine/shared.h
+++ b/engines/twine/shared.h
@@ -648,7 +648,7 @@ enum class TextId : int16 {
 
 enum InventoryItems {
 	kiHolomap = 0,             // lba1/lba2
-	kiMagicBall = 1,           // lba1/lba2
+	kiMagicBall = 1,           // lba1/lba2 FLAG_BALLE_MAGIQUE
 	kiUseSabre = 2,            // lba1
 	kiDart = 2,                // lba2
 	kiGawleysHorn = 3,         // lba1
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 78912b5e46c..a4333a01a1d 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -781,10 +781,10 @@ void TwinEEngine::processInventoryAction() {
 		_screens->_flagFade = true;
 		break;
 	case kiMagicBall:
-		if (_gameState->_usingSabre) {
+		if (_gameState->_weapon) {
 			_actor->initBody(BodyType::btNormal, OWN_ACTOR_SCENE_INDEX);
 		}
-		_gameState->_usingSabre = false;
+		_gameState->_weapon = false;
 		break;
 	case kiUseSabre:
 		if (_scene->_sceneHero->_genBody != BodyType::btSabre) {
@@ -794,7 +794,7 @@ void TwinEEngine::processInventoryAction() {
 			_actor->initBody(BodyType::btSabre, OWN_ACTOR_SCENE_INDEX);
 			_animations->initAnim(AnimationTypes::kSabreUnknown, AnimType::kAnimationThen, AnimationTypes::kStanding, OWN_ACTOR_SCENE_INDEX);
 
-			_gameState->_usingSabre = true;
+			_gameState->_weapon = true;
 		}
 		break;
 	case kiBookOfBu: {


Commit: c51da2090bc20fb5e03939bae069a2bfbc798621
    https://github.com/scummvm/scummvm/commit/c51da2090bc20fb5e03939bae069a2bfbc798621
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2025-02-11T20:46:13+01:00

Commit Message:
TWINE: fixed segfault when restaring a game from the launcher a second time

the log watcher wasn't unregistered

Changed paths:
    engines/twine/debugger/debugtools.cpp


diff --git a/engines/twine/debugger/debugtools.cpp b/engines/twine/debugger/debugtools.cpp
index 3db98a5108d..151a81bdb4c 100644
--- a/engines/twine/debugger/debugtools.cpp
+++ b/engines/twine/debugger/debugtools.cpp
@@ -944,6 +944,7 @@ void onImGuiRender() {
 }
 
 void onImGuiCleanup() {
+	Common::setLogWatcher(nullptr);
 	delete _logger;
 	_logger = nullptr;
 }




More information about the Scummvm-git-logs mailing list