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

mgerhardy martin.gerhardy at gmail.com
Fri Apr 9 14:56:26 UTC 2021


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ea772ddac4 TWINE: don't start the credits sequence if you are changing the volume settings
f95d09f7f2 TWINE: allow to list other text bank strings
fcb5e5d656 TWINE: don't push the custom text on each reload of the text data


Commit: ea772ddac48aca9aa8945b103eddfbab0bca5af6
    https://github.com/scummvm/scummvm/commit/ea772ddac48aca9aa8945b103eddfbab0bca5af6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-04-09T16:32:40+02:00

Commit Message:
TWINE: don't start the credits sequence if you are changing the volume settings

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


diff --git a/engines/twine/menu/menu.cpp b/engines/twine/menu/menu.cpp
index 465660252e..0ae1590a86 100644
--- a/engines/twine/menu/menu.cpp
+++ b/engines/twine/menu/menu.cpp
@@ -454,41 +454,49 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 			case MenuButtonTypes::kAggressiveMode:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft) || _engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					_engine->_actor->autoAggressive = !_engine->_actor->autoAggressive;
+					startMillis = loopMillis;
 				}
 				break;
 			case MenuButtonTypes::kPolygonDetails:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft)) {
 					_engine->cfgfile.PolygonDetails--;
 					_engine->cfgfile.PolygonDetails %= 3;
+					startMillis = loopMillis;
 				} else if (_engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					_engine->cfgfile.PolygonDetails++;
 					_engine->cfgfile.PolygonDetails %= 3;
+					startMillis = loopMillis;
 				}
 				break;
 			case MenuButtonTypes::kShadowSettings:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft)) {
 					_engine->cfgfile.ShadowMode--;
 					_engine->cfgfile.ShadowMode %= 3;
+					startMillis = loopMillis;
 				} else if (_engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					_engine->cfgfile.ShadowMode++;
 					_engine->cfgfile.ShadowMode %= 3;
+					startMillis = loopMillis;
 				}
 				break;
 			case MenuButtonTypes::kSceneryZoom:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft) || _engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					_engine->cfgfile.SceZoom = !_engine->cfgfile.SceZoom;
+					startMillis = loopMillis;
 				}
 				break;
 			case MenuButtonTypes::kHighResolution:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft) || _engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					const bool highRes = ConfMan.getBool("usehighres");
 					ConfMan.setBool("usehighres", !highRes);
+					startMillis = loopMillis;
 				}
 				break;
 			case MenuButtonTypes::kWallCollision:
 				if (_engine->_input->toggleActionIfActive(TwinEActionType::UILeft) || _engine->_input->toggleActionIfActive(TwinEActionType::UIRight) || _engine->_input->toggleActionIfActive(TwinEActionType::UIEnter)) {
 					const bool highRes = ConfMan.getBool("wallcollision");
 					ConfMan.setBool("wallcollision", !highRes);
+					startMillis = loopMillis;
 				}
 				break;
 			default:
@@ -501,8 +509,10 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 				int volume = mixer->getVolumeForSoundType(Audio::Mixer::SoundType::kMusicSoundType);
 				if (_engine->_input->isActionActive(TwinEActionType::UILeft)) {
 					volume -= 4;
+					startMillis = loopMillis;
 				} else if (_engine->_input->isActionActive(TwinEActionType::UIRight)) {
 					volume += 4;
+					startMillis = loopMillis;
 				}
 				_engine->_music->musicVolume(volume);
 				ConfMan.setInt("music_volume", mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType));
@@ -512,8 +522,10 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 				int volume = mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
 				if (_engine->_input->isActionActive(TwinEActionType::UILeft)) {
 					volume -= 4;
+					startMillis = loopMillis;
 				} else if (_engine->_input->isActionActive(TwinEActionType::UIRight)) {
 					volume += 4;
+					startMillis = loopMillis;
 				}
 
 				mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, volume);
@@ -524,8 +536,10 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 				AudioCDManager::Status status = _engine->_system->getAudioCDManager()->getStatus();
 				if (_engine->_input->isActionActive(TwinEActionType::UILeft)) {
 					status.volume -= 4;
+					startMillis = loopMillis;
 				} else if (_engine->_input->isActionActive(TwinEActionType::UIRight)) {
 					status.volume += 4;
+					startMillis = loopMillis;
 				}
 				status.volume = CLIP(status.volume, 0, 255);
 				_engine->_system->getAudioCDManager()->setVolume(status.volume);
@@ -535,8 +549,10 @@ int32 Menu::processMenu(MenuSettings *menuSettings, bool showCredits) {
 				int volume = mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType);
 				if (_engine->_input->isActionActive(TwinEActionType::UILeft)) {
 					volume -= 4;
+					startMillis = loopMillis;
 				} else if (_engine->_input->isActionActive(TwinEActionType::UIRight)) {
 					volume += 4;
+					startMillis = loopMillis;
 				}
 				mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume);
 				ConfMan.setInt("speech_volume", mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType));


