aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-07-05 23:13:33 +0200
committeruruk2013-07-05 23:13:33 +0200
commit755d07a8dea913cbbd0137aae089379c42a5af99 (patch)
treeee49149a86075aefcf1bb526405c4646ede42180 /engines
parent0f2a0cf2a48a35cf54d4a1bc2af0062b36861533 (diff)
downloadscummvm-rg350-755d07a8dea913cbbd0137aae089379c42a5af99.tar.gz
scummvm-rg350-755d07a8dea913cbbd0137aae089379c42a5af99.tar.bz2
scummvm-rg350-755d07a8dea913cbbd0137aae089379c42a5af99.zip
AVALANCHE: Scrolls: implement file handling.
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/scrolls2.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4bb4f9d87c..8bf53cbed1 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -41,6 +41,7 @@
#include "avalanche/basher2.h"
#include "common/textconsole.h"
+#include "common/file.h"
//#include "avalanche/joystick2.h" - Will be implemented later, if it will be implemented at all...
@@ -134,11 +135,55 @@ void Scrolls::undodgem() { /* This is the opposite of Dodgem. It moves the
}
void Scrolls::geticon(int16 x, int16 y, byte which) {
+ Common::File f;
+ byte *p;
+
+ if (!f.open("icons.avd")) {
+ warning("AVALANCHE: Scrolls: File not found: icons.avd");
+ return;
+ }
+
+ which--;
+ f.seek(which * 426);
+
+ p = new byte[426];
+ for (int16 i = 0; i < 426; i++)
+ p[i] = f.readByte();
+
+ //putimage(x, y, p, 0);
warning("STUB: Scrolls::geticon()");
+
+ delete[] p;
+ f.close();
}
void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
+ Common::File f;
+ byte bit;
+ int16 fv;
+ uint16 st;
+
+ st = (y - 1) * 80 + (40 - xl / 2) + ((1 - _vm->_gyro.cp) * _vm->_gyro.pagetop);
+
+ Common::String filename;
+ filename = filename.format("%s.avd", fn.c_str());
+ if (!f.open(filename)) {
+ warning("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
+ return;
+ }
+
+ /*for (fv = 1; fv <= yl; fv ++)
+ for (bit = 0; bit <= 3; bit ++) {
+ port[0x3c4] = 2;
+ port[0x3ce] = 4;
+ port[0x3c5] = 1 << bit;
+ port[0x3cf] = bit;
+ blockread(f, mem[0xa000 * st + (fv * 80)], xl);
+ }
+ bit = getpixel(0, 0);*/
warning("STUB: Scrolls::block_drop()");
+
+ f.close();
}
void Scrolls::drawscroll(func2 gotoit) { /* This is one of the oldest func2s in the game. */