[Scummvm-cvs-logs] CVS: scummvm/saga interface.cpp,1.101,1.102 saga.cpp,1.114,1.115 saveload.cpp,1.13,1.14 scene.cpp,1.106,1.107 sprite.cpp,1.50,1.51
Eugene Sandulenko
sev at users.sourceforge.net
Thu Jun 2 15:16:09 CEST 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21888
Modified Files:
interface.cpp saga.cpp saveload.cpp scene.cpp sprite.cpp
Log Message:
Implement game load with '-x' comman-line parameter.
Fix couple valgrind and compiler warnings.
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- interface.cpp 1 Jun 2005 06:24:24 -0000 1.101
+++ interface.cpp 2 Jun 2005 22:14:57 -0000 1.102
@@ -202,6 +202,7 @@
}
_textInputRepeatPhase = 0;
+ _textInput = false;
_initialized = true;
}
Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- saga.cpp 31 May 2005 01:03:13 -0000 1.114
+++ saga.cpp 2 Jun 2005 22:14:57 -0000 1.115
@@ -301,9 +301,19 @@
_previousTicks = _system->getMillis();
- // Begin Main Engine Loop
+ if (ConfMan.hasKey("save_slot")) {
+ // First scene sets up palette
+ _scene->changeScene(getStartSceneNumber(), 0, kTransitionNoFade);
+ _events->handleEvents(0); // Process immediate events
+
+ char *fileName;
+ fileName = calcSaveFileName(ConfMan.getInt("save_slot"));
+ load(fileName);
+ _interface->setMode(kPanelMain);
+ } else {
+ _scene->startScene();
+ }
- _scene->startScene();
uint32 currentTicks;
while (!_quit) {
Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saveload.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- saveload.cpp 2 Jun 2005 16:18:44 -0000 1.13
+++ saveload.cpp 2 Jun 2005 22:14:57 -0000 1.14
@@ -136,7 +136,7 @@
while (i < MAX_SAVES) {
if (_saveMarks[i]) {
name = calcSaveFileName(i);
- if (in = _saveFileMan->openForLoading(name)) {
+ if ((in = _saveFileMan->openForLoading(name)) != NULL) {
in->read(&header, sizeof(header));
if (header.type != MKID('SAGA')) {
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- scene.cpp 30 May 2005 16:40:50 -0000 1.106
+++ scene.cpp 2 Jun 2005 22:14:57 -0000 1.107
@@ -869,10 +869,8 @@
}
void Scene::endScene() {
-
- if (!_sceneLoaded) {
- error("Scene::endScene(): No scene to end");
- }
+ if (!_sceneLoaded)
+ return;
debug(0, "Ending scene...");
Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- sprite.cpp 22 May 2005 11:59:22 -0000 1.50
+++ sprite.cpp 2 Jun 2005 22:14:57 -0000 1.51
@@ -402,11 +402,11 @@
MemoryReadStream readS(inputBuffer, inLength);
- while (!readS.eos() && (outPointer < outPointerEnd)) {
+ while (!readS.eos() && (outPointer < outPointerEnd - 1)) {
bg_runcount = readS.readByte();
fg_runcount = readS.readByte();
- for (c = 0; c < bg_runcount; c++) {
+ for (c = 0; c < bg_runcount && !readS.eos(); c++) {
*outPointer = (byte) 0;
if (outPointer < outPointerEnd)
outPointer++;
@@ -414,7 +414,7 @@
return;
}
- for (c = 0; c < fg_runcount; c++) {
+ for (c = 0; c < fg_runcount && !readS.eos(); c++) {
*outPointer = readS.readByte();
if (outPointer < outPointerEnd)
outPointer++;
More information about the Scummvm-git-logs
mailing list