[Scummvm-git-logs] scummvm master -> 4aa78f28b3610ff1875a99e9bbe7a417ee4b723a

athrxx athrxx at scummvm.org
Sat Jul 10 20:41:36 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:
6b92b3a0b3 KYRA: (EOB/SegaCD/Jp) - fix save description encoding
4aa78f28b3 SCUMM: remove leftover debug message


Commit: 6b92b3a0b3302c55dfbfc647dd22a76343af955e
    https://github.com/scummvm/scummvm/commit/6b92b3a0b3302c55dfbfc647dd22a76343af955e
Author: athrxx (athrxx at scummvm.org)
Date: 2021-07-10T22:40:52+02:00

Commit Message:
KYRA: (EOB/SegaCD/Jp) - fix save description encoding

The auto-generated save descriptions with their weird encoding are now properly displayed in the ingame menu.

The save descriptions from the GMM save dialog are converted to upper case so that they can be displayed in the ingame menu, since the Japanese font has only upper case Ascii glyphs.

Changed paths:
    engines/kyra/gui/gui.cpp
    engines/kyra/gui/gui_eob.cpp
    engines/kyra/gui/gui_eob_segacd.cpp


diff --git a/engines/kyra/gui/gui.cpp b/engines/kyra/gui/gui.cpp
index dfceee86ea..6ca0819bea 100644
--- a/engines/kyra/gui/gui.cpp
+++ b/engines/kyra/gui/gui.cpp
@@ -118,7 +118,10 @@ void GUI::updateSaveSlotsList(Common::String targetName, bool force) {
 			if (in) {
 				*listEntry = new char[header.description.size() + 1];
 				Common::strlcpy(*listEntry, header.description.c_str(), header.description.size() + 1);
-				Util::convertISOToDOS(*listEntry);
+				// Ingame auto-generated Japanese EOB SegaCD savegame descriptions have a special 1-byte encoding that
+				// does not survive this conversion. And the rest of the characters in these descriptions do not require it.
+				if (!(_vm->gameFlags().platform == Common::kPlatformSegaCD && _vm->gameFlags().lang == Common::JA_JPN && Common::String(*listEntry).contains('\r')))
+					Util::convertISOToDOS(*listEntry);
 				delete in;
 			} else {
 				*listEntry = 0;
diff --git a/engines/kyra/gui/gui_eob.cpp b/engines/kyra/gui/gui_eob.cpp
index 59e8cb1911..7c30d53132 100644
--- a/engines/kyra/gui/gui_eob.cpp
+++ b/engines/kyra/gui/gui_eob.cpp
@@ -3187,7 +3187,13 @@ bool GUI_EoB::runSaveMenu(int x, int y) {
 
 			Graphics::Surface thumb;
 			createScreenThumbnail(thumb);
-			Common::Error err = _vm->saveGameStateIntern(_savegameOffset + slot, _saveSlotStringsTemp[slot], &thumb);
+			char temp[26];
+			Common::strlcpy(temp, _saveSlotStringsTemp[slot], 26);
+			// Ingame auto-generated Japanese EOB SegaCD savegame descriptions have a special 1-byte encoding that
+			// does not survive this conversion. And the rest of the characters in these descriptions do not require it.
+			if (!(_vm->gameFlags().platform == Common::kPlatformSegaCD && _vm->gameFlags().lang == Common::JA_JPN && Common::String(temp).contains('\r')))
+				Util::convertDOSToISO(temp);
+			Common::Error err = _vm->saveGameStateIntern(_savegameOffset + slot, temp, &thumb);
 			thumb.free();
 
 			if (err.getCode() == Common::kNoError)
diff --git a/engines/kyra/gui/gui_eob_segacd.cpp b/engines/kyra/gui/gui_eob_segacd.cpp
index d0825e5355..eaf6757d57 100644
--- a/engines/kyra/gui/gui_eob_segacd.cpp
+++ b/engines/kyra/gui/gui_eob_segacd.cpp
@@ -868,7 +868,32 @@ void GUI_EoB_SegaCD::drawSaveSlotButton(int slot, int redrawBox, bool highlight)
 
 	_screen->sega_getRenderer()->fillRectWithTiles(0, (_saveSlotX >> 3) + (_saveSlotX ? 1 : 2), (_saveSlotY >> 3) + (_saveSlotY ? 6 : 7) + (slot << 1), 3, 2, 0x41E7 + slot * 12 + (redrawBox == 2 ? 6 : 0), true);
 	_screen->sega_clearTextBuffer(0);
-	_vm->_txt->printShadedText(slot < 5 ? _saveSlotStringsTemp[slot] : _vm->_saveLoadStrings[0], 0, (slot << 4) + (slot < 5 ? 0 : 2), highlight ? 0x55 : 0xFF, 0xCC, 121, 80, 0, false);
+	Common::String s1;
+	Common::String s2(slot < 5 ? _saveSlotStringsTemp[slot] : _vm->_saveLoadStrings[0]);
+
+	if (_vm->gameFlags().lang == Common::JA_JPN) {
+		if (s2.contains('\r')) {
+			// Savegame generated from ingame menu. The first part of the auto-generated save description (character name)
+			// is not a 2-byte encoding, but rather a special 1-byte encoding. We cut that part off and print it separately,
+			// since we have to notify the glyph renderer of the special encoding.
+			uint len = s2.findFirstOf('\r');
+			s1 = s2.substr(0, len);
+			s2.erase(0, len);
+			while (len--)
+				s2.insertChar(' ', 0);
+		} else {
+			// Savegame generated via the GMM save dialog. The Japanese font only has upper case ASCII glyphs, so we have to uppercase the string.
+			s2.toUppercase();
+		}		
+	}
+
+	_vm->_txt->printShadedText(s2.c_str(), 0, (slot << 4) + (slot < 5 ? 0 : 2), highlight ? 0x55 : 0xFF, 0xCC, 121, 80, 0, false);
+	if (!s1.empty()) {
+		int cs = _screen->setFontStyles(_screen->_currentFont, Font::kStyleForceOneByte);
+		_vm->_txt->printShadedText(s1.c_str(), 0, (slot << 4) + (slot < 5 ? 0 : 2), highlight ? 0x55 : 0xFF, 0xCC, 121, 80, 0, false);
+		_screen->setFontStyles(_screen->_currentFont, cs);
+	}
+
 	_screen->sega_loadTextBufferToVRAM(0, 0x5560, 4800);
 	_screen->sega_getRenderer()->render(0, (_saveSlotX >> 3) + (_saveSlotX ? 1 : 2), (_saveSlotY >> 3) + (_saveSlotY ? 6 : 7) + (slot << 1), 21, 2);
 }


Commit: 4aa78f28b3610ff1875a99e9bbe7a417ee4b723a
    https://github.com/scummvm/scummvm/commit/4aa78f28b3610ff1875a99e9bbe7a417ee4b723a
Author: athrxx (athrxx at scummvm.org)
Date: 2021-07-10T22:41:05+02:00

Commit Message:
SCUMM: remove leftover debug message

(this was left over from my private testing and not meant for upstream)

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 67e8e3f2a3..aaf7829757 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -613,9 +613,6 @@ int Actor::actorWalkStep() {
 		_pos.y = (tmpY / (1 << 16));
 	}
 
-	if (_number == 10)
-	debug("ACTOR: %02d, X: %02d, Y: %02d", _number, _pos.x, _pos.y);
-
 	if (ABS(_pos.x - _walkdata.cur.x) > distX) {
 		_pos.x = _walkdata.next.x;
 	}




More information about the Scummvm-git-logs mailing list