[Scummvm-git-logs] scummvm master -> 3109f2fcbc8515a92ffc6511be95a3483605330e

athrxx athrxx at scummvm.org
Thu Nov 5 19:43:57 UTC 2020


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:
7f2c31b090 KYRA: (HOF/Russian) - fix "New Game" string
3109f2fcbc KYRA: (HOF) - turn string decode parameter into bool


Commit: 7f2c31b090ebf9b48a4771dfa3ffc153bcbd2f48
    https://github.com/scummvm/scummvm/commit/7f2c31b090ebf9b48a4771dfa3ffc153bcbd2f48
Author: athrxx (athrxx at scummvm.org)
Date: 2020-11-05T20:43:20+01:00

Commit Message:
KYRA: (HOF/Russian) - fix "New Game" string

(related PR #2600)

Changed paths:
    engines/kyra/gui/gui_hof.cpp
    engines/kyra/gui/gui_hof.h
    engines/kyra/gui/gui_mr.cpp
    engines/kyra/gui/gui_mr.h
    engines/kyra/gui/gui_v2.cpp
    engines/kyra/gui/gui_v2.h


diff --git a/engines/kyra/gui/gui_hof.cpp b/engines/kyra/gui/gui_hof.cpp
index 76f0902e6f..1634939af2 100644
--- a/engines/kyra/gui/gui_hof.cpp
+++ b/engines/kyra/gui/gui_hof.cpp
@@ -104,8 +104,8 @@ const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) {
 	return _vm->getTableString(menuItem.labelId, _vm->_optionsBuffer, 1);
 }
 
-char *GUI_HoF::getTableString(int id) {
-	return _vm->getTableString(id, _vm->_optionsBuffer, 0);
+char *GUI_HoF::getTableString(int id, int decode) {
+	return _vm->getTableString(id, _vm->_optionsBuffer, decode);
 }
 
 #pragma mark -
diff --git a/engines/kyra/gui/gui_hof.h b/engines/kyra/gui/gui_hof.h
index 544f8cd15b..536bae708f 100644
--- a/engines/kyra/gui/gui_hof.h
+++ b/engines/kyra/gui/gui_hof.h
@@ -57,7 +57,7 @@ private:
 
 	void resetState(int item);
 
-	char *getTableString(int id) override;
+	char *getTableString(int id, int decode) override;
 
 	KyraEngine_HoF *_vm;
 	Screen_HoF *_screen;
diff --git a/engines/kyra/gui/gui_mr.cpp b/engines/kyra/gui/gui_mr.cpp
index 3798a098c8..c7a1bf1985 100644
--- a/engines/kyra/gui/gui_mr.cpp
+++ b/engines/kyra/gui/gui_mr.cpp
@@ -1083,7 +1083,7 @@ const char *GUI_MR::getMenuItemLabel(const MenuItem &menuItem) {
 	return (const char *)_vm->getTableEntry(_vm->_optionsFile, menuItem.labelId);
 }
 
-char *GUI_MR::getTableString(int id) {
+char *GUI_MR::getTableString(int id, int) {
 	return (char *)_vm->getTableEntry(_vm->_optionsFile, id);
 }
 
diff --git a/engines/kyra/gui/gui_mr.h b/engines/kyra/gui/gui_mr.h
index 2455cb9e3a..b4132ad17d 100644
--- a/engines/kyra/gui/gui_mr.h
+++ b/engines/kyra/gui/gui_mr.h
@@ -50,7 +50,7 @@ private:
 	const char *getMenuTitle(const Menu &menu) override;
 	const char *getMenuItemTitle(const MenuItem &menuItem) override;
 	const char *getMenuItemLabel(const MenuItem &menuItem) override;
-	char *getTableString(int id) override;
+	char *getTableString(int id, int) override;
 
 	uint8 textFieldColor1() const override { return 0xFF; }
 	uint8 textFieldColor2() const override { return 0xCF; }
diff --git a/engines/kyra/gui/gui_v2.cpp b/engines/kyra/gui/gui_v2.cpp
index c9a281f73e..c32f2b34db 100644
--- a/engines/kyra/gui/gui_v2.cpp
+++ b/engines/kyra/gui/gui_v2.cpp
@@ -471,7 +471,7 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
 			menu.item[0].enabled = true;
 		} else {
 			char *dst = getTableString(menu.item[0].itemId);
-			const char *src = getTableString(_vm->gameFlags().isTalkie ? 34 : 42);
+			const char *src = getTableString(_vm->gameFlags().isTalkie ? 34 : 42, _vm->gameFlags().lang == Common::RU_RUS ? 1 : 0);
 			strcpy(dst, src);
 		}
 	}
