diff options
author | Matthew Hoops | 2007-09-06 23:32:08 +0000 |
---|---|---|
committer | Matthew Hoops | 2007-09-06 23:32:08 +0000 |
commit | 4a467ee492e857a19b6fcc8eb75dc83683cde913 (patch) | |
tree | ebce86a3fa6c4e414e265813e445e5fdfaf65f17 | |
parent | 9db43997f71e3665bbba54a42514a57dd49e633f (diff) | |
download | scummvm-rg350-4a467ee492e857a19b6fcc8eb75dc83683cde913.tar.gz scummvm-rg350-4a467ee492e857a19b6fcc8eb75dc83683cde913.tar.bz2 scummvm-rg350-4a467ee492e857a19b6fcc8eb75dc83683cde913.zip |
This fixes images in Winnie (for me at least)
svn-id: r28871
-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); |