From fcaf659c7ab676fa9c6ccfe6a6b3b8a6e8f1eb9f Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 5 Jul 2013 18:05:08 +0200 Subject: [PATCH] AVALANCHE: Lucerna: implement load_digits(). --- engines/avalanche/gyro2.h | 4 ++-- engines/avalanche/lucerna2.cpp | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index e83e0a96b98..3852ef3bf20 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -523,8 +523,8 @@ public: bool ontoolbar, seescroll; char objlist[10]; - void * digit[10]; - void *rwlite[9]; + byte *digit[10]; // digitsize and rwlitesize are defined in Lucerna::load_digits() !!! + byte *rwlite[9]; // Maybe it will be needed to move them to the class itself instead. byte oldrw; Common::String lastscore; byte cmp; /* current mouse-void **/ diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 29fac293e63..da2aaae0271 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -744,7 +744,7 @@ void Lucerna::thinkabout(char z, bool th) { /* Hey!!! Get it and put it!!! * p = new byte[picsize]; if (!f.open("folk.avd")) { - warning("AVALANCHE: Lucerna: File not found: thinks.avd"); + warning("AVALANCHE: Lucerna: File not found: folk.avd"); return; } @@ -779,7 +779,26 @@ void Lucerna::thinkabout(char z, bool th) { /* Hey!!! Get it and put it!!! * } void Lucerna::load_digits() { /* Load the scoring digits & rwlites */ - warning("STUB: Lucerna::load_digits()"); + const byte digitsize = 134; + const byte rwlitesize = 126; + + if (!f.open("digit.avd")) { + warning("AVALANCHE: Lucerna: File not found: digit.avd"); + return; + } + + for (byte fv = 0; fv < 10; fv ++) { + _vm->_gyro.digit[fv] = new byte[digitsize]; + for (byte i = 0; i < digitsize; i++) + _vm->_gyro.digit[fv][i] = f.readByte(); + } + + for (byte ff = 0; ff < 9; ff ++) { + _vm->_gyro.digit[ff] = new byte[rwlitesize]; + for (byte i = 0; i < rwlitesize; i++) + _vm->_gyro.digit[ff][i] = f.readByte(); + } + f.close(); } void Lucerna::toolbar() {