aboutsummaryrefslogtreecommitdiff
path: root/engines/access/amazon
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-27 22:13:43 -0400
committerPaul Gilbert2014-08-27 22:13:43 -0400
commitc0a7852662be724077921bcf9b9bb0bf2da2dfff (patch)
treec8487eeafdadd15a81d5918b951014420be5a1b7 /engines/access/amazon
parent455011c37e20fb2d859e1c3f04650e369844c921 (diff)
downloadscummvm-rg350-c0a7852662be724077921bcf9b9bb0bf2da2dfff.tar.gz
scummvm-rg350-c0a7852662be724077921bcf9b9bb0bf2da2dfff.tar.bz2
scummvm-rg350-c0a7852662be724077921bcf9b9bb0bf2da2dfff.zip
ACCESS: Refactor the file manager to return resource structures
Diffstat (limited to 'engines/access/amazon')
-rw-r--r--engines/access/amazon/amazon_game.cpp15
-rw-r--r--engines/access/amazon/amazon_room.cpp6
2 files changed, 11 insertions, 10 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 15869a4499..cf383ce45a 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -134,9 +134,9 @@ void AmazonEngine::doTitle() {
_screen->forceFadeIn();
_sound->playSound(1);
- byte *spriteData = _files->loadFile(0, 2);
- _objectsTable[0] = new SpriteResource(this, spriteData, _files->_filesize,
- DisposeAfterUse::YES);
+ Resource *spriteData = _files->loadFile(0, 2);
+ _objectsTable[0] = new SpriteResource(this, spriteData);
+ delete spriteData;
_sound->playSound(1);
@@ -300,13 +300,13 @@ void AmazonEngine::tileScreen() {
if (!_files->existFile(_tileFiles[idx]))
return;
- byte *data = _files->loadFile(_tileFiles[idx]);
- int x = READ_LE_UINT16(data);
- int y = READ_LE_UINT16(data + 2);
+ Resource *res = _files->loadFile(_tileFiles[idx]);
+ int x = res->_stream->readSint16LE();
+ int y = res->_stream->readSint16LE();
int size = ((x + 2) * y) + 10;
for (int i = 0; i < size; ++i)
- _tileData[i] = data[i + 4];
+ _tileData[i] = res->_stream->readByte();
// CHECKME: Depending on the Vesa mode during initialization, 400 or 480
for (_tilePos.y = 0; _tilePos.y < 480; _tilePos.y += y) {
@@ -314,6 +314,7 @@ void AmazonEngine::tileScreen() {
warning("TODO: DRAWOBJECT");
}
+ delete res;
}
void AmazonEngine::updateSummary(int chap) {
diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp
index f64264f7d7..227fc474cf 100644
--- a/engines/access/amazon/amazon_room.cpp
+++ b/engines/access/amazon/amazon_room.cpp
@@ -131,9 +131,9 @@ void AmazonRoom::roomSet() {
}
void AmazonRoom::roomMenu() {
- byte *iconData = _vm->_files->loadFile("ICONS.LZ");
- SpriteResource *spr = new SpriteResource(_vm, iconData, _vm->_files->_filesize);
- delete[] iconData;
+ Resource *iconData = _vm->_files->loadFile("ICONS.LZ");
+ SpriteResource *spr = new SpriteResource(_vm, iconData);
+ delete iconData;
_vm->_screen->saveScreen();
_vm->_screen->setDisplayScan();