aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authoruruk2013-07-10 13:26:49 +0200
committeruruk2013-07-10 13:26:49 +0200
commit11cbacfe9dffb8d555addb0464a7f0cebf914ef4 (patch)
treedc42ffd49d2789991185a4ba61d2515b38a7e00e /engines/avalanche
parentc90357724fa6602b3b54bfcac401b520226a2740 (diff)
downloadscummvm-rg350-11cbacfe9dffb8d555addb0464a7f0cebf914ef4.tar.gz
scummvm-rg350-11cbacfe9dffb8d555addb0464a7f0cebf914ef4.tar.bz2
scummvm-rg350-11cbacfe9dffb8d555addb0464a7f0cebf914ef4.zip
AVALANCHE: Implement file loadfont() in Scrolls. Move initializations to run(), so loadfont() can access the data files of the game.
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/avalanche.cpp17
-rw-r--r--engines/avalanche/scrolls2.cpp26
2 files changed, 37 insertions, 6 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index a510718d4a..98e8865e76 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -53,15 +53,15 @@ namespace Avalanche {
_enhanced.setParent(this);
_logger.setParent(this);
_pingo.setParent(this);
- _scrolls.setParent(this); _scrolls.init();
+ _scrolls.setParent(this);
_visa.setParent(this);
- _lucerna.setParent(this); _lucerna.init();
+ _lucerna.setParent(this);
_enid.setParent(this);
_celer.setParent(this);
_sequence.setParent(this);
_timeout.setParent(this);
_trip.setParent(this);
- _acci.setParent(this); _acci.init();
+ _acci.setParent(this);
_basher.setParent(this);
_dropdown.setParent(this);
_closing.setParent(this);
@@ -230,8 +230,10 @@ namespace Avalanche {
void AvalancheEngine::run_avalot() {
bflight_on();
- _avalot.run(Common::String(runcodes[first_time]) + arguments); // TODO: Check if parameteres are ever use and eventually remove them
+ _avalot.run(Common::String(runcodes[first_time]) + arguments);
+ // TODO: Check if parameteres are ever used (probably not) and eventually remove them.
// If there's an error initalizing avalot, i'll handle it in there, not here
+
first_time = false;
}
@@ -242,7 +244,10 @@ namespace Avalanche {
initGraphics(320, 200, false);
_console = new AvalancheConsole(this);
-
+ _scrolls.init();
+ _lucerna.init();
+ _acci.init();
+ _basher.init();
// From bootstrp:
@@ -257,6 +262,8 @@ namespace Avalanche {
if (!zoomy)
call_menu(); /* Not run when zoomy. */
+
+
do {
run_avalot();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index d4a7752e6e..ca0ac3071e 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -254,7 +254,31 @@ void Scrolls::display(Common::String z) {
}
void Scrolls::loadfont() {
- warning("STUB: Scrolls::loadfont()");
+ Common::File f;
+
+ if (!f.open("avalot.fnt")) {
+ warning("AVALANCHE: Scrolls: File not found: avalot.fnt");
+ return;
+ }
+ for (int16 i = 0; i < 256; i++)
+ f.read(ch[0][i],16);
+ f.close();
+
+ if (!f.open("avitalic.fnt")) {
+ warning("AVALANCHE: Scrolls: File not found: avitalic.fnt");
+ return;
+ }
+ for (int16 i = 0; i < 256; i++)
+ f.read(ch[1][i],16);
+ f.close();
+
+ if (!f.open("ttsmall.fnt")) {
+ warning("AVALANCHE: Scrolls: File not found: ttsmall.fnt");
+ return;
+ }
+ for (int16 i = 0; i < 256; i++)
+ f.read(_vm->_gyro.little[i],16);
+ f.close();
}
void Scrolls::okay() {