[Scummvm-cvs-logs] scummvm master -> bee54dc048512904941487d6f1f7664b690d666c
digitall
dgturner at iee.org
Sat May 17 21:19:32 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bee54dc048 HOPKINS: Fix loading of variant COMPUTAN.TXT used by Polish version.
Commit: bee54dc048512904941487d6f1f7664b690d666c
https://github.com/scummvm/scummvm/commit/bee54dc048512904941487d6f1f7664b690d666c
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-17T20:22:19+01:00
Commit Message:
HOPKINS: Fix loading of variant COMPUTAN.TXT used by Polish version.
This is the final fix for bug #6590 - "HOPKINS-PL: Crash using computer
in office".
Changed paths:
engines/hopkins/computer.cpp
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index dafff15..84d5c63 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -345,6 +345,7 @@ static const char _spanishText[] =
* Load Menu data
*/
void ComputerManager::loadMenu() {
+ debug(9, "ComputerManager::loadMenu()");
char *ptr;
if (_vm->_fileIO->fileExists("COMPUTAN.TXT")) {
ptr = (char *)_vm->_fileIO->loadFile("COMPUTAN.TXT");
@@ -368,17 +369,19 @@ void ComputerManager::loadMenu() {
char *tmpPtr = ptr;
int lineNum = 0;
+ const char lineSep = tmpPtr[0];
+
while (tmpPtr[0] != '\0' && lineNum < ARRAYSIZE(_menuText)) {
if (tmpPtr[0] == '%' && tmpPtr[1] == '%') {
// End of file marker found - Break out of parse loop
break;
}
- if (tmpPtr[0] == '%') {
+ if (tmpPtr[0] == lineSep) {
int strPos = 0;
while (strPos < ARRAYSIZE(_menuText[0]._line)) {
char curChar = tmpPtr[strPos + 2];
- if (curChar == '\0' || curChar == '%' || curChar == 0x0a) // Line Feed
+ if (curChar == '\0' || curChar == lineSep || curChar == 0x0a) // Line Feed
break;
_menuText[lineNum]._line[strPos++] = curChar;
}
@@ -388,7 +391,10 @@ void ComputerManager::loadMenu() {
_menuText[lineNum]._lineSize = strPos - 1;
}
- ++lineNum;
+ if (strPos != 0) {
+ debug(9, "_menuText[%d]._line (size: %d): \"%s\"", lineNum, _menuText[lineNum]._lineSize, _menuText[lineNum]._line);
+ ++lineNum;
+ }
}
++tmpPtr;
}
More information about the Scummvm-git-logs
mailing list