aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Boutonné2010-09-26 11:32:52 +0000
committerArnaud Boutonné2010-09-26 11:32:52 +0000
commit20a618045943af4df7ac21d298c4a3db4c414129 (patch)
tree35acd69e51046cbfb6be1ebb53d6d803791d54f6
parent2ab77f2f52942dc57d38e342a4633f74630001aa (diff)
downloadscummvm-rg350-20a618045943af4df7ac21d298c4a3db4c414129.tar.gz
scummvm-rg350-20a618045943af4df7ac21d298c4a3db4c414129.tar.bz2
scummvm-rg350-20a618045943af4df7ac21d298c4a3db4c414129.zip
HUGO: Add H1 Dos intro
svn-id: r52902
-rw-r--r--dists/engine-data/hugo.datbin173531 -> 174175 bytes
-rw-r--r--engines/hugo/display.cpp32
-rw-r--r--engines/hugo/display.h5
-rw-r--r--engines/hugo/hugo.cpp24
-rw-r--r--engines/hugo/intro.cpp128
5 files changed, 173 insertions, 16 deletions
diff --git a/dists/engine-data/hugo.dat b/dists/engine-data/hugo.dat
index 64caee99b5..40898fe987 100644
--- a/dists/engine-data/hugo.dat
+++ b/dists/engine-data/hugo.dat
Binary files differ
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 78f99315c1..ba316e3923 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -410,6 +410,38 @@ void Screen::userHelp() {
"ESC - Return to game");
}
+void Screen::drawShape(int x, int y, int color1, int color2) {
+#define shapeSize 24
+
+ for (int i = 0; i < shapeSize; i++) {
+ for (int j = 0; j < i; j++) {
+ _backBuffer[320 * (y + i) + (x + shapeSize + j - i)] = color1;
+ _frontBuffer[320 * (y + i) + (x + shapeSize + j - i)] = color1;
+ _backBuffer[320 * (y + i) + (x + shapeSize + j)] = color2;
+ _frontBuffer[320 * (y + i) + (x + shapeSize + j)] = color2;
+ _backBuffer[320 * (y + (2 * shapeSize - 1) - i) + (x + shapeSize + j - i)] = color1;
+ _frontBuffer[320 * (y + (2 * shapeSize - 1) - i) + (x + shapeSize + j - i)] = color1;
+ _backBuffer[320 * (y + (2 * shapeSize - 1) - i) + (x + shapeSize + j)] = color2;
+ _frontBuffer[320 * (y + (2 * shapeSize - 1) - i) + (x + shapeSize + j)] = color2;
+ }
+ }
+}
+
+void Screen::drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color) {
+ assert(x1 <= x2);
+ assert(y1 <= y2);
+
+ if (filledFl) {
+ for (int i = y1; i < y2; i++)
+ for (int j = x1; j < x2; j++) {
+ _backBuffer[320 * i + j] = color;
+ _frontBuffer[320 * i + j] = color;
+ }
+ } else {
+ warning("STUB: drawRectangle()");
+ }
+};
+
Screen_v1d::Screen_v1d(HugoEngine &vm) : Screen(vm) {
}
diff --git a/engines/hugo/display.h b/engines/hugo/display.h
index 32519358f2..53e8bdabf9 100644
--- a/engines/hugo/display.h
+++ b/engines/hugo/display.h
@@ -49,6 +49,8 @@ public:
void displayFrame(int sx, int sy, seq_t *seq, bool foreFl);
void displayList(dupdate_t update, ...);
void displayRect(int16 x, int16 y, int16 dx, int16 dy);
+ void drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color);
+ void drawShape(int x, int y, int color1, int color2);
void initDisplay();
virtual void loadFont(int16 fontId) = 0;
void moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2);
@@ -68,12 +70,15 @@ public:
viewdib_t &getBackBuffer() {
return _backBuffer;
}
+
viewdib_t &getBackBufferBackup() {
return _backBufferBackup;
}
+
viewdib_t &getFrontBuffer() {
return _frontBuffer;
}
+
viewdib_t &getGUIBuffer() {
return _GUIBuffer;
}
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 8219e18acf..5243c1e492 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -388,15 +388,25 @@ bool HugoEngine::loadHugoDat() {
_textEngine = loadTexts(in);
// Read textIntro
- _textIntro = loadTexts(in);
+ _textIntro = loadTextsVariante(in, 0);
// Read x_intro and y_intro
- _introXSize = in.readUint16BE();
- _introX = (byte *)malloc(sizeof(byte) * _introXSize);
- _introY = (byte *)malloc(sizeof(byte) * _introXSize);
- for (int i = 0; i < _introXSize; i++) {
- _introX[i] = in.readByte();
- _introY[i] = in.readByte();
+ for (int varnt = 0; varnt < _numVariant; varnt++) {
+ int numRows = in.readUint16BE();
+ if (varnt == _gameVariant) {
+ _introXSize = numRows;
+ _introX = (byte *)malloc(sizeof(byte) * _introXSize);
+ _introY = (byte *)malloc(sizeof(byte) * _introXSize);
+ for (int i = 0; i < _introXSize; i++) {
+ _introX[i] = in.readByte();
+ _introY[i] = in.readByte();
+ }
+ } else {
+ for (int i = 0; i < numRows; i++) {
+ in.readByte();
+ in.readByte();
+ }
+ }
}
// Read textMouse
diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp
index 589897c760..d988b998b2 100644
--- a/engines/hugo/intro.cpp
+++ b/engines/hugo/intro.cpp
@@ -98,6 +98,7 @@ void intro_v3w::introInit() {
_vm.file().readBackground(22); // display screen MAP_3w
_vm.screen().displayBackground();
introTicks = 0;
+ _vm.screen().loadFont(0);
//#endif
}
@@ -108,11 +109,6 @@ bool intro_v3w::introPlay() {
// Called every tick. Returns TRUE when complete
//TODO : Add proper check of story mode
//#if STORY
-// SetBkMode(TRANSPARENT);
-
-// FIXME: This initialization shouldn't be there, as all the fonts should be loaded directly
- _vm.screen().loadFont(0);
-
if (introTicks < introSize) {
// Scale viewport x_intro,y_intro to screen (offsetting y)
_vm.screen().writeStr(_vm._introX[introTicks], _vm._introY[introTicks] - DIBOFF_Y, "x", _TBRIGHTWHITE);
@@ -149,13 +145,128 @@ void intro_v1d::preNewGame() {
}
void intro_v1d::introInit() {
+ introTicks = 0;
}
bool intro_v1d::introPlay() {
- warning("STUB: intro_v1d::introPlay()");
- return true;
+ byte introSize = _vm.getIntroSize();
+ static int state = 0;
+
+ if (introTicks < introSize) {
+ switch (state++) {
+ case 0:
+ _vm.screen().drawRectangle(true, 0, 0, 319, 199, _TMAGENTA);
+ _vm.screen().drawRectangle(true, 10, 10, 309, 189, _TBLACK);
+ break;
+
+ case 1:
+ _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);
+
+ 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);
+
+ if (scumm_stricmp(_boot.distrib, "David P. Gray")) {
+ sprintf(buffer, "Distributed by %s.", _boot.distrib);
+ _vm.screen().writeStr(CENTER, 75, buffer, _TMAGENTA);
+ }
+
+ // HACK: use of SCRIPT size 24-16
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "Hugo's");
+ _vm.screen().writeStr(CENTER, 20, buffer, _TMAGENTA);
+
+ //HACK: use of TROMAN, size 30-24
+ strcpy(buffer, "House of Horrors !");
+ _vm.screen().writeStr(CENTER, 50, buffer, _TLIGHTMAGENTA);
+ break;
+ case 2:
+ _vm.screen().drawRectangle(true, 82, 92, 237, 138, _TBLACK);
+ // HACK: use of TROMAN, size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "S t a r r i n g :");
+ _vm.screen().writeStr(CENTER, 95, buffer, _TMAGENTA);
+ break;
+ case 3:
+ // HACK: use of TROMAN size 20-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "Hugo !");
+ _vm.screen().writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ break;
+ case 4:
+ _vm.screen().drawRectangle(true, 82, 92, 237, 138, _TBLACK);
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "P r o d u c e d b y :");
+ _vm.screen().writeStr(CENTER, 95, buffer, _TMAGENTA);
+ break;
+ case 5:
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "David P Gray !");
+ _vm.screen().writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ break;
+ case 6:
+ _vm.screen().drawRectangle(true, 82, 92, 237, 138, _TBLACK);
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "D i r e c t e d b y :");
+ _vm.screen().writeStr(CENTER, 95, buffer, _TMAGENTA);
+ break;
+ case 7:
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "David P Gray !");
+ _vm.screen().writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ break;
+ case 8:
+ _vm.screen().drawRectangle(true, 82, 92, 237, 138, _TBLACK);
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "M u s i c b y :");
+ _vm.screen().writeStr(CENTER, 95, buffer, _TMAGENTA);
+ break;
+ case 9:
+ // HACK: use of TROMAN size 16-9
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "David P Gray !");
+ _vm.screen().writeStr(CENTER, 115, buffer, _TLIGHTMAGENTA);
+ break;
+ case 10:
+ _vm.screen().drawRectangle(true, 82, 92, 237, 138, _TBLACK);
+ // HACK: use of TROMAN size 20-14
+ _vm.screen().loadFont(2);
+
+ strcpy(buffer, "E n j o y !");
+ _vm.screen().writeStr(CENTER, 100, buffer, _TLIGHTMAGENTA);
+ break;
+ }
+
+ _vm.screen().displayBackground();
+ g_system->updateScreen();
+ g_system->delayMillis(1000);
+ }
+
+ return (++introTicks >= introSize);
}
-//TODO : Add code for intro H2 DOS
+
intro_v2d::intro_v2d(HugoEngine &vm) : IntroHandler(vm) {
}
@@ -238,7 +349,6 @@ bool intro_v3d::introPlay() {
_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: