AVALANCHE: Implement file loadfont() in Scrolls. Move initializations to run(), so loadfont() can access the data files of the game.

This commit is contained in:
uruk 2013-07-10 13:26:49 +02:00
parent c90357724f
commit 11cbacfe9d
2 changed files with 37 additions and 6 deletions

View File

@ -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();

View File

@ -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() {