diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/loader_preagi.cpp | 42 | ||||
-rw-r--r-- | engines/agi/preagi_winnie.cpp | 1 |
2 files changed, 20 insertions, 23 deletions
diff --git a/engines/agi/loader_preagi.cpp b/engines/agi/loader_preagi.cpp index e8c6cf9bfe..09bdf9f921 100644 --- a/engines/agi/loader_preagi.cpp +++ b/engines/agi/loader_preagi.cpp @@ -225,25 +225,24 @@ int AgiLoader_preagi::loadResource(int t, const char* n) { /* if picture is currently NOT loaded *OR* cacheing is off, * unload the resource (caching==off) and reload it */ - if (~_vm->_game.dirPic[0].flags & RES_LOADED) { + if (~_vm->_game.dirPic[0].flags & RES_LOADED) unloadResource(rPICTURE, 0); - data = new uint8[4096]; + data = new uint8[4096]; - if (!infile.open(n)) - return errBadResource; - infile.read(data, infile.size()); + if (!infile.open(n)) + return errBadResource; + infile.read(data, infile.size()); - if (data != NULL) { - _vm->_game.pictures[0].rdata = data; - _vm->_game.dirPic[0].len = infile.size(); - _vm->_game.dirPic[0].flags |= RES_LOADED; - } else { - ec = errBadResource; - } - - infile.close(); + if (data != NULL) { + _vm->_game.pictures[0].rdata = data; + _vm->_game.dirPic[0].len = infile.size(); + _vm->_game.dirPic[0].flags |= RES_LOADED; + } else { + ec = errBadResource; } + + infile.close(); break; case rSOUND: break; @@ -269,16 +268,15 @@ int AgiLoader_preagi::loadResource(int t, byte* n) { /* if picture is currently NOT loaded *OR* cacheing is off, * unload the resource (caching==off) and reload it */ - if (~_vm->_game.dirPic[0].flags & RES_LOADED) { + if (~_vm->_game.dirPic[0].flags & RES_LOADED) unloadResource(rPICTURE, 0); - if (n != NULL) { - _vm->_game.pictures[0].rdata = n; - _vm->_game.dirPic[0].len = 4096; //FIXME - _vm->_game.dirPic[0].flags |= RES_LOADED; - } else { - ec = errBadResource; - } + if (n != NULL) { + _vm->_game.pictures[0].rdata = n; + _vm->_game.dirPic[0].len = 4096; //FIXME + _vm->_game.dirPic[0].flags |= RES_LOADED; + } else { + ec = errBadResource; } break; case rSOUND: diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 83804f18bc..d7f19c062c 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -662,7 +662,6 @@ void Winnie::drawRoomPic() { _vm->_picture->showPic(IDI_WTP_PIC_X0, IDI_WTP_PIC_Y0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); _vm->_gfx->doUpdate(); _vm->_system->updateScreen(); // TODO: this should go in the game's main loop - //_vm->preAgiUnloadResource(rPICTURE, 0); // FIXME: This causes crashes // draw object picture //Winnie_DrawObjPic(iObj, IDI_WTP_PIC_X0 + roomhdr.objX, IDI_WTP_PIC_Y0 + roomhdr.objY); |