[Scummvm-cvs-logs] SF.net SVN: scummvm:[41721] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jun 21 03:15:37 CEST 2009


Revision: 41721
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41721&view=rev
Author:   lordhoto
Date:     2009-06-21 01:15:37 +0000 (Sun, 21 Jun 2009)

Log Message:
-----------
Enable proper umlaut handling in kyra 1-3.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_hof.cpp
    scummvm/trunk/engines/kyra/gui_lok.cpp
    scummvm/trunk/engines/kyra/gui_v2.cpp

Modified: scummvm/trunk/engines/kyra/gui_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_hof.cpp	2009-06-21 01:15:24 UTC (rev 41720)
+++ scummvm/trunk/engines/kyra/gui_hof.cpp	2009-06-21 01:15:37 UTC (rev 41721)
@@ -95,7 +95,11 @@
 	if (!menuItem.itemId)
 		return 0;
 
-	return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1);
+	// 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);
+	else
+		return _vm->getTableString(menuItem.itemId, _vm->_optionsBuffer, 1);
 }
 
 const char *GUI_HoF::getMenuItemLabel(const MenuItem &menuItem) {

Modified: scummvm/trunk/engines/kyra/gui_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lok.cpp	2009-06-21 01:15:24 UTC (rev 41720)
+++ scummvm/trunk/engines/kyra/gui_lok.cpp	2009-06-21 01:15:37 UTC (rev 41721)
@@ -31,6 +31,7 @@
 #include "kyra/sound.h"
 #include "kyra/gui_lok.h"
 #include "kyra/timer.h"
+#include "kyra/util.h"
 
 #include "common/config-manager.h"
 #include "common/savefile.h"
@@ -538,6 +539,9 @@
 		if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header))) {
 			strncpy(savenames[i], header.description.c_str(), ARRAYSIZE(savenames[0]));
 			savenames[i][34] = 0;
+
+			Util::convertISOToDOS(savenames[i]);
+
 			menu.item[i].itemString = savenames[i];
 			menu.item[i].enabled = 1;
 			menu.item[i].saveSlot = _saveSlots[i + _savegameOffset];
@@ -654,9 +658,12 @@
 	if (_keyPressed.keycode) {
 		length = strlen(_savegameName);
 
-		if (_keyPressed.ascii > 31 && _keyPressed.ascii < 127) {
+		char inputKey = _keyPressed.ascii;
+		Util::convertISOToDOS(inputKey);
+
+		if ((uint8)inputKey > 31 && (uint8)inputKey < 226) {
 			if (length < ARRAYSIZE(_savegameName)-1) {
-				_savegameName[length] = _keyPressed.ascii;
+				_savegameName[length] = inputKey;
 				_savegameName[length+1] = 0;
 				redrawTextfield();
 			}
@@ -715,6 +722,8 @@
 		if (_savegameOffset == 0 && _vm->_gameToLoad == 0)
 			_vm->_gameToLoad = getNextSavegameSlot();
 		if (_vm->_gameToLoad > 0) {
+			Util::convertDOSToISO(_savegameName);
+
 			Graphics::Surface thumb;
 			createScreenThumbnail(thumb);
 			_vm->saveGameState(_vm->_gameToLoad, _savegameName, &thumb);

Modified: scummvm/trunk/engines/kyra/gui_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_v2.cpp	2009-06-21 01:15:24 UTC (rev 41720)
+++ scummvm/trunk/engines/kyra/gui_v2.cpp	2009-06-21 01:15:37 UTC (rev 41721)
@@ -27,6 +27,7 @@
 #include "kyra/kyra_v2.h"
 #include "kyra/screen_v2.h"
 #include "kyra/text.h"
+#include "kyra/util.h"
 
 #include "common/savefile.h"
 
@@ -455,8 +456,11 @@
 	Common::InSaveFile *in;
 	for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); ++i) {
 		if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) {
-			strncpy(getTableString(menu.item[i].itemId), header.description.c_str(), 80);
-			getTableString(menu.item[i].itemId)[79] = 0;
+			char *s = getTableString(menu.item[i].itemId);
+			strncpy(s, header.description.c_str(), 80);
+			s[79] = 0;
+			Util::convertISOToDOS(s);
+
 			menu.item[i].saveSlot = _saveSlots[i + _savegameOffset];
 			menu.item[i].enabled = true;
 			delete in;
@@ -621,6 +625,7 @@
 
 	Graphics::Surface thumb;
 	createScreenThumbnail(thumb);
+	Util::convertDOSToISO(_saveDescription);
 	_vm->saveGameState(_saveSlot, _saveDescription, &thumb);
 	thumb.free();
 
@@ -751,6 +756,10 @@
 	while (running && !_vm->shouldQuit()) {
 		checkTextfieldInput();
 		processHighlights(_savenameMenu);
+
+		char inputKey = _keyPressed.ascii;
+		Util::convertISOToDOS(inputKey);
+
 		if (_keyPressed.keycode == Common::KEYCODE_RETURN || _keyPressed.keycode == Common::KEYCODE_KP_ENTER || _finishNameInput) {
 			if (checkSavegameDescription(buffer, curPos)) {
 				buffer[curPos] = 0;
@@ -768,12 +777,12 @@
 			drawTextfieldBlock(x2, y2, c3);
 			_screen->updateScreen();
 			_lastScreenUpdate = _vm->_system->getMillis();
-		} else if (_keyPressed.ascii > 31 && _keyPressed.ascii < 127 && curPos < bufferSize) {
-			if (x2 + getCharWidth(_keyPressed.ascii) + 7 < 0x11F) {
-				buffer[curPos] = _keyPressed.ascii;
+		} else if ((uint8)inputKey > 31 && (uint8)inputKey < 226 && curPos < bufferSize) {
+			if (x2 + getCharWidth(inputKey) + 7 < 0x11F) {
+				buffer[curPos] = inputKey;
 				const char text[2] = { buffer[curPos], 0 };
 				_text->printText(text, x2, y2, c1, c2, c2);
-				x2 += getCharWidth(_keyPressed.ascii);
+				x2 += getCharWidth(inputKey);
 				drawTextfieldBlock(x2, y2, c3);
 				++curPos;
 				_screen->updateScreen();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list