aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorArnaud Boutonné2011-01-05 22:28:37 +0000
committerArnaud Boutonné2011-01-05 22:28:37 +0000
commit0ac25c43a04508de583b35d6ba7fefb606d44f0a (patch)
treec8db64e6c8fa6186a74363e8bc98442703b13db3 /engines/hugo
parent4e05e450c381b6deb9999ec4122c4d9028d510e2 (diff)
downloadscummvm-rg350-0ac25c43a04508de583b35d6ba7fefb606d44f0a.tar.gz
scummvm-rg350-0ac25c43a04508de583b35d6ba7fefb606d44f0a.tar.bz2
scummvm-rg350-0ac25c43a04508de583b35d6ba7fefb606d44f0a.zip
HUGO: Use Win2 fonts in intro.
Win1 font is loaded too, but fails as it's not yet supported svn-id: r55126
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/intro.h4
-rw-r--r--engines/hugo/intro_v1d.cpp92
-rw-r--r--engines/hugo/intro_v2d.cpp25
-rw-r--r--engines/hugo/intro_v3d.cpp22
-rw-r--r--engines/hugo/intro_v3w.cpp7
-rw-r--r--engines/hugo/menu.cpp1
6 files changed, 92 insertions, 59 deletions
diff --git a/engines/hugo/intro.h b/engines/hugo/intro.h
index f1de01e609..132fd12846 100644
--- a/engines/hugo/intro.h
+++ b/engines/hugo/intro.h
@@ -32,6 +32,7 @@
#ifndef INTRO_H
#define INTRO_H
+#include "graphics/fonts/winfont.h"
namespace Hugo {
@@ -44,6 +45,9 @@ enum seqTextIntro {
class IntroHandler {
public:
IntroHandler(HugoEngine *vm);
+ Graphics::Surface surf;
+ Graphics::WinFont font;
+
virtual ~IntroHandler();
virtual void preNewGame() = 0;
diff --git a/engines/hugo/intro_v1d.cpp b/engines/hugo/intro_v1d.cpp
index 61626e8172..aeed6144be 100644
--- a/engines/hugo/intro_v1d.cpp
+++ b/engines/hugo/intro_v1d.cpp
@@ -48,6 +48,11 @@ void intro_v1d::preNewGame() {
void intro_v1d::introInit() {
introTicks = 0;
+ surf.w = 320;
+ surf.h = 200;
+ surf.pixels = _vm->_screen->getFrontBuffer();
+ surf.pitch = 320;
+ surf.bytesPerPixel = 1;
}
bool intro_v1d::introPlay() {
@@ -65,99 +70,102 @@ bool intro_v1d::introPlay() {
_vm->_screen->drawShape(20, 92,_TLIGHTMAGENTA,_TMAGENTA);
_vm->_screen->drawShape(250,92,_TLIGHTMAGENTA,_TMAGENTA);
- // HACK: use of TROMAN, size 10-5
- _vm->_screen->loadFont(0);
+ // TROMAN, size 10-5
+ if (!font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 8)))
+ error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 8");
char buffer[80];
if (_boot.registered)
strcpy(buffer, "Registered Version");
else
strcpy(buffer, "Shareware Version");
- _vm->_screen->writeStr(CENTER, 163, buffer, _TLIGHTMAGENTA);
- _vm->_screen->writeStr(CENTER, 176, COPYRIGHT, _TLIGHTMAGENTA);
+
+ font.drawString(&surf, buffer, 0, 163, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
+ font.drawString(&surf, COPYRIGHT, 0, 176, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
if (scumm_stricmp(_boot.distrib, "David P. Gray")) {
sprintf(buffer, "Distributed by %s.", _boot.distrib);
- _vm->_screen->writeStr(CENTER, 75, buffer, _TMAGENTA);
+ font.drawString(&surf, buffer, 0, 75, 320, _TMAGENTA, Graphics::kTextAlignCenter);
}
- // HACK: use of SCRIPT size 24-16
- _vm->_screen->loadFont(2);
-
+ // SCRIPT, size 24-16
strcpy(buffer, "Hugo's");
- _vm->_screen->writeStr(CENTER, 20, buffer, _TMAGENTA);
- // HACK: use of TROMAN, size 30-24
+ if (font.loadFromFON("SCRIPT.FON", Graphics::WinFontDirEntry("Script", 16))) {
+ font.drawString(&surf, buffer, 0, 20, 320, _TMAGENTA, Graphics::kTextAlignCenter);
+ } else {
+ // Workaround: SCRIPT.FON doesn't load properly at the moment
+ _vm->_screen->loadFont(2);
+ _vm->_screen->writeStr(CENTER, 20, buffer, _TMAGENTA);
+ }
+
+ // TROMAN, size 30-24
+ if (!font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 24)))
+ error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 24");
+
strcpy(buffer, "House of Horrors !");
- _vm->_screen->writeStr(CENTER, 50, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 50, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
case 2:
_vm->_screen->drawRectangle(true, 82, 92, 237, 138, _TBLACK);
- // HACK: use of TROMAN, size 16-9
- _vm->_screen->loadFont(2);
+
+ // TROMAN, size 16-9
+ if (!font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 10)))
+ error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 10");
strcpy(buffer, "S t a r r i n g :");
- _vm->_screen->writeStr(CENTER, 95, buffer, _TMAGENTA);
+ font.drawString(&surf, buffer, 0, 95, 320, _TMAGENTA, Graphics::kTextAlignCenter);
break;
case 3:
- // HACK: use of TROMAN size 20-9
- _vm->_screen->loadFont(2);
-
+ // TROMAN, size 20-9
strcpy(buffer, "Hugo !");
- _vm->_screen->writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 115, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
case 4:
_vm->_screen->drawRectangle(true, 82, 92, 237, 138, _TBLACK);
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
+ // TROMAN, size 16-9
strcpy(buffer, "P r o d u c e d b y :");
- _vm->_screen->writeStr(CENTER, 95, buffer, _TMAGENTA);
+ font.drawString(&surf, buffer, 0, 95, 320, _TMAGENTA, Graphics::kTextAlignCenter);
break;
case 5:
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
-
+ // TROMAN size 16-9
strcpy(buffer, "David P Gray !");
- _vm->_screen->writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 115, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
case 6:
_vm->_screen->drawRectangle(true, 82, 92, 237, 138, _TBLACK);
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
+ // TROMAN, size 16-9
strcpy(buffer, "D i r e c t e d b y :");
- _vm->_screen->writeStr(CENTER, 95, buffer, _TMAGENTA);
+ font.drawString(&surf, buffer, 0, 95, 320, _TMAGENTA, Graphics::kTextAlignCenter);
break;
case 7:
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
-
+ // TROMAN, size 16-9
strcpy(buffer, "David P Gray !");
- _vm->_screen->writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 115, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
case 8:
_vm->_screen->drawRectangle(true, 82, 92, 237, 138, _TBLACK);
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
+ // TROMAN, size 16-9
strcpy(buffer, "M u s i c b y :");
- _vm->_screen->writeStr(CENTER, 95, buffer, _TMAGENTA);
+ font.drawString(&surf, buffer, 0, 95, 320, _TMAGENTA, Graphics::kTextAlignCenter);
break;
case 9:
- // HACK: use of TROMAN size 16-9
- _vm->_screen->loadFont(2);
-
+ // TROMAN, size 16-9
strcpy(buffer, "David P Gray !");
- _vm->_screen->writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 115, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
case 10:
_vm->_screen->drawRectangle(true, 82, 92, 237, 138, _TBLACK);
- // HACK: use of TROMAN size 20-14
- _vm->_screen->loadFont(2);
+
+ // TROMAN, size 20-14
+ if (!font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 14)))
+ error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 14");
strcpy(buffer, "E n j o y !");
- _vm->_screen->writeStr(CENTER, 100, buffer, _TLIGHTMAGENTA);
+ font.drawString(&surf, buffer, 0, 100, 320, _TLIGHTMAGENTA, Graphics::kTextAlignCenter);
break;
}
diff --git a/engines/hugo/intro_v2d.cpp b/engines/hugo/intro_v2d.cpp
index 0c9f85d1ea..940c686e16 100644
--- a/engines/hugo/intro_v2d.cpp
+++ b/engines/hugo/intro_v2d.cpp
@@ -49,8 +49,14 @@ void intro_v2d::preNewGame() {
}
void intro_v2d::introInit() {
- _vm->_screen->loadFont(0);
+ Graphics::WinFont font;
+
_vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen
+ surf.w = 320;
+ surf.h = 200;
+ surf.pixels = _vm->_screen->getFrontBuffer();
+ surf.pitch = 320;
+ surf.bytesPerPixel = 1;
char buffer[128];
@@ -58,11 +64,24 @@ void intro_v2d::introInit() {
sprintf(buffer, "%s Registered Version", COPYRIGHT);
else
sprintf(buffer, "%s Shareware Version", COPYRIGHT);
- _vm->_screen->writeStr(CENTER, 186, buffer, _TLIGHTRED);
+
+ // TROMAN, size 10-5
+ if (font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 8))) {
+ font.drawString(&surf, buffer, 0, 186, 320, _TLIGHTRED, Graphics::kTextAlignCenter);
+ } else {
+ _vm->_screen->loadFont(0);
+ _vm->_screen->writeStr(CENTER, 186, buffer, _TLIGHTRED);
+ }
if (scumm_stricmp(_boot.distrib, "David P. Gray")) {
sprintf(buffer, "Distributed by %s.", _boot.distrib);
- _vm->_screen->writeStr(CENTER, 1, buffer, _TLIGHTRED);
+ // TROMAN, size 10-5
+ if (font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 8))) {
+ font.drawString(&surf, buffer, 0, 1, 320, _TLIGHTRED, Graphics::kTextAlignCenter);
+ } else {
+ _vm->_screen->loadFont(0);
+ _vm->_screen->writeStr(CENTER, 1, buffer, _TLIGHTRED);
+ }
}
_vm->_screen->displayBackground();
diff --git a/engines/hugo/intro_v3d.cpp b/engines/hugo/intro_v3d.cpp
index 87dca946f5..1f1b1609eb 100644
--- a/engines/hugo/intro_v3d.cpp
+++ b/engines/hugo/intro_v3d.cpp
@@ -50,8 +50,12 @@ void intro_v3d::preNewGame() {
}
void intro_v3d::introInit() {
- _vm->_screen->loadFont(0);
_vm->_file->readBackground(_vm->_numScreens - 1); // display splash screen
+ surf.w = 320;
+ surf.h = 200;
+ surf.pixels = _vm->_screen->getFrontBuffer();
+ surf.pitch = 320;
+ surf.bytesPerPixel = 1;
char buffer[128];
if (_boot.registered)
@@ -59,11 +63,15 @@ void intro_v3d::introInit() {
else
sprintf(buffer,"%s Shareware Version", COPYRIGHT);
- _vm->_screen->writeStr(CENTER, 190, buffer, _TBROWN);
+ // TROMAN, size 10-5
+ if (!font.loadFromFON("TMSRB.FON", Graphics::WinFontDirEntry("Tms Rmn", 8)))
+ error("Unable to load font TMSRB.FON, face 'Tms Rmn', size 8");
+
+ font.drawString(&surf, buffer, 0, 190, 320, _TBROWN, Graphics::kTextAlignCenter);
if (scumm_stricmp(_boot.distrib, "David P. Gray")) {
sprintf(buffer, "Distributed by %s.", _boot.distrib);
- _vm->_screen->writeStr(CENTER, 0, buffer, _TBROWN);
+ font.drawString(&surf, buffer, 0, 0, 320, _TBROWN, Graphics::kTextAlignCenter);
}
_vm->_screen->displayBackground();
@@ -80,12 +88,10 @@ void intro_v3d::introInit() {
* Called every tick. Returns TRUE when complete
*/
bool intro_v3d::introPlay() {
- byte introSize = _vm->getIntroSize();
-
//TODO : Add proper check of story mode
//#if STORY
- if (introTicks < introSize) {
- _vm->_screen->writeStr(_vm->_introX[introTicks], _vm->_introY[introTicks] - DIBOFF_Y, "x", _TBRIGHTWHITE);
+ if (introTicks < _vm->getIntroSize()) {
+ font.drawString(&surf, "x", _vm->_introX[introTicks], _vm->_introY[introTicks] - DIBOFF_Y, 320, _TBRIGHTWHITE);
_vm->_screen->displayBackground();
// Text boxes at various times
@@ -102,7 +108,7 @@ bool intro_v3d::introPlay() {
}
}
- return (++introTicks >= introSize);
+ return (++introTicks >= _vm->getIntroSize());
//#else //STORY
// return true;
//#endif //STORY
diff --git a/engines/hugo/intro_v3w.cpp b/engines/hugo/intro_v3w.cpp
index 0dcfac0b6e..a938d89b09 100644
--- a/engines/hugo/intro_v3w.cpp
+++ b/engines/hugo/intro_v3w.cpp
@@ -73,16 +73,13 @@ void intro_v3w::introInit() {
* Called every tick. Returns TRUE when complete
*/
bool intro_v3w::introPlay() {
- byte introSize = _vm->getIntroSize();
-
//TODO : Add proper check of story mode
//#if STORY
- if (introTicks < introSize) {
+ if (introTicks < _vm->getIntroSize()) {
// Scale viewport x_intro,y_intro to screen (offsetting y)
_vm->_screen->writeStr(_vm->_introX[introTicks], _vm->_introY[introTicks] - DIBOFF_Y, "x", _TBRIGHTWHITE);
_vm->_screen->displayBackground();
-
// Text boxes at various times
switch (introTicks) {
case 4:
@@ -97,7 +94,7 @@ bool intro_v3w::introPlay() {
}
}
- return (++introTicks >= introSize);
+ return (++introTicks >= _vm->getIntroSize());
//#else //STORY
// return true;
//#endif //STORY
diff --git a/engines/hugo/menu.cpp b/engines/hugo/menu.cpp
index 2bb3ec2c91..d4962a9aca 100644
--- a/engines/hugo/menu.cpp
+++ b/engines/hugo/menu.cpp
@@ -201,7 +201,6 @@ void TopMenu::handleCommand(GUI::CommandSender *sender, uint32 command, uint32 d
}
break;
case kCmdRecall:
-
close();
_vm->getGameStatus().recallFl = true;
break;