mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 04:28:37 +00:00
Implement game load with '-x' comman-line parameter.
Fix couple valgrind and compiler warnings. svn-id: r18313
This commit is contained in:
parent
ae36a54c92
commit
8a835899fb
@ -202,6 +202,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm), _initialized(false) {
|
||||
}
|
||||
|
||||
_textInputRepeatPhase = 0;
|
||||
_textInput = false;
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
@ -301,9 +301,19 @@ int SagaEngine::go() {
|
||||
|
||||
_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) {
|
||||
|
@ -136,7 +136,7 @@ void SagaEngine::fillSaveList() {
|
||||
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')) {
|
||||
|
@ -869,10 +869,8 @@ void Scene::draw() {
|
||||
}
|
||||
|
||||
void Scene::endScene() {
|
||||
|
||||
if (!_sceneLoaded) {
|
||||
error("Scene::endScene(): No scene to end");
|
||||
}
|
||||
if (!_sceneLoaded)
|
||||
return;
|
||||
|
||||
debug(0, "Ending scene...");
|
||||
|
||||
|
@ -402,11 +402,11 @@ void Sprite::decodeRLEBuffer(const byte *inputBuffer, size_t inLength, size_t ou
|
||||
|
||||
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 @@ void Sprite::decodeRLEBuffer(const byte *inputBuffer, size_t inLength, size_t ou
|
||||
return;
|
||||
}
|
||||
|
||||
for (c = 0; c < fg_runcount; c++) {
|
||||
for (c = 0; c < fg_runcount && !readS.eos(); c++) {
|
||||
*outPointer = readS.readByte();
|
||||
if (outPointer < outPointerEnd)
|
||||
outPointer++;
|
||||
|
Loading…
Reference in New Issue
Block a user