diff --git a/engines/kyra/gui/gui_v2.h b/engines/kyra/gui/gui_v2.h
index d667390786..4c1a57a72a 100644
--- a/engines/kyra/gui/gui_v2.h
+++ b/engines/kyra/gui/gui_v2.h
@@ -125,7 +125,7 @@ protected:
 	virtual void setupPalette() {}
 	virtual void restorePalette() {}
 
-	virtual char *getTableString(int id) = 0;
+	virtual char *getTableString(int id, int decode = 0) = 0;
 
 	virtual uint8 textFieldColor1() const = 0;
 	virtual uint8 textFieldColor2() const = 0;


Commit: 3109f2fcbc8515a92ffc6511be95a3483605330e
    https://github.com/scummvm/scummvm/commit/3109f2fcbc8515a92ffc6511be95a3483605330e
Author: athrxx (athrxx at scummvm.org)
Date: 2020-11-05T20:43:20+01:00

Commit Message:
KYRA: (HOF) - turn string decode parameter into bool

Changed paths:
    engines/kyra/engine/items_hof.cpp
    engines/kyra/engine/kyra_hof.cpp
    engines/kyra/engine/kyra_hof.h
    engines/kyra/gui/gui_hof.cpp
    engines/kyra/gui/gui_hof.h
    engines/kyra/gui/gui_mr.cpp
    engines/kyra/gui/gui_mr.h
    engines/kyra/gui/gui_v2.cpp
    engines/kyra/gui/gui_v2.h


diff --git a/engines/kyra/engine/items_hof.cpp b/engines/kyra/engine/items_hof.cpp
index dd53882cb9..1c2c331df9 100644
--- a/engines/kyra/engine/items_hof.cpp
+++ b/engines/kyra/engine/items_hof.cpp
@@ -207,7 +207,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
 			updateCharFacing();
 			snd_playSoundEffect(0x2D);
 			removeHandItem();
