[Scummvm-cvs-logs] SF.net SVN: scummvm:[52902] scummvm/trunk

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Sun Sep 26 13:32:52 CEST 2010


Revision: 52902
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52902&view=rev
Author:   strangerke
Date:     2010-09-26 11:32:52 +0000 (Sun, 26 Sep 2010)

Log Message:
-----------
HUGO: Add H1 Dos intro

Modified Paths:
--------------
    scummvm/trunk/dists/engine-data/hugo.dat
    scummvm/trunk/engines/hugo/display.cpp
    scummvm/trunk/engines/hugo/display.h
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/intro.cpp

Modified: scummvm/trunk/dists/engine-data/hugo.dat
===================================================================
(Binary files differ)

Modified: scummvm/trunk/engines/hugo/display.cpp
===================================================================
--- scummvm/trunk/engines/hugo/display.cpp	2010-09-26 11:27:08 UTC (rev 52901)
+++ scummvm/trunk/engines/hugo/display.cpp	2010-09-26 11:32:52 UTC (rev 52902)
@@ -410,6 +410,38 @@
 	           "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) {
 }
 

Modified: scummvm/trunk/engines/hugo/display.h
===================================================================
--- scummvm/trunk/engines/hugo/display.h	2010-09-26 11:27:08 UTC (rev 52901)
+++ scummvm/trunk/engines/hugo/display.h	2010-09-26 11:32:52 UTC (rev 52902)
@@ -49,6 +49,8 @@
 	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 @@
 	viewdib_t &getBackBuffer() {
 		return _backBuffer;
 	}
+
 	viewdib_t &getBackBufferBackup() {
 		return _backBufferBackup;
 	}
+
 	viewdib_t &getFrontBuffer() {
 		return _frontBuffer;
 	}
+
 	viewdib_t &getGUIBuffer() {
 		return _GUIBuffer;
 	}

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-09-26 11:27:08 UTC (rev 52901)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-09-26 11:32:52 UTC (rev 52902)
@@ -388,15 +388,25 @@
 	_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

Modified: scummvm/trunk/engines/hugo/intro.cpp
===================================================================
--- scummvm/trunk/engines/hugo/intro.cpp	2010-09-26 11:27:08 UTC (rev 52901)
+++ scummvm/trunk/engines/hugo/intro.cpp	2010-09-26 11:32:52 UTC (rev 52902)
@@ -98,6 +98,7 @@
 	_vm.file().readBackground(22); // display screen MAP_3w
 	_vm.screen().displayBackground();
 	introTicks = 0;
+	_vm.screen().loadFont(0);
 //#endif
 }
 
@@ -108,11 +109,6 @@
 // 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::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 @@
 		_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:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list