From 2315907de565f709a4127810288f266c47ecf533 Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Tue, 14 Sep 2010 05:32:20 +0000 Subject: HUGO: Rename some classes for better readibility svn-id: r52720 --- engines/hugo/display.cpp | 60 +++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 29 deletions(-) (limited to 'engines/hugo/display.cpp') diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index f84e595e45..e825070e83 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -406,8 +406,32 @@ void Screen::shadowStr(int16 sx, int16 sy, char *s, byte color) { writeStr(sx, sy, s, color); } +void Screen::userHelp() { +// Introduce user to the game +// DOS versions Only + Utils::Box(BOX_ANY , "%s", + "F1 - Press F1 again\n" + " for instructions\n" + "F2 - Sound on/off\n" + "F3 - Recall last line\n" + "F4 - Save game\n" + "F5 - Restore game\n" + "F6 - Inventory\n" + "F8 - Turbo button\n" + "F9 - Boss button\n\n" + "ESC - Return to game"); +} + +Screen_v1d::Screen_v1d(HugoEngine &vm) : Screen(vm) { +} + +Screen_v1d::~Screen_v1d() { +} + // Load font file, construct font ptrs and reverse data bytes -void Screen::loadFont(int16 fontId) { +// TODO: This uses hardcoded fonts in hugo.dat, it should be replaced +// by a proper implementation of .FON files +void Screen_v1d::loadFont(int16 fontId) { byte height, width; static bool fontLoadedFl[NUM_FONTS] = {false, false, false}; @@ -419,9 +443,8 @@ void Screen::loadFont(int16 fontId) { return; fontLoadedFl[_fnt] = true; - _vm.file().readUIFItem(fontId, _fontdata[_fnt]); - // Compile font ptrs. Note: First ptr points to height,width of font + memcpy(_fontdata[_fnt], _vm._arrayFont[_fnt], _vm._arrayFontSize[_fnt]); _font[_fnt][0] = _fontdata[_fnt]; // Store height,width of fonts int16 offset = 2; // Start at fontdata[2] ([0],[1] used for height,width) @@ -440,32 +463,14 @@ void Screen::loadFont(int16 fontId) { } } -void Screen::userHelp() { -// Introduce user to the game -// DOS versions Only - Utils::Box(BOX_ANY , "%s", - "F1 - Press F1 again\n" - " for instructions\n" - "F2 - Sound on/off\n" - "F3 - Recall last line\n" - "F4 - Save game\n" - "F5 - Restore game\n" - "F6 - Inventory\n" - "F8 - Turbo button\n" - "F9 - Boss button\n\n" - "ESC - Return to game"); -} - -Screen_v2::Screen_v2(HugoEngine &vm) : Screen(vm) { +Screen_v1w::Screen_v1w(HugoEngine &vm) : Screen(vm) { } -Screen_v2::~Screen_v2() { +Screen_v1w::~Screen_v1w() { } // Load font file, construct font ptrs and reverse data bytes -// TODO: This uses hardcoded fonts in hugo.dat, it should be replaced -// by a proper implementation of .FON files -void Screen_v2::loadFont(int16 fontId) { +void Screen_v1w::loadFont(int16 fontId) { byte height, width; static bool fontLoadedFl[NUM_FONTS] = {false, false, false}; @@ -477,17 +482,15 @@ void Screen_v2::loadFont(int16 fontId) { return; fontLoadedFl[_fnt] = true; + _vm.file().readUIFItem(fontId, _fontdata[_fnt]); - memcpy(_fontdata[_fnt], _vm._arrayFont[_fnt], _vm._arrayFontSize[_fnt]); + // Compile font ptrs. Note: First ptr points to height,width of font _font[_fnt][0] = _fontdata[_fnt]; // Store height,width of fonts int16 offset = 2; // Start at fontdata[2] ([0],[1] used for height,width) // Setup the font array (127 characters) for (int i = 1; i < 128; i++) { - if (i == 127) - i = i; - _font[_fnt][i] = _fontdata[_fnt] + offset; height = *(_fontdata[_fnt] + offset); width = *(_fontdata[_fnt] + offset + 1); @@ -499,6 +502,5 @@ void Screen_v2::loadFont(int16 fontId) { offset += 2 + size; } } - } // End of namespace Hugo -- cgit v1.2.3