Commit: f95d09f7f24c3ef3718f28e0db082842c4da996c
    https://github.com/scummvm/scummvm/commit/f95d09f7f24c3ef3718f28e0db082842c4da996c
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-04-09T16:44:13+02:00

Commit Message:
TWINE: allow to list other text bank strings

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


diff --git a/engines/twine/debugger/console.cpp b/engines/twine/debugger/console.cpp
index 0021635343..3911c794f5 100644
--- a/engines/twine/debugger/console.cpp
+++ b/engines/twine/debugger/console.cpp
@@ -301,13 +301,19 @@ bool TwinEConsole::doToggleDebug(int argc, const char **argv) {
 }
 
 bool TwinEConsole::doListMenuText(int argc, const char **argv) {
-	_engine->_text->initTextBank(TextBankId::Inventory_Intro_and_Holomap);
+	TextBankId textBankId = TextBankId::Inventory_Intro_and_Holomap;
+	if (argc >= 2) {
+		textBankId = (TextBankId)atoi(argv[1]);
+	}
+	const TextBankId oldTextBankId = _engine->_text->textBank();
+	_engine->_text->initTextBank(textBankId);
 	for (int32 i = 0; i < 1000; ++i) {
 		char buf[256];
 		if (_engine->_text->getMenuText((TextId)i, buf, sizeof(buf))) {
 			debugPrintf("%4i: %s\n", i, buf);
 		}
 	}
+	_engine->_text->initTextBank(oldTextBankId);
 	return true;
 }
 


Commit: fcb5e5d6568064d6b96bc819f44d785a3b44a679
    https://github.com/scummvm/scummvm/commit/fcb5e5d6568064d6b96bc819f44d785a3b44a679
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-04-09T16:50:47+02:00

Commit Message:
TWINE: don't push the custom text on each reload of the text data

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


diff --git a/engines/twine/parser/text.cpp b/engines/twine/parser/text.cpp
index d55a9cd065..9f534e354d 100644
--- a/engines/twine/parser/text.cpp
+++ b/engines/twine/parser/text.cpp
@@ -28,6 +28,14 @@
 
 namespace TwinE {
 
+TextData::TextData() {
+	// custom texts that are not included in the original game
+	add(TextBankId::Options_and_menus, TextEntry{_sc("High resolution on", "Options menu"), -1, TextId::kCustomHighResOptionOn});
+	add(TextBankId::Options_and_menus, TextEntry{_sc("High resolution off", "Options menu"), -1, TextId::kCustomHighResOptionOff});
+	add(TextBankId::Options_and_menus, TextEntry{_sc("Wall collision on", "Options menu"), -1, TextId::kCustomWallCollisionOn});
+	add(TextBankId::Options_and_menus, TextEntry{_sc("Wall collision off", "Options menu"), -1, TextId::kCustomWallCollisionOff});
+}
+
 bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language, int entryCount) {
 	const int langIdx = (int)textBankId * 2 + (entryCount * language);
 	Common::SeekableReadStream *indexStream = HQR::makeReadStream(name, langIdx + 0);
@@ -55,7 +63,7 @@ bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language
 			const char c = (char)offsetStream->readByte();
 			result += c;
 		}
-		_texts[(int)textBankId].push_back(TextEntry{result, entry, textIdx});
+		add(textBankId, TextEntry{result, entry, textIdx});
 		debug(5, "index: %i (bank %i), text: %s", (int)textIdx, (int)textBankId, result.c_str());
 		offsetStream->seek(offsetPos);
 		if (end >= offsetStream->size()) {
@@ -65,12 +73,6 @@ bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language
 	delete indexStream;
 	delete offsetStream;
 
-	// custom texts that are not included in the original game
-	_texts[(int)TextBankId::Options_and_menus].push_back(TextEntry{_sc("High resolution on", "Options menu"), -1, TextId::kCustomHighResOptionOn});
-	_texts[(int)TextBankId::Options_and_menus].push_back(TextEntry{_sc("High resolution off", "Options menu"), -1, TextId::kCustomHighResOptionOff});
-	_texts[(int)TextBankId::Options_and_menus].push_back(TextEntry{_sc("Wall collision on", "Options menu"), -1, TextId::kCustomWallCollisionOn});
-	_texts[(int)TextBankId::Options_and_menus].push_back(TextEntry{_sc("Wall collision off", "Options menu"), -1, TextId::kCustomWallCollisionOff});
-
 	return true;
 }
 
diff --git a/engines/twine/parser/text.h b/engines/twine/parser/text.h
index cd60462c25..2addc50005 100644
--- a/engines/twine/parser/text.h
+++ b/engines/twine/parser/text.h
@@ -42,7 +42,11 @@ class TextData {
 private:
 	// 30 is the max for lba2, lba1 uses 28
 	Common::Array<TextEntry> _texts[30];
+	void add(TextBankId textBankId, const TextEntry &entry) {
+		_texts[(int)textBankId].push_back(entry);
+	}
 public:
+	TextData();
 	bool loadFromHQR(const char *name, TextBankId textBankId, int language, int entryCount);
 
 	const TextEntry *getText(TextBankId textBankId, TextId textIndex) const;




More information about the Scummvm-git-logs mailing list