diff options
author | Matthew Hoops | 2007-09-11 20:09:39 +0000 |
---|---|---|
committer | Matthew Hoops | 2007-09-11 20:09:39 +0000 |
commit | c1c7b5f563194822b89656396dd0f3c3b8724b20 (patch) | |
tree | 70fbe19f65e0e82c8eebb693f186db5f0890ac5a /engines/agi/preagi_winnie.cpp | |
parent | 35d68621171128c885f5064fb1a3deccb984d95b (diff) | |
download | scummvm-rg350-c1c7b5f563194822b89656396dd0f3c3b8724b20.tar.gz scummvm-rg350-c1c7b5f563194822b89656396dd0f3c3b8724b20.tar.bz2 scummvm-rg350-c1c7b5f563194822b89656396dd0f3c3b8724b20.zip |
PreAGI does not need an AGI resource loader, as it only needs to load pictures and doesn't use directories. So, this allows Winnie to decode pictures without using the loader
svn-id: r28893
Diffstat (limited to 'engines/agi/preagi_winnie.cpp')
-rw-r--r-- | engines/agi/preagi_winnie.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index fc50c77f5e..bad7315779 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -968,13 +968,17 @@ void Winnie::drawPic(const char *szName) { // construct filename sprintf(szFile, IDS_WTP_PATH, szName); + Common::File file; + if (!file.open(szName)) + return; + uint32 size = file.size(); + file.read(buffer, size); + file.close(); - _vm->preAgiLoadResource(rPICTURE, szName); - _vm->_picture->decodePicture(0, true, false, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->decodePicture(buffer, size, 1, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); _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); delete [] buffer; } @@ -989,9 +993,8 @@ void Winnie::drawObjPic(int iObj, int x0, int y0) { readObj(iObj, buffer, 2048); memcpy(&objhdr, buffer, sizeof(WTP_OBJ_HDR)); - _vm->preAgiLoadResource(rPICTURE, buffer + objhdr.ofsPic - IDI_WTP_OFS_OBJ); _vm->_picture->setOffset(x0, y0); - _vm->_picture->decodePicture(0, false, false, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->decodePicture(buffer + objhdr.ofsPic - IDI_WTP_OFS_OBJ, 4096, 0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); _vm->_picture->setOffset(0, 0); _vm->_picture->showPic(10, 0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); _vm->_gfx->doUpdate(); @@ -1015,8 +1018,7 @@ void Winnie::drawRoomPic() { memcpy(&roomhdr, buffer, sizeof(WTP_ROOM_HDR)); // draw room picture - _vm->preAgiLoadResource(rPICTURE, buffer + roomhdr.ofsPic - IDI_WTP_OFS_ROOM); - _vm->_picture->decodePicture(0, true, false, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); + _vm->_picture->decodePicture(buffer + roomhdr.ofsPic - IDI_WTP_OFS_ROOM, 4096, 1, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT); _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 |