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

mgerhardy martin.gerhardy at gmail.com
Wed Apr 28 17:08:40 UTC 2021


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:
c7ceb328e3 TWINE: reduced visibility
bf47cb2d24 TWINE: fixed missing custom texts in options menu


Commit: c7ceb328e3cea94676a695999bb74c8f96d35bfa
    https://github.com/scummvm/scummvm/commit/c7ceb328e3cea94676a695999bb74c8f96d35bfa
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-04-28T19:06:09+02:00

Commit Message:
TWINE: reduced visibility

Changed paths:
    engines/twine/twine.h


diff --git a/engines/twine/twine.h b/engines/twine/twine.h
index b095894e61..0b2989a385 100644
--- a/engines/twine/twine.h
+++ b/engines/twine/twine.h
@@ -191,6 +191,12 @@ private:
 	EngineState _state = EngineState::Menu;
 	Common::String _queuedFlaMovie;
 
+	ScriptLife *_scriptLife;
+	ScriptMove *_scriptMove;
+
+	Common::RandomSource _rnd;
+	Common::Language _gameLang;
+
 	void processBookOfBu();
 	void processBonusList();
 	void processInventoryAction();
@@ -203,6 +209,12 @@ private:
 	void processActorSamplePosition(int32 actorIdx);
 	/** Allocate video memory, both front and back buffers */
 	void allocVideoMemory(int32 w, int32 h);
+
+	/**
+	 * Game engine main loop
+	 * @return true if we want to show credit sequence
+	 */
+	int32 runGameEngine();
 public:
 	TwinEEngine(OSystem *system, Common::Language language, uint32 flagsTwineGameType, TwineGameType gameType);
 	~TwinEEngine() override;
@@ -247,8 +259,6 @@ public:
 	Resources *_resources;
 	Scene *_scene;
 	Screens *_screens;
-	ScriptLife *_scriptLife;
-	ScriptMove *_scriptMove;
 	Holomap *_holomap;
 	Sound *_sound;
 	Text *_text;
@@ -271,11 +281,6 @@ public:
 
 	void queueMovie(const char *filename);
 
-	/**
-	 * Game engine main loop
-	 * @return true if we want to show credit sequence
-	 */
-	int32 runGameEngine();
 	/**
 	 * @return A random value between [0-max)
 	 */
@@ -304,8 +309,6 @@ public:
 	 */
 	bool gameEngineLoop();
 
-	Common::RandomSource _rnd;
-	Common::Language _gameLang;
 	uint32 _gameFlags;
 
 	/**


Commit: bf47cb2d2433d44d7ecbee91c412c5b037b139e4
    https://github.com/scummvm/scummvm/commit/bf47cb2d2433d44d7ecbee91c412c5b037b139e4
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-04-28T19:06:10+02:00

Commit Message:
TWINE: fixed missing custom texts in options menu

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 9f534e354d..6aebc80688 100644
--- a/engines/twine/parser/text.cpp
+++ b/engines/twine/parser/text.cpp
@@ -25,15 +25,17 @@
 #include "common/util.h"
 #include "common/translation.h"
 #include "twine/resources/hqr.h"
+#include "twine/shared.h"
 
 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});
+void TextData::initCustomTexts(TextBankId textBankId) {
+	if (textBankId == TextBankId::Options_and_menus) {
+		add(textBankId, TextEntry{_sc("High resolution on", "Options menu"), -1, TextId::kCustomHighResOptionOn});
+		add(textBankId, TextEntry{_sc("High resolution off", "Options menu"), -1, TextId::kCustomHighResOptionOff});
+		add(textBankId, TextEntry{_sc("Wall collision on", "Options menu"), -1, TextId::kCustomWallCollisionOn});
+		add(textBankId, TextEntry{_sc("Wall collision off", "Options menu"), -1, TextId::kCustomWallCollisionOff});
+	}
 }
 
 bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language, int entryCount) {
@@ -48,9 +50,10 @@ bool TextData::loadFromHQR(const char *name, TextBankId textBankId, int language
 	}
 
 	_texts[(int)textBankId].clear();
+	initCustomTexts(textBankId);
 
 	const int numIdxEntries = indexStream->size() / 2;
-	_texts[(int)textBankId].reserve(numIdxEntries);
+	_texts[(int)textBankId].reserve(numIdxEntries + _texts[(int)textBankId].size());
 
 	for (int entry = 0; entry < numIdxEntries; ++entry) {
 		const TextId textIdx = (TextId)indexStream->readUint16LE();
diff --git a/engines/twine/parser/text.h b/engines/twine/parser/text.h
index 2addc50005..899f63e16b 100644
--- a/engines/twine/parser/text.h
+++ b/engines/twine/parser/text.h
@@ -45,8 +45,10 @@ private:
 	void add(TextBankId textBankId, const TextEntry &entry) {
 		_texts[(int)textBankId].push_back(entry);
 	}
+
+	// custom texts that are not included in the original game
+	void initCustomTexts(TextBankId textBankId);
 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