aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/hugo.cpp
diff options
context:
space:
mode:
authorArnaud Boutonné2010-09-12 22:59:32 +0000
committerArnaud Boutonné2010-09-12 22:59:32 +0000
commit597eed026611eeaab6d992308677fa59b4f18908 (patch)
tree6a983b369c9577b10694ad32f9a79349828f356e /engines/hugo/hugo.cpp
parentf656ed2974175a45a1557300d8db91c1fddbba18 (diff)
downloadscummvm-rg350-597eed026611eeaab6d992308677fa59b4f18908.tar.gz
scummvm-rg350-597eed026611eeaab6d992308677fa59b4f18908.tar.bz2
scummvm-rg350-597eed026611eeaab6d992308677fa59b4f18908.zip
HUGO: Use fonts in HUGO.DAT for the DOS version
This is only a temporary solution, to be replaced by a proper .FON handling. Hugo 2 and 3 (dos) now start. svn-id: r52697
Diffstat (limited to 'engines/hugo/hugo.cpp')
-rw-r--r--engines/hugo/hugo.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 316c16f018..6254488fbe 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -122,6 +122,15 @@ HugoEngine::~HugoEngine() {
free(_defltTunes);
free(_screenStates);
+
+ if (_arrayFont[0])
+ free(_arrayFont[0]);
+
+ if (_arrayFont[1])
+ free(_arrayFont[1]);
+
+ if (_arrayFont[2])
+ free(_arrayFont[2]);
}
GameType HugoEngine::getGameType() const {
@@ -140,7 +149,6 @@ Common::Error HugoEngine::run() {
s_Engine = this;
initGraphics(320, 200, false);
- _screen = new Screen(*this);
_mouseHandler = new MouseHandler(*this);
_inventoryHandler = new InventoryHandler(*this);
_parser = new Parser(*this);
@@ -152,31 +160,37 @@ Common::Error HugoEngine::run() {
_fileManager = new FileManager_v3(*this);
_scheduler = new Scheduler_v2(*this);
_introHandler = new intro_1w(*this);
+ _screen = new Screen(*this);
break;
case 1:
_fileManager = new FileManager_v2(*this);
_scheduler = new Scheduler_v2(*this);
_introHandler = new intro_2w(*this);
+ _screen = new Screen(*this);
break;
case 2:
_fileManager = new FileManager_v2(*this);
_scheduler = new Scheduler_v2(*this);
_introHandler = new intro_3w(*this);
+ _screen = new Screen(*this);
break;
case 3: // H1 DOS
_fileManager = new FileManager_v1(*this);
_scheduler = new Scheduler_v1(*this);
_introHandler = new intro_1d(*this);
+ _screen = new Screen_v2(*this);
break;
case 4:
_fileManager = new FileManager_v2(*this);
_scheduler = new Scheduler_v1(*this);
_introHandler = new intro_2d(*this);
+ _screen = new Screen_v2(*this);
break;
case 5:
_fileManager = new FileManager_v4(*this);
_scheduler = new Scheduler_v2(*this);
_introHandler = new intro_3d(*this);
+ _screen = new Screen_v2(*this);
break;
}
@@ -1332,6 +1346,37 @@ bool HugoEngine::loadHugoDat() {
_alNewscrIndex = numElem;
}
+ for (int j = 0; j < NUM_FONTS; j++)
+ _arrayFont[j] = 0;
+
+ if (_gameVariant > 2) {
+ _arrayFontSize[0] = in.readUint16BE();
+ _arrayFont[0] = (byte *)malloc(sizeof(byte) * _arrayFontSize[0]);
+ for (int j = 0; j < _arrayFontSize[0]; j++)
+ _arrayFont[0][j] = in.readByte();
+
+ _arrayFontSize[1] = in.readUint16BE();
+ _arrayFont[1] = (byte *)malloc(sizeof(byte) * _arrayFontSize[1]);
+ for (int j = 0; j < _arrayFontSize[1]; j++)
+ _arrayFont[1][j] = in.readByte();
+
+ _arrayFontSize[2] = in.readUint16BE();
+ _arrayFont[2] = (byte *)malloc(sizeof(byte) * _arrayFontSize[2]);
+ for (int j = 0; j < _arrayFontSize[2]; j++)
+ _arrayFont[2][j] = in.readByte();
+ } else {
+ numElem = in.readUint16BE();
+ for (int j = 0; j < numElem; j++)
+ in.readByte();
+
+ numElem = in.readUint16BE();
+ for (int j = 0; j < numElem; j++)
+ in.readByte();
+
+ numElem = in.readUint16BE();
+ for (int j = 0; j < numElem; j++)
+ in.readByte();
+ }
return true;
}