-			objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
+			objectChat(getTableString(0xFF, _cCodeBuffer, true), 0, 0x83, 0xFF);
 		} else {
 			_itemList[itemSlot].x = dstX;
 			_itemList[itemSlot].y = dstY;
@@ -286,7 +286,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
 			snd_playSoundEffect(0x2D);
 			removeHandItem();
 			_screen->showMouse();
-			objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
+			objectChat(getTableString(0xFF, _cCodeBuffer, true), 0, 0x83, 0xFF);
 		} else {
 			_itemList[itemSlot].x = dstX;
 			_itemList[itemSlot].y = dstY;
diff --git a/engines/kyra/engine/kyra_hof.cpp b/engines/kyra/engine/kyra_hof.cpp
index 043d35b9d7..2d83d5eccd 100644
--- a/engines/kyra/engine/kyra_hof.cpp
+++ b/engines/kyra/engine/kyra_hof.cpp
@@ -431,12 +431,12 @@ void KyraEngine_HoF::runLoop() {
 			if (_mainCharacter.sceneId == 34) {
 				if (queryGameFlag(0xD1)) {
 					initTalkObject(28);
-					npcChatSequence(getTableString(0xFA, _cCodeBuffer, 1), 28, 0x83, 0xFA);
+					npcChatSequence(getTableString(0xFA, _cCodeBuffer, true), 28, 0x83, 0xFA);
 					deinitTalkObject(28);
 					enterNewScene(35, 4, 0, 0, 0);
 				} else if (queryGameFlag(0xD0)) {
 					initTalkObject(29);
-					npcChatSequence(getTableString(0xFB, _cCodeBuffer, 1), 29, 0x83, 0xFB);
+					npcChatSequence(getTableString(0xFB, _cCodeBuffer, true), 29, 0x83, 0xFB);
 					deinitTalkObject(29);
 					enterNewScene(33, 6, 0, 0, 0);
 				}
@@ -570,7 +570,7 @@ bool KyraEngine_HoF::handleInputUnkSub(int x, int y) {
 
 	if (_mouseState <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) {
 		updateCharFacing();
-		objectChat(getTableString(0xFC, _cCodeBuffer, 1), 0, 0x83, 0xFC);
+		objectChat(getTableString(0xFC, _cCodeBuffer, true), 0, 0x83, 0xFC);
 		return true;
 	} else {
 		_emc->init(&_sceneScriptState, &_sceneScriptData);
@@ -821,7 +821,7 @@ uint8 *KyraEngine_HoF::getTableEntry(uint8 *buffer, int id) {
 	return buffer + READ_LE_UINT16(buffer + (id<<1));
 }
 
-char *KyraEngine_HoF::getTableString(int id, uint8 *buffer, int decode) {
+char *KyraEngine_HoF::getTableString(int id, uint8 *buffer, bool decode) {
 	char *string = (char *)getTableEntry(buffer, id);
 
 	if (decode && _flags.lang != Common::JA_JPN) {
@@ -843,7 +843,7 @@ const char *KyraEngine_HoF::getChapterString(int id) {
 #pragma mark -
 
 void KyraEngine_HoF::showMessageFromCCode(int id, int16 palIndex, int) {
-	const char *string = getTableString(id, _cCodeBuffer, 1);
+	const char *string = getTableString(id, _cCodeBuffer, true);
 	showMessage(string, palIndex);
 }
 
@@ -876,7 +876,7 @@ void KyraEngine_HoF::updateCommandLineEx(int str1, int str2, int16 palIndex) {
 	char buffer[0x51];
 	char *src = buffer;
 
-	strcpy(src, getTableString(str1, _cCodeBuffer, 1));
+	strcpy(src, getTableString(str1, _cCodeBuffer, true));
 
 	if (_flags.lang != Common::JA_JPN) {
 		while (*src != 0x20)
@@ -890,7 +890,7 @@ void KyraEngine_HoF::updateCommandLineEx(int str1, int str2, int16 palIndex) {
 	if (str2 > 0) {
 		if (_flags.lang != Common::JA_JPN)
 			strcat((char *)_unkBuf500Bytes, " ");
-		strcat((char *)_unkBuf500Bytes, getTableString(str2, _cCodeBuffer, 1));
+		strcat((char *)_unkBuf500Bytes, getTableString(str2, _cCodeBuffer, true));
 	}
 
 	showMessage((char *)_unkBuf500Bytes, palIndex);
@@ -1144,7 +1144,7 @@ int KyraEngine_HoF::inputSceneChange(int x, int y, int unk1, int unk2) {
 
 	if (strId) {
 		updateCharFacing();
-		objectChat(getTableString(strId, _cCodeBuffer, 1), 0, vocH, strId);
+		objectChat(getTableString(strId, _cCodeBuffer, true), 0, vocH, strId);
 		_pathfinderFlag = 0;
 		return 0;
 	}
@@ -1175,13 +1175,13 @@ int KyraEngine_HoF::inputSceneChange(int x, int y, int unk1, int unk2) {
 			_deathHandler = 7;
 			snd_playWanderScoreViaMap(0x53, 1);
 		} else {
-			objectChat(getTableString(0xFD, _cCodeBuffer, 1), 0, 0x83, 0xFD);
+			objectChat(getTableString(0xFD, _cCodeBuffer, true), 0, 0x83, 0xFD);
 			setGameFlag(0x164);
 			_timer->enable(5);
 			_timer->setCountdown(5, 120);
 		}
 	} else if (queryGameFlag(0x164)) {
-		objectChat(getTableString(0xFE, _cCodeBuffer, 1), 0, 0x83, 0xFE);
+		objectChat(getTableString(0xFE, _cCodeBuffer, true), 0, 0x83, 0xFE);
 		resetGameFlag(0x164);
 		_timer->disable(5);
 	}
@@ -1774,7 +1774,7 @@ bool KyraEngine_HoF::updateCauldron() {
 			showMessage(0, 0xCF);
 			setCauldronState(cauldronState, true);
 			if (cauldronState == 7)
-				objectChat(getTableString(0xF2, _cCodeBuffer, 1), 0, 0x83, 0xF2);
+				objectChat(getTableString(0xF2, _cCodeBuffer, true), 0, 0x83, 0xF2);
 			clearCauldronTable();
 			return true;
 		}
@@ -1825,16 +1825,16 @@ void KyraEngine_HoF::listItemsInCauldron() {
 
 	if (!itemsInCauldron) {
 		if (!_cauldronState)
-			objectChat(getTableString(0xF4, _cCodeBuffer, 1), 0, 0x83, 0xF4);
+			objectChat(getTableString(0xF4, _cCodeBuffer, true), 0, 0x83, 0xF4);
 		else
-			objectChat(getTableString(0xF3, _cCodeBuffer, 1), 0, 0x83, 0xF3);
+			objectChat(getTableString(0xF3, _cCodeBuffer, true), 0, 0x83, 0xF3);
 	} else {
-		objectChat(getTableString(0xF7, _cCodeBuffer, 1), 0, 0x83, 0xF7);
+		objectChat(getTableString(0xF7, _cCodeBuffer, true), 0, 0x83, 0xF7);
 
 		char buffer[80];
 		for (int i = 0; i < itemsInCauldron-1; ++i) {
 			char *str = buffer;
-			strcpy(str, getTableString(_cauldronTable[i]+54, _cCodeBuffer, 1));
+			strcpy(str, getTableString(_cauldronTable[i]+54, _cCodeBuffer, true));
 			if (_lang == 1) {
 				if (*str == 37)
 					str += 2;
@@ -1846,7 +1846,7 @@ void KyraEngine_HoF::listItemsInCauldron() {
 		}
 
 		char *str = buffer;
-		strcpy(str, getTableString(_cauldronTable[itemsInCauldron-1]+54, _cCodeBuffer, 1));
+		strcpy(str, getTableString(_cauldronTable[itemsInCauldron-1]+54, _cCodeBuffer, true));
 		if (_lang == 1) {
 			if (*str == 37)
 				str += 2;
diff --git a/engines/kyra/engine/kyra_hof.h b/engines/kyra/engine/kyra_hof.h
index 4227fc8082..bc5f94c5a2 100644
--- a/engines/kyra/engine/kyra_hof.h
+++ b/engines/kyra/engine/kyra_hof.h
@@ -333,7 +333,7 @@ protected:
 	int _newChapterFile;
 
 	uint8 *getTableEntry(uint8 *buffer, int id);
-	char *getTableString(int id, uint8 *buffer, int decode);
+	char *getTableString(int id, uint8 *buffer, bool decode);
 	const char *getChapterString(int id);
 
 	void changeFileExtension(char *buffer);
diff --git a/engines/kyra/gui/gui_hof.cpp b/engines/kyra/gui/gui_hof.cpp
index 1634939af2..ebfb133006 100644
--- a/engines/kyra/gui/gui_hof.cpp
+++ b/engines/kyra/gui/gui_hof.cpp
@@ -83,7 +83,7 @@ const char *GUI_HoF::getMenuTitle(const Menu &menu) {
 	if (!menu.menuNameId)
 		return 0;
 
-	return _vm->getTableString(menu.menuNameId, _vm->_optionsBuffer, 1);
+	return _vm->getTableString(menu.menuNameId, _vm->_optionsBuffer, true);
 }
 
 const char *GUI_HoF::getMenuItemTitle(const MenuItem &menuItem) {
@@ -92,9 +92,9 @@ const char *GUI_HoF::getMenuItemTitle(const MenuItem &menuItem) {
 
 	// Strings 41-45 are menu labels, those must be handled uncompressed!
 	if (menuItem.itemId >= 41 && menuItem.itemId <= 45)
-		return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 0);
+		return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, false);
 	else
-		return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1);
+		return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, true);
 }
 
 const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) {
@@ -104,7 +104,7 @@ const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) {
 	return _vm->getTableString(menuItem.labelId, _vm->_optionsBuffer, 1);
 }
 
-char *GUI_HoF::getTableString(int id, int decode) {
+char *GUI_HoF::getTableString(int id, bool decode) {
 	return _vm->getTableString(id, _vm->_optionsBuffer, decode);
 }
 
@@ -293,7 +293,7 @@ void KyraEngine_HoF::scrollInventoryWheel() {
 
 int KyraEngine_HoF::bookButton(Button *button) {
 	if (!queryGameFlag(1)) {
-		objectChat(getTableString(0xEB, _cCodeBuffer, 1), 0, 0x83, 0xEB);
+		objectChat(getTableString(0xEB, _cCodeBuffer, true), 0, 0x83, 0xEB);
 		return 0;
 	}
 
@@ -368,10 +368,10 @@ int KyraEngine_HoF::bookButton(Button *button) {
 	_screen->showMouse();
 
 	if (!queryGameFlag(4) && !queryGameFlag(0xB8)) {
-		objectChat(getTableString(0xEC, _cCodeBuffer, 1), 0, 0x83, 0xEC);
-		objectChat(getTableString(0xED, _cCodeBuffer, 1), 0, 0x83, 0xED);
-		objectChat(getTableString(0xEE, _cCodeBuffer, 1), 0, 0x83, 0xEE);
-		objectChat(getTableString(0xEF, _cCodeBuffer, 1), 0, 0x83, 0xEF);
+		objectChat(getTableString(0xEC, _cCodeBuffer, true), 0, 0x83, 0xEC);
+		objectChat(getTableString(0xED, _cCodeBuffer, true), 0, 0x83, 0xED);
+		objectChat(getTableString(0xEE, _cCodeBuffer, true), 0, 0x83, 0xEE);
+		objectChat(getTableString(0xEF, _cCodeBuffer, true), 0, 0x83, 0xEF);
 		setGameFlag(4);
 	}
 
@@ -548,7 +548,7 @@ int KyraEngine_HoF::bookClose(Button *button) {
 int KyraEngine_HoF::cauldronClearButton(Button *button) {
 	if (!queryGameFlag(2)) {
 		updateCharFacing();
-		objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
+		objectChat(getTableString(0xF0, _cCodeBuffer, true), 0, 0x83, 0xF0);
 		return 0;
 	}
 
@@ -573,7 +573,7 @@ int KyraEngine_HoF::cauldronClearButton(Button *button) {
 
 int KyraEngine_HoF::cauldronButton(Button *button) {
 	if (!queryGameFlag(2)) {
-		objectChat(getTableString(0xF0, _cCodeBuffer, 1), 0, 0x83, 0xF0);
+		objectChat(getTableString(0xF0, _cCodeBuffer, true), 0, 0x83, 0xF0);
 		return 0;
 	}
 
diff --git a/engines/kyra/gui/gui_hof.h b/engines/kyra/gui/gui_hof.h
index 536bae708f..144ea65a5e 100644
--- a/engines/kyra/gui/gui_hof.h
+++ b/engines/kyra/gui/gui_hof.h
@@ -57,7 +57,7 @@ private:
 
 	void resetState(int item);
 
-	char *getTableString(int id, int decode) override;
+	char *getTableString(int id, bool decode) override;
 
 	KyraEngine_HoF *_vm;
 	Screen_HoF *_screen;
diff --git a/engines/kyra/gui/gui_mr.cpp b/engines/kyra/gui/gui_mr.cpp
index c7a1bf1985..7f06941e42 100644
--- a/engines/kyra/gui/gui_mr.cpp
+++ b/engines/kyra/gui/gui_mr.cpp
@@ -1083,7 +1083,7 @@ const char *GUI_MR::getMenuItemLabel(const MenuItem &menuItem) {
 	return (const char *)_vm->getTableEntry(_vm->_optionsFile, menuItem.labelId);
 }
 
-char *GUI_MR::getTableString(int id, int) {
+char *GUI_MR::getTableString(int id, bool) {
 	return (char *)_vm->getTableEntry(_vm->_optionsFile, id);
 }
 
diff --git a/engines/kyra/gui/gui_mr.h b/engines/kyra/gui/gui_mr.h
index b4132ad17d..63cfc5d05f 100644
--- a/engines/kyra/gui/gui_mr.h
+++ b/engines/kyra/gui/gui_mr.h
@@ -50,7 +50,7 @@ private:
 	const char *getMenuTitle(const Menu &menu) override;
 	const char *getMenuItemTitle(const MenuItem &menuItem) override;
 	const char *getMenuItemLabel(const MenuItem &menuItem) override;
-	char *getTableString(int id, int) override;
+	char *getTableString(int id, bool) override;
 
 	uint8 textFieldColor1() const override { return 0xFF; }
 	uint8 textFieldColor2() const override { return 0xCF; }
diff --git a/engines/kyra/gui/gui_v2.cpp b/engines/kyra/gui/gui_v2.cpp
index c32f2b34db..59f2b6cf20 100644
--- a/engines/kyra/gui/gui_v2.cpp
+++ b/engines/kyra/gui/gui_v2.cpp
@@ -471,7 +471,7 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
 			menu.item[0].enabled = true;
 		} else {
 			char *dst = getTableString(menu.item[0].itemId);
-			const char *src = getTableString(_vm->gameFlags().isTalkie ? 34 : 42, _vm->gameFlags().lang == Common::RU_RUS ? 1 : 0);
+			const char *src = getTableString(_vm->gameFlags().isTalkie ? 34 : 42, _vm->gameFlags().lang == Common::RU_RUS);
 			strcpy(dst, src);
 		}
 	}
diff --git a/engines/kyra/gui/gui_v2.h b/engines/kyra/gui/gui_v2.h
index 4c1a57a72a..d8b7c823d3 100644
--- a/engines/kyra/gui/gui_v2.h
+++ b/engines/kyra/gui/gui_v2.h
@@ -125,7 +125,7 @@ protected:
 	virtual void setupPalette() {}
 	virtual void restorePalette() {}
 
-	virtual char *getTableString(int id, int decode = 0) = 0;
+	virtual char *getTableString(int id, bool decode = false) = 0;
 
 	virtual uint8 textFieldColor1() const = 0;
 	virtual uint8 textFieldColor2() const = 0;




More information about the Scummvm-git-logs mailing list