From 72161adf1c7eec7f1ca889fb5ed9017029e6e6da Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 29 Jan 2016 17:14:49 +0100 Subject: AGI: overwrite save restore dialog font character Overwrite it, to make sure that original save/restore dialogs look properly. --- engines/agi/font.cpp | 14 +++++++++++--- engines/agi/font.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/agi/font.cpp b/engines/agi/font.cpp index b3547c27b1..b9a7795c0b 100644 --- a/engines/agi/font.cpp +++ b/engines/agi/font.cpp @@ -1062,6 +1062,12 @@ const byte *GfxFont::getFontData() { return _fontData; } +void GfxFont::overwriteSaveRestoreDialogCharacter() { + // overwrite character 0x1A with the standard Sierra arrow to the right character + // required for the original save/restore dialogs + memcpy(_fontDataAllocated + (0x1A * 8), fontData_ArrowRightCharacter, sizeof(fontData_ArrowRightCharacter)); +} + // This code loads a ScummVM-specific user-supplied binary font file // It's assumed that it's a plain binary file, that contains 256 characters. 8 bytes per character. // 8x8 pixels per character. File size 2048 bytes. @@ -1096,6 +1102,8 @@ void GfxFont::loadFontScummVMFile(Common::String fontFilename) { // read font data, is already in the format that we need (plain bitmap 8x8) fontFile.read(_fontDataAllocated, 256 * 8); fontFile.close(); + + overwriteSaveRestoreDialogCharacter(); } // We load the Mickey Mouse font from MICKEY.EXE @@ -1198,6 +1206,8 @@ void GfxFont::loadFontAmigaPseudoTopaz() { fontData += 8; } } + + overwriteSaveRestoreDialogCharacter(); } void GfxFont::loadFontAppleIIgs() { @@ -1385,9 +1395,7 @@ void GfxFont::loadFontAppleIIgs() { free(locationTablePtr); free(strikeDataPtr); - // overwrite character 0x1A with the standard Sierra arrow to the right character - // required for the original save/restore dialogs - memcpy(_fontDataAllocated + (0x1A * 8), fontData_ArrowRightCharacter, sizeof(fontData_ArrowRightCharacter)); + overwriteSaveRestoreDialogCharacter(); } } // End of namespace Agi diff --git a/engines/agi/font.h b/engines/agi/font.h index 791b1b0217..bff02f968d 100644 --- a/engines/agi/font.h +++ b/engines/agi/font.h @@ -38,6 +38,8 @@ public: const byte *getFontData(); private: + void overwriteSaveRestoreDialogCharacter(); + void loadFontScummVMFile(Common::String fontFilename); void loadFontMickey(); void loadFontAmigaPseudoTopaz(); -- cgit v1.2.3