[Scummvm-cvs-logs] SF.net SVN: scummvm:[39677] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Mar 25 00:30:49 CET 2009
Revision: 39677
http://scummvm.svn.sourceforge.net/scummvm/?rev=39677&view=rev
Author: fingolfin
Date: 2009-03-24 23:30:48 +0000 (Tue, 24 Mar 2009)
Log Message:
-----------
Patch from bug #2710315: INDY3/FOA: bug in patch for series IQ with ScummVM GUI
Modified Paths:
--------------
scummvm/trunk/engines/scumm/script_v5.cpp
scummvm/trunk/engines/scumm/scumm.cpp
Modified: scummvm/trunk/engines/scumm/script_v5.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v5.cpp 2009-03-24 21:45:35 UTC (rev 39676)
+++ scummvm/trunk/engines/scumm/script_v5.cpp 2009-03-24 23:30:48 UTC (rev 39677)
@@ -1017,9 +1017,13 @@
*/
void ScummEngine_v5::updateIQPoints() {
int seriesIQ;
+ // IQString[0..72] corresponds to each puzzle's IQ.
+ // IQString[73] indicates that the IQ-file was loaded successfully and is always 0 when
+ // the IQ is calculated, hence it will be ignored here.
+ const int NUM_PUZZLES = 73;
+ byte seriesIQString[NUM_PUZZLES];
+ byte *episodeIQString;
int episodeIQStringSize;
- byte *episodeIQString;
- byte seriesIQString[73];
// load string with IQ points given per puzzle in any savegame
// IMPORTANT: the resource string STRINGID_IQ_SERIES is only valid while
@@ -1032,14 +1036,14 @@
if (!episodeIQString)
return;
episodeIQStringSize = getResourceSize(rtString, STRINGID_IQ_EPISODE);
- if (episodeIQStringSize < 73)
+ if (episodeIQStringSize < NUM_PUZZLES)
return;
// merge episode and series IQ strings and calculate series IQ
seriesIQ = 0;
- // iterate over puzzles (each of the first 73 bytes corresponds to a puzzle's IQ)
- for (int i = 0; i < 73 ; ++i) {
- char puzzleIQ = seriesIQString[i];
+ // iterate over puzzles
+ for (int i = 0; i < NUM_PUZZLES ; ++i) {
+ byte puzzleIQ = seriesIQString[i];
// if puzzle is solved copy points to episode string
if (puzzleIQ > 0)
episodeIQString[i] = puzzleIQ;
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2009-03-24 21:45:35 UTC (rev 39676)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2009-03-24 23:30:48 UTC (rev 39677)
@@ -2083,7 +2083,8 @@
}
void ScummEngine_v5::scummLoop_handleSaveLoad() {
- byte saveLoad = (_saveLoadFlag != 0);
+ // copy saveLoadFlag as handleSaveLoad() resets it
+ byte saveLoad = _saveLoadFlag;
ScummEngine::scummLoop_handleSaveLoad();
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