aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2013-07-12 16:11:07 +0200
committeruruk2013-07-12 16:11:07 +0200
commitc18b41b21dd3674b44c07ef68f317822bcfb1d37 (patch)
treeb59cff8d4b150d0a95b38bd5a42e67d70716955b
parentfa881567db05ffb6c2f8aaf96a37a3321e9c417f (diff)
downloadscummvm-rg350-c18b41b21dd3674b44c07ef68f317822bcfb1d37.tar.gz
scummvm-rg350-c18b41b21dd3674b44c07ef68f317822bcfb1d37.tar.bz2
scummvm-rg350-c18b41b21dd3674b44c07ef68f317822bcfb1d37.zip
AVALANCHE: Lucerna: finish implementation of load().
-rw-r--r--engines/avalanche/lucerna2.cpp40
1 files changed, 30 insertions, 10 deletions
diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp
index 66036e052e..5cbd46c408 100644
--- a/engines/avalanche/lucerna2.cpp
+++ b/engines/avalanche/lucerna2.cpp
@@ -230,14 +230,35 @@ void Lucerna::load(byte n) { /* Load2, actually */
f.seek(177);
warning("STUB: Lucerna::load()");
- for (bit = 0; bit <= 3; bit++) {
- /*port[0x3c4] = 2;
- port[0x3ce] = 4;
- port[0x3c5] = 1 << bit;
- port[0x3cf] = bit;
- blockread(f, a0, 12080);
- move(a0, a1, 12080);*/
- }
+
+ Graphics::Surface background;
+ background.create(_vm->_graph._screenWidth, _vm->_graph._screenHeight, Graphics::PixelFormat::createFormatCLUT8());
+
+ for (byte plane = 0; plane < 4; plane++)
+ for (uint16 y = 0; y < 151; y++)
+ for (uint16 x = 0; x < 640/8; x++) {
+ byte pixel = f.readByte();
+ for (byte i = 0; i < 8; i++) {
+ byte pixelBit = (pixel >> i) & 1;
+ *(byte *)background.getBasePtr(x * 8, y) += (pixelBit << plane);
+ }
+ }
+
+ _vm->_graph.copySurface(background);
+
+ background.free();
+
+ _vm->_graph.refreshScreen();
+
+
+ /*for (bit = 0; bit <= 3; bit++) {
+ port[0x3c4] = 2;
+ port[0x3ce] = 4;
+ port[0x3c5] = 1 << bit;
+ port[0x3cf] = bit;
+ blockread(f, a0, 12080);
+ move(a0, a1, 12080);
+ }*/
f.close();
@@ -246,8 +267,7 @@ void Lucerna::load(byte n) { /* Load2, actually */
_vm->_pingo.copy03();
- //bit = getpixel(0, 0);
- warning("STUB: Lucerna::load()");
+ bit = *_vm->_graph.getPixel(0,0);
_vm->_logger.log_newroom(_vm->_gyro.roomname);