From f6a098bc4f804feb0708ab92b6f9f950d0ac5fdd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 25 Nov 2012 20:18:38 +1100 Subject: HOPKINS: Bugfix for intermittent crash when opening Save/Load dialog --- engines/hopkins/font.cpp | 18 ++++++------------ engines/hopkins/font.h | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'engines/hopkins') diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 64f39f9c9e..df9aa94458 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -32,23 +32,17 @@ namespace Hopkins { +FontManager::FontManager() { + clearAll(); +} + void FontManager::setParent(HopkinsEngine *vm) { _vm = vm; } void FontManager::clearAll() { - for (int idx = 0; idx < 11; ++idx) { - Txt[idx].textOn = false; - Txt[idx].lineCount = 0; - Txt[idx].field3FC = 0; - Txt[idx].field3FE = 0; - Txt[idx].textBlock = NULL; - Txt[idx].width = 0; - Txt[idx].height = 0; - Txt[idx].textLoaded = false; - - ListeTxt[idx].enabled = false; - } + for (int idx = 0; idx < 11; ++idx) + Common::fill((byte *)&Txt[idx], (byte *)&Txt[idx] + sizeof(TxtItem), 0); } // Text On diff --git a/engines/hopkins/font.h b/engines/hopkins/font.h index a2ae88a028..08b32377a7 100644 --- a/engines/hopkins/font.h +++ b/engines/hopkins/font.h @@ -71,6 +71,7 @@ public: int Index[4048]; byte *texte_tmp; public: + FontManager(); void setParent(HopkinsEngine *vm); void clearAll(); -- cgit v1.2.3