aboutsummaryrefslogtreecommitdiff
path: root/engines/access/amazon
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-10 11:47:15 -0400
committerPaul Gilbert2014-08-10 11:47:15 -0400
commitcce0c2ff97878b2b0b8a87e25395c3ef98bc584e (patch)
tree5a63d87c97114e834d90bb0d43adbea8cb0f2176 /engines/access/amazon
parent00901b200bffcbff69694ff6b54d55908fd74180 (diff)
downloadscummvm-rg350-cce0c2ff97878b2b0b8a87e25395c3ef98bc584e.tar.gz
scummvm-rg350-cce0c2ff97878b2b0b8a87e25395c3ef98bc584e.tar.bz2
scummvm-rg350-cce0c2ff97878b2b0b8a87e25395c3ef98bc584e.zip
ACCESS: Adding sprite resources and screen saving
Diffstat (limited to 'engines/access/amazon')
-rw-r--r--engines/access/amazon/amazon_game.cpp6
-rw-r--r--engines/access/amazon/amazon_room.cpp16
2 files changed, 14 insertions, 8 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index d1ba0e0258..5c2cda61aa 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -126,6 +126,8 @@ void AmazonEngine::doTitle() {
_sound->playSound(1);
_objectsTable[0] = _files->loadFile(0, 2);
+ SpriteResource *spr = new SpriteResource(this, _objectsTable[0], _files->_filesize);
+
_sound->playSound(1);
_screen->_loadPalFlag = false;
@@ -141,9 +143,11 @@ void AmazonEngine::doTitle() {
_buffer2.copyFrom(_buffer1);
int id = READ_LE_UINT16(COUNTDOWN + _pCount * 4);
int xp = READ_LE_UINT16(COUNTDOWN + _pCount * 4 + 2);
- _screen->plotImage(_objectsTable[0], id, Common::Point(xp, 71));
+ _screen->plotImage(spr, id, Common::Point(xp, 71));
}
// TODO: More to do
+
+ delete spr;
}
void AmazonEngine::doOpening() {
diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp
index 5627325f6e..056fa8f1eb 100644
--- a/engines/access/amazon/amazon_room.cpp
+++ b/engines/access/amazon/amazon_room.cpp
@@ -122,16 +122,18 @@ void AmazonRoom::roomSet() {
}
void AmazonRoom::roomMenu() {
- _icon = _vm->_files->loadFile("ICONS.LZ");
+ byte *iconData = _vm->_files->loadFile("ICONS.LZ");
+ SpriteResource *spr = new SpriteResource(_vm, _icon, _vm->_files->_filesize);
+ delete[] iconData;
+
_vm->_screen->saveScreen();
_vm->_screen->setDisplayScan();
- _vm->_destIn = _vm->_screen;
- _vm->_screen->plotImage(_icon, 0, Common::Point(0, 177));
- _vm->_screen->plotImage(_icon, 1, Common::Point(143, 177));
+ _vm->_destIn = _vm->_screen; // TODO: Redundant
+ _vm->_screen->plotImage(spr, 0, Common::Point(0, 177));
+ _vm->_screen->plotImage(spr, 1, Common::Point(143, 177));
- _vm->_screen->restoreScan();
- delete[] _icon;
- _icon = nullptr;
+ _vm->_screen->restoreScreen();
+ delete spr;
}
} // End of namespace Amazon