[Scummvm-cvs-logs] scummvm master -> c280824b2d749be01e7346597d28da04419b5798

dreammaster dreammaster at scummvm.org
Tue Aug 16 13:18:51 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c280824b2d TSAGE: Completed Blue Force Scene #100


Commit: c280824b2d749be01e7346597d28da04419b5798
    https://github.com/scummvm/scummvm/commit/c280824b2d749be01e7346597d28da04419b5798
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-08-16T04:15:18-07:00

Commit Message:
TSAGE: Completed Blue Force Scene #100

Changed paths:
    engines/tsage/blue_force/blueforce_logic.cpp
    engines/tsage/blue_force/blueforce_scenes1.cpp
    engines/tsage/blue_force/blueforce_scenes1.h
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp
    engines/tsage/graphics.h
    engines/tsage/scenes.cpp
    engines/tsage/staticres.cpp
    engines/tsage/staticres.h



diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp
index 0238475..ec85e48 100644
--- a/engines/tsage/blue_force/blueforce_logic.cpp
+++ b/engines/tsage/blue_force/blueforce_logic.cpp
@@ -186,7 +186,7 @@ void SceneExt::postInit(SceneObjectList *OwnerList) {
 	Scene::postInit(OwnerList);
 	if (BF_GLOBALS._v4CEA2) {
 		// Blank out the bottom portion of the screen
-		BF_GLOBALS._v51C24 = BF_INTERFACE_Y;
+		BF_GLOBALS._interfaceY = BF_INTERFACE_Y;
 
 		Rect r(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT);
 		BF_GLOBALS.gfxManager().getSurface().fillRect(r, 0);
diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp
index e5d66bc..650b63c 100644
--- a/engines/tsage/blue_force/blueforce_scenes1.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes1.cpp
@@ -36,6 +36,17 @@ namespace BlueForce {
  *
  *--------------------------------------------------------------------------*/
 
+void Scene100::Text::dispatch() {
+	SceneText::dispatch();
+
+	// Keep the second text string below the first one
+	Scene100 *scene = (Scene100 *)BF_GLOBALS._sceneManager._scene;
+	Common::Point &pt = scene->_action1._sceneText1._position;
+	scene->_action1._sceneText2.setPosition(Common::Point(pt.x, 
+		pt.y + scene->_action1._textHeight));
+}
+
+
 void Scene100::Action1::signal() {
 	static byte black[3] = { 0, 0, 0 };
 
@@ -46,9 +57,10 @@ void Scene100::Action1::signal() {
 		break;
 	case 1: {
 		Common::String msg1 = _resourceManager->getMessage(100, _state++);
-		if (!msg1.compareTo("LASTCREDIT")) {
+		if (msg1.compareTo("LASTCREDIT")) {
 			Common::String msg2 = _resourceManager->getMessage(100, _state++);
 			setTextStrings(msg1, msg2, this);
+			--_actionIndex;
 		} else {
 			setTextStrings(BF_NAME, BF_ALL_RIGHTS_RESERVED, this);
 			
@@ -76,11 +88,11 @@ void Scene100::Action1::setTextStrings(const Common::String &msg1, const Common:
 	_sceneText1._fontNumber = 10;
 	_sceneText1._width = 160;
 	_sceneText1._textMode = ALIGN_RIGHT;
-	_sceneText1._color1 = _globals->_fontColors.background;
-	_sceneText1._color2 = _globals->_fontColors.foreground;
-	_sceneText1._color3 = _globals->_fontColors.background;
+	_sceneText1._color1 = BF_GLOBALS._scenePalette._colors.foreground;
+	_sceneText1._color2 = BF_GLOBALS._scenePalette._colors.background;
+	_sceneText1._color3 = BF_GLOBALS._scenePalette._colors.foreground;
 	_sceneText1.setup(msg1);
-	_sceneText1.fixPriority(-1);
+	_sceneText1.fixPriority(255);
 	_sceneText1.setPosition(Common::Point(
 		(SCREEN_WIDTH - _sceneText1.getFrame().getBounds().width()) / 2, 202));
 	_sceneText1._moveRate = 30;
@@ -90,11 +102,11 @@ void Scene100::Action1::setTextStrings(const Common::String &msg1, const Common:
 	_sceneText2._fontNumber = 10;
 	_sceneText2._width = _sceneText1._width;
 	_sceneText2._textMode = _sceneText1._textMode;
-	_sceneText2._color1 = _globals->_fontColors.background;
-	_sceneText2._color2 = _globals->_fontColors.foreground;
-	_sceneText2._color3 = _globals->_fontColors.background;
-	_sceneText2.setup(msg1);
-	_sceneText2.fixPriority(-1);
+	_sceneText2._color1 = _sceneText1._color1;
+	_sceneText2._color2 = 31;
+	_sceneText2._color3 = _sceneText1._color3;
+	_sceneText2.setup(msg2);
+	_sceneText2.fixPriority(255);
 	GfxSurface textSurface = _sceneText2.getFrame();
 	_sceneText2.setPosition(Common::Point((SCREEN_WIDTH - textSurface.getBounds().width()) / 2, 202));
 	_sceneText2._moveRate = 30;
@@ -157,7 +169,7 @@ void Scene100::postInit(SceneObjectList *OwnerList) {
 	BF_GLOBALS._scenePalette.loadPalette(2);
 	BF_GLOBALS._v51C44 = 1;
 	Scene::postInit();
-	BF_GLOBALS._v51C24 = 200;
+	BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
 
 	_globals->_player.enableControl();
 	_globals->_player.hide();
@@ -168,16 +180,13 @@ void Scene100::postInit(SceneObjectList *OwnerList) {
 		// Title
 		loadScene(100);
 		BF_GLOBALS._sound1.play(2);
-//		setAction(&_action2, this);
+		setAction(&_action2, this);
 	} else {
 		// Credits
 		loadScene(101);
 		BF_GLOBALS._sound1.play(118);
-//		setAction(&_action1, this);
+		setAction(&_action1, this);
 	}
-
-	loadScene(20);
-	setZoomPercents(60, 85, 200, 100);
 }
 
 void Scene100::signal() {
diff --git a/engines/tsage/blue_force/blueforce_scenes1.h b/engines/tsage/blue_force/blueforce_scenes1.h
index d6cde0a..0769c6e 100644
--- a/engines/tsage/blue_force/blueforce_scenes1.h
+++ b/engines/tsage/blue_force/blueforce_scenes1.h
@@ -39,12 +39,20 @@ namespace BlueForce {
 using namespace TsAGE;
 
 class Scene100: public SceneExt {
+	/* Support classes */
+	class Text: public SceneText {
+	public:
+		virtual Common::String getClassName() { return "BF100Text"; }
+		virtual void dispatch();
+	};
+
 	/* Actions */
 	class Action1: public ActionExt {
 	private:
 		void setTextStrings(const Common::String &msg1, const Common::String &msg2, Action *action);
 	public:
-		SceneText _sceneText1, _sceneText2;
+		Text _sceneText1;
+		SceneText _sceneText2;
 		int _textHeight;
 
 		virtual Common::String getClassName() { return "BF100Action1"; }
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index ce37004..47c83fc 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -51,7 +51,7 @@ static SavedObject *classFactoryProc(const Common::String &className) {
 /*--------------------------------------------------------------------------*/
 
 Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface),
-		_randomSource("tsage"), _unkColor1(0), _unkColor2(255), _unkColor3(255) {
+		_randomSource("tsage"), _color1(0), _color2(255), _color3(255) {
 	reset();
 	_stripNum = 0;
 	_gfxEdgeAdjust = 3;
@@ -64,18 +64,26 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
 		_fontColors.foreground = 6;
 		_dialogCenter.y = 80;
 		// Workaround in order to use later version of the engine
-		_unkColor1 = _gfxColors.foreground;
-		_unkColor2 = _gfxColors.foreground;
-		_unkColor3 = _gfxColors.foreground;
+		_color1 = _gfxColors.foreground;
+		_color2 = _gfxColors.foreground;
+		_color3 = _gfxColors.foreground;
+	} else if (_vm->getGameID() == GType_BlueForce) {
+		// Blue Force
+		_gfxFontNumber = 0;
+		_gfxColors.background = 89;
+		_gfxColors.foreground = 83;
+		_fontColors.background = 88;
+		_fontColors.foreground = 92;
+		_dialogCenter.y = 165;
 	} else if ((_vm->getGameID() == GType_Ringworld) &&  (_vm->getFeatures() & GF_CD)) {
 		_gfxFontNumber = 50;
 		_gfxColors.background = 53;
 		_gfxColors.foreground = 0;
 		_fontColors.background = 51;
 		_fontColors.foreground = 54;
-		_unkColor1 = 18;
-		_unkColor2 = 18;
-		_unkColor3 = 18;
+		_color1 = 18;
+		_color2 = 18;
+		_color3 = 18;
 	} else {
 		_gfxFontNumber = 50;
 		_gfxColors.background = 53;
@@ -83,9 +91,9 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
 		_fontColors.background = 51;
 		_fontColors.foreground = 54;
 		// Workaround in order to use later version of the engine
-		_unkColor1 = _gfxColors.foreground;
-		_unkColor2 = _gfxColors.foreground;
-		_unkColor3 = _gfxColors.foreground;
+		_color1 = _gfxColors.foreground;
+		_color2 = _gfxColors.foreground;
+		_color3 = _gfxColors.foreground;
 	}
 	_screenSurface.setScreenSurface();
 	_gfxManagers.push_back(&_gfxManagerInstance);
@@ -143,9 +151,9 @@ void Globals::synchronize(Serializer &s) {
 	s.syncAsSint32LE(_fontColors.foreground);
 
 	if (s.getVersion() >= 4) {
-		s.syncAsByte(_unkColor1);
-		s.syncAsByte(_unkColor2);
-		s.syncAsByte(_unkColor3);
+		s.syncAsByte(_color1);
+		s.syncAsByte(_color2);
+		s.syncAsByte(_color3);
 	}
 
 	s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
@@ -172,7 +180,7 @@ void Globals::dispatchSounds() {
 namespace BlueForce {
 
 BlueForceGlobals::BlueForceGlobals(): Globals() {
-	_v51C24 = 0;
+	_interfaceY = 0;
 	_v51C44 = 1;
 	_v4CEA2 = 0;
 }
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index b581294..c8cfc1c 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -54,7 +54,7 @@ public:
 	int _gfxFontNumber;
 	GfxColors _gfxColors;
 	GfxColors _fontColors;
-	byte _unkColor1, _unkColor2, _unkColor3;
+	byte _color1, _color2, _color3;
 	SoundManager _soundManager;
 	Common::Point _dialogCenter;
 	WalkRegions _walkRegions;
@@ -99,7 +99,7 @@ public:
 extern Globals *_globals;
 
 #define GLOBALS (*_globals)
-#define BF_GLOBALS (*((BlueForceGlobals *)_globals))
+#define BF_GLOBALS (*((::TsAGE::BlueForce::BlueForceGlobals *)_globals))
 
 // Note: Currently this can't be part of the _globals structure, since it needs to be constructed
 // prior to many of the fields in Globals execute their constructors
@@ -119,7 +119,7 @@ public:
 	int _v501FC;
 	int _v51C42;
 	int _v51C44;
-	int _v51C24;
+	int _interfaceY;
 
 	BlueForceGlobals();
 	virtual Common::String getClassName() { return "BFGlobals"; }
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 7e09946..1884bfb 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -626,9 +626,9 @@ void GfxElement::setDefaults() {
 	_fontNumber = _globals->_gfxFontNumber;
 	_colors = _globals->_gfxColors;
 	_fontColors = _globals->_fontColors;
-	_unkColor1 = _globals->_unkColor1;
-	_unkColor2 = _globals->_unkColor2;
-	_unkColor3 = _globals->_unkColor3;
+	_color1 = _globals->_color1;
+	_color2 = _globals->_color2;
+	_color3 = _globals->_color3;
 }
 
 /**
@@ -824,9 +824,9 @@ void GfxMessage::draw() {
 	gfxManager.setFillFlag(false);
 	gfxManager._font.setFontNumber(_fontNumber);
 
-	gfxManager._font._colors.foreground = this->_unkColor1;
-	gfxManager._font._colors2.background = this->_unkColor2;
-	gfxManager._font._colors2.foreground = this->_unkColor3;
+	gfxManager._font._colors.foreground = this->_color1;
+	gfxManager._font._colors2.background = this->_color2;
+	gfxManager._font._colors2.foreground = this->_color3;
 
 	// Display the text
 	gfxManager._font.writeLines(_message.c_str(), _bounds, _textAlign);
@@ -867,9 +867,9 @@ void GfxButton::draw() {
 	gfxManager._font.setFontNumber(_fontNumber);
 
 	//
-	gfxManager._font._colors.foreground = this->_unkColor1;
-	gfxManager._font._colors2.background = this->_unkColor2;
-	gfxManager._font._colors2.foreground = this->_unkColor3;
+	gfxManager._font._colors.foreground = this->_color1;
+	gfxManager._font._colors2.background = this->_color2;
+	gfxManager._font._colors2.foreground = this->_color3;
 
 	// Display the button's text
 	Rect tempRect(_bounds);
diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h
index 45b5361..06b482d 100644
--- a/engines/tsage/graphics.h
+++ b/engines/tsage/graphics.h
@@ -177,7 +177,7 @@ public:
 	uint16 _fontNumber;
 	GfxColors _colors;
 	GfxColors _fontColors;
-	byte _unkColor1, _unkColor2, _unkColor3;
+	byte _color1, _color2, _color3;
 	uint16 _keycode;
 public:
 	GfxElement();
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index 181a927..53e48a1 100644
--- a/engines/tsage/scenes.cpp
+++ b/engines/tsage/scenes.cpp
@@ -424,6 +424,11 @@ void Scene::refreshBackground(int xAmount, int yAmount) {
 								(xSectionSrc + 1) * 160, (ySectionSrc + 1) * 100);
 						Rect destBounds(xSectionDest * 160, ySectionDest * 100,
 								(xSectionDest + 1) * 160, (ySectionDest + 1) * 100);
+						if (_vm->getGameID() == GType_BlueForce) {
+							// For Blue Force, if the scene has an interface area, exclude it from the copy
+							srcBounds.bottom = MIN<int16>(srcBounds.bottom, BF_GLOBALS._interfaceY);
+							destBounds.bottom = MIN<int16>(destBounds.bottom, BF_GLOBALS._interfaceY);
+						}
 
 						_backSurface.copyFrom(_backSurface, srcBounds, destBounds);
 					}
diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp
index 62a22cb..deb6fd6 100644
--- a/engines/tsage/staticres.cpp
+++ b/engines/tsage/staticres.cpp
@@ -73,7 +73,6 @@ const char *SAVE_ERROR_MSG = "Error occurred saving game. Please do not try to r
 const char *SAVING_NOT_ALLOWED_MSG = "Saving is not allowed at this time.";
 const char *RESTORING_NOT_ALLOWED_MSG = "Restoring is not allowed at this time.";
 const char *RESTART_CONFIRM_MSG = "Do you want to restart your game?";
-const char *WATCH_INTRO_MSG = "Do you wish to watch the introduction?";
 const char *INV_EMPTY_MSG = "You have nothing in your possesion.";
 
 const char *HELP_MSG = "Ringworld\rRevenge of the Patriarch\x14\rScummVM Version\r\r\
@@ -93,12 +92,16 @@ const char *SOUND_BTN_STRING = "Sound";
 const char *RESUME_BTN_STRING = " Resume \rplay";
 const char *LOOK_BTN_STRING = "Look";
 const char *PICK_BTN_STRING = "Pick";
-const char *START_PLAY_BTN_STRING = " Start Play ";
-const char *INTRODUCTION_BTN_STRING = "Introduction";
 
 
 namespace Ringworld {
 
+// Dialog resources
+const char *WATCH_INTRO_MSG = "Do you wish to watch the introduction?";
+const char *START_PLAY_BTN_STRING = " Start Play ";
+const char *INTRODUCTION_BTN_STRING = "Introduction";
+
+// Scene specific resources
 const char *EXIT_MSG = "   EXIT   ";
 const char *SCENE6100_CAREFUL = "Be careful! The probe cannot handle too much of that.";
 const char *SCENE6100_TOUGHER = "Hey! This is tougher than it looks!";
@@ -125,6 +128,11 @@ const char *DEMO_RESUME_BTN_STRING = "Resume";
 
 namespace BlueForce {
 
+// Dialog resources
+const char *WATCH_INTRO_MSG = "Do you wish to watch the introduction?";
+const char *START_PLAY_BTN_STRING = " Play ";
+const char *INTRODUCTION_BTN_STRING = " Watch ";
+
 // Blue Force general messages
 const char *BF_NAME = "Blue Force";
 const char *BF_COPYRIGHT = " Copyright, 1993 Tsunami Media, Inc.";
diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h
index 702e767..290d627 100644
--- a/engines/tsage/staticres.h
+++ b/engines/tsage/staticres.h
@@ -40,7 +40,6 @@ extern const char *SAVE_ERROR_MSG;
 extern const char *SAVING_NOT_ALLOWED_MSG;
 extern const char *RESTORING_NOT_ALLOWED_MSG;
 extern const char *RESTART_CONFIRM_MSG;
-extern const char *WATCH_INTRO_MSG;
 
 // Dialogs
 extern const char *HELP_MSG;
@@ -59,11 +58,14 @@ extern const char *RESUME_BTN_STRING;
 extern const char *LOOK_BTN_STRING;
 extern const char *PICK_BTN_STRING;
 extern const char *INV_EMPTY_MSG;
-extern const char *START_PLAY_BTN_STRING;
-extern const char *INTRODUCTION_BTN_STRING;
 
 namespace Ringworld {
 
+// Dialog resources
+extern const char *WATCH_INTRO_MSG;
+extern const char *START_PLAY_BTN_STRING;
+extern const char *INTRODUCTION_BTN_STRING;
+
 // Scene specific resources
 extern const char *EXIT_MSG;
 extern const char *SCENE6100_CAREFUL;
@@ -92,6 +94,11 @@ extern const char *DEMO_RESUME_BTN_STRING;
 
 namespace BlueForce {
 
+// Dialog resources
+extern const char *WATCH_INTRO_MSG;
+extern const char *START_PLAY_BTN_STRING;
+extern const char *INTRODUCTION_BTN_STRING;
+
 // Blue Force messages
 extern const char *BF_NAME;
 extern const char *BF_COPYRIGHT;






More information about the Scummvm-git-logs mailing list