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

dreammaster dreammaster at scummvm.org
Mon Aug 29 14:05:41 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:
a28bffec1c TSAGE: Implemented the Blue Force right-click dialog


Commit: a28bffec1cf37517f3dd9d7fda7ad511c921a7db
    https://github.com/scummvm/scummvm/commit/a28bffec1cf37517f3dd9d7fda7ad511c921a7db
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-08-29T05:01:11-07:00

Commit Message:
TSAGE: Implemented the Blue Force right-click dialog

Changed paths:
  A engines/tsage/blue_force/blueforce_dialogs.cpp
  A engines/tsage/blue_force/blueforce_dialogs.h
    engines/tsage/blue_force/blueforce_logic.cpp
    engines/tsage/blue_force/blueforce_logic.h
    engines/tsage/core.cpp
    engines/tsage/core.h
    engines/tsage/dialogs.cpp
    engines/tsage/dialogs.h
    engines/tsage/events.cpp
    engines/tsage/graphics.cpp
    engines/tsage/module.mk
    engines/tsage/ringworld/ringworld_logic.cpp
    engines/tsage/ringworld/ringworld_logic.h
    engines/tsage/scenes.h



diff --git a/engines/tsage/blue_force/blueforce_dialogs.cpp b/engines/tsage/blue_force/blueforce_dialogs.cpp
new file mode 100644
index 0000000..ec99df8
--- /dev/null
+++ b/engines/tsage/blue_force/blueforce_dialogs.cpp
@@ -0,0 +1,201 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/translation.h"
+
+#include "gui/dialog.h"
+#include "gui/widget.h"
+
+#include "tsage/tsage.h"
+#include "tsage/core.h"
+#include "tsage/dialogs.h"
+#include "tsage/staticres.h"
+#include "tsage/globals.h"
+#include "tsage/blue_force/blueforce_dialogs.h"
+#include "tsage/ringworld/ringworld_logic.h"
+
+namespace TsAGE {
+
+namespace BlueForce {
+
+/**
+ * This dialog implements the right-click dialog
+ */
+RightClickDialog::RightClickDialog() : GfxDialog() {
+	// Setup button areas
+	_rectList1[0] = Rect(7, 50, 41, 67);
+	_rectList1[1] = Rect(13, 27, 50, 50);
+	_rectList1[2] = Rect(49, 27, 84, 50);
+	_rectList1[3] = Rect(56, 50, 90, 67);
+	_rectList1[4] = Rect(26, 68, 69, 99);
+
+	_rectList3[0] = Rect(12, 49, 27, 64);
+	_rectList3[1] = Rect(27, 31, 42, 46);
+	_rectList3[2] = Rect(56, 31, 71, 46);
+	_rectList3[3] = Rect(72, 50, 87, 65);
+	_rectList3[4] = Rect(41, 81, 56, 96);
+
+	// Set the palette and change the cursor
+	GfxSurface cursor = surfaceFromRes(1, 5, 9);
+	BF_GLOBALS._events.setCursor(cursor);
+
+	setPalette();
+
+	// Get the dialog image
+	_surface = surfaceFromRes(1, 1, 1);
+
+	// Set the dialog position
+	Rect dialogRect;
+	dialogRect.resize(_surface, 0, 0, 100);
+	dialogRect.center(_globals->_events._mousePos.x, _globals->_events._mousePos.y);
+
+	// Ensure the dialog will be entirely on-screen
+	Rect screenRect = _globals->gfxManager()._bounds;
+	screenRect.collapse(4, 4);
+	dialogRect.contain(screenRect);
+
+	// Load selected button images
+	_btnImages.setVisage(1, 2);
+
+	_bounds = dialogRect;
+	_gfxManager._bounds = _bounds;
+
+	_highlightedAction = -1;
+	_selectedAction = -1;
+}
+
+RightClickDialog::~RightClickDialog() {
+}
+
+void RightClickDialog::draw() {
+	// Save the covered background area
+	_savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds);
+
+	// Draw the dialog image
+	_globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top);
+
+	// Pre-process rect lists
+	for (int idx = 0; idx < 5; ++idx) {
+		_rectList2[idx] = _rectList1[idx];
+		_rectList4[idx] = _rectList3[idx];
+
+		_rectList2[idx].translate(_bounds.left, _bounds.top);
+		_rectList4[idx].translate(_bounds.left, _bounds.top);
+	}
+}
+
+bool RightClickDialog::process(Event &event) {
+	switch (event.eventType) {
+	case EVENT_MOUSE_MOVE: {
+		// Check whether a button is highlighted
+		int buttonIndex = 0;
+		while ((buttonIndex < 5) && !_rectList1[buttonIndex].contains(event.mousePos))
+			++buttonIndex;
+		if (buttonIndex == 5)
+			buttonIndex = -1;
+
+		// If selection has changed, handle it
+		if (buttonIndex != _highlightedAction) {
+			if (_highlightedAction != -1) {
+				// Another button was previously selected, so restore dialog
+				_gfxManager.copyFrom(_surface, 0, 0);
+			}
+
+			if (buttonIndex != -1) {
+				// Draw newly selected button
+				GfxSurface btn = _btnImages.getFrame(buttonIndex + 1);
+				_gfxManager.copyFrom(btn, _rectList3[buttonIndex].left, _rectList3[buttonIndex].top);
+			}
+
+			_highlightedAction = buttonIndex;
+		}
+
+		event.handled = true;
+		return true;
+	}
+
+	case EVENT_BUTTON_DOWN:
+		// Specify the selected action
+		_selectedAction = (_highlightedAction == -1) ? 5 : _highlightedAction;
+		event.handled = true;
+		return true;
+
+	default:
+		break;
+	}
+
+	return false;
+}
+
+void RightClickDialog::execute() {
+	// Draw the dialog
+	draw();
+
+	// Dialog event handler loop
+	_gfxManager.activate();
+
+	while (!_vm->shouldQuit() && (_selectedAction == -1)) {
+		Event evt;
+		while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) {
+			evt.mousePos.x -= _bounds.left;
+			evt.mousePos.y -= _bounds.top;
+
+			process(evt);
+		}
+
+		g_system->delayMillis(10);
+		g_system->updateScreen();
+	}
+
+	// Execute the specified action
+	CursorType cursorNum = CURSOR_NONE;
+	switch (_selectedAction) {
+	case 0:
+		// Walk action
+		cursorNum = BF_GLOBALS._player._canWalk ? CURSOR_WALK : CURSOR_USE;
+		break;
+	case 1:
+		// Use action
+		cursorNum = CURSOR_USE;
+		break;
+	case 2:
+		// Look action
+		cursorNum = CURSOR_LOOK;
+		break;
+	case 3:
+		// Talk action
+		cursorNum = CURSOR_TALK;
+		break;
+	case 4:
+		// Options dialog
+		break;
+	}
+
+	if (cursorNum != CURSOR_NONE)
+		BF_GLOBALS._events.setCursor(cursorNum);
+
+	_gfxManager.deactivate();
+}
+
+} // End of namespace BlueForce
+
+} // End of namespace TsAGE
diff --git a/engines/tsage/blue_force/blueforce_dialogs.h b/engines/tsage/blue_force/blueforce_dialogs.h
new file mode 100644
index 0000000..1ead39a
--- /dev/null
+++ b/engines/tsage/blue_force/blueforce_dialogs.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TSAGE_BLUEFORCE_DIALOGS_H
+#define TSAGE_BLUEFORCE_DIALOGS_H
+
+#include "gui/options.h"
+#include "tsage/events.h"
+#include "tsage/graphics.h"
+#include "common/list.h"
+#include "common/rect.h"
+#include "common/system.h"
+
+namespace TsAGE {
+
+namespace BlueForce {
+
+class RightClickDialog : public GfxDialog {
+private:
+	GfxSurface _surface;
+	Visage _btnImages;
+	Rect _rectList1[5];
+	Rect _rectList2[5];
+	Rect _rectList3[5];
+	Rect _rectList4[5];
+
+	int _highlightedAction;
+	int _selectedAction;
+public:
+	RightClickDialog();
+	~RightClickDialog();
+
+	virtual void draw();
+	virtual bool process(Event &event);
+	void execute();
+};
+
+} // End of namespace BlueForce
+
+} // End of namespace TsAGE
+
+#endif
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp
index 9c7d66a..985a157 100644
--- a/engines/tsage/blue_force/blueforce_logic.cpp
+++ b/engines/tsage/blue_force/blueforce_logic.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "tsage/blue_force/blueforce_logic.h"
+#include "tsage/blue_force/blueforce_dialogs.h"
 #include "tsage/blue_force/blueforce_scenes0.h"
 #include "tsage/blue_force/blueforce_scenes1.h"
 #include "tsage/blue_force/blueforce_scenes3.h"
@@ -135,6 +136,12 @@ Scene *BlueForceGame::createScene(int sceneNumber) {
 	}
 }
 
+void BlueForceGame::rightClick() {
+	RightClickDialog *dlg = new RightClickDialog();
+	dlg->execute();
+	delete dlg;
+}
+
 /*--------------------------------------------------------------------------*/
 
 AObjectArray::AObjectArray(): EventHandler() {
diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h
index d756d85..a3bcf9e 100644
--- a/engines/tsage/blue_force/blueforce_logic.h
+++ b/engines/tsage/blue_force/blueforce_logic.h
@@ -41,6 +41,7 @@ class BlueForceGame: public Game {
 public:
 	virtual void start();
 	virtual Scene *createScene(int sceneNumber);
+	virtual void rightClick();
 };
 
 #define OBJ_ARRAY_SIZE 10
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 38fd668..4842284 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -1245,6 +1245,15 @@ void ScenePalette::setPalette(int index, int count) {
 }
 
 /**
+ * Set a palette entry
+ */
+void ScenePalette::setEntry(int index, uint r, uint g, uint b) {
+	_palette[index * 3] = r;
+	_palette[index * 3 + 1] = g;
+	_palette[index * 3 + 2] = b;
+}
+
+/**
  * Returns the palette index with the closest matching color to that specified
  * @param r			R component
  * @param g			G component
@@ -3616,9 +3625,7 @@ void SceneHandler::process(Event &event) {
 	// Check for displaying right-click dialog
 	if ((event.eventType == EVENT_BUTTON_DOWN) && (event.btnState == BTNSHIFT_RIGHT) &&
 			_globals->_player._uiEnabled) {
-		RightClickDialog *dlg = new RightClickDialog();
-		dlg->execute();
-		delete dlg;
+		_globals->_game->rightClick();
 
 		event.handled = true;
 		return;
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index b1cbf74..9cd28b1 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -368,6 +368,7 @@ public:
 	bool loadPalette(int paletteNum);
 	void refresh();
 	void setPalette(int index, int count);
+	void setEntry(int index, uint r, uint g, uint b);
 	uint8 indexOf(uint r, uint g, uint b, int threshold = 0xffff);
 	void getPalette(int start = 0, int count = 256);
 	void signalListeners();
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index ae385b8..d5e7b15 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -109,186 +109,6 @@ ConfigDialog::ConfigDialog() : GUI::OptionsDialog("", "GlobalConfig") {
 
 /*--------------------------------------------------------------------------*/
 
-#define BUTTON_WIDTH 28
-#define BUTTON_HEIGHT 29
-
-RightClickButton::RightClickButton(int buttonIndex, int xp, int yp) : GfxButton() {
-	_buttonIndex = buttonIndex;
-	this->_bounds.left = xp;
-	this->_bounds.top = yp;
-	this->_bounds.setWidth(BUTTON_WIDTH);
-	this->_bounds.setHeight(BUTTON_HEIGHT);
-	_savedButton = NULL;
-}
-
-void RightClickButton::highlight() {
-	if (_savedButton) {
-		// Button was previously highlighted, so de-highlight by restoring saved area
-		_globals->gfxManager().copyFrom(*_savedButton, _bounds.left, _bounds.top);
-		delete _savedButton;
-		_savedButton = NULL;
-	} else {
-		// Highlight button by getting the needed highlighted image resource
-		_savedButton = Surface_getArea(_globals->gfxManager().getSurface(), _bounds);
-
-		uint size;
-		byte *imgData = _resourceManager->getSubResource(7, 2, _buttonIndex, &size);
-
-		GfxSurface btnSelected = surfaceFromRes(imgData);
-		_globals->gfxManager().copyFrom(btnSelected, _bounds.left, _bounds.top);
-
-		DEALLOCATE(imgData);
-	}
-}
-
-/*--------------------------------------------------------------------------*/
-
-/**
- * This dialog implements the right-click dialog
- */
-RightClickDialog::RightClickDialog() : GfxDialog(),
-		_walkButton(1, 48, 12), _lookButton(2, 31, 29), _useButton(3, 65, 29),
-		_talkButton(4, 14, 47), _inventoryButton(5, 48, 47), _optionsButton(6, 83, 47) {
-	Rect rectArea, dialogRect;
-
-	// Set the palette and change the cursor
-	_gfxManager.setDialogPalette();
-	_globals->_events.setCursor(CURSOR_ARROW);
-
-	// Get the dialog image
-	_surface = surfaceFromRes(7, 1, 1);
-
-	// Set the dialog position
-	dialogRect.resize(_surface, 0, 0, 100);
-	dialogRect.center(_globals->_events._mousePos.x, _globals->_events._mousePos.y);
-
-	// Ensure the dialog will be entirely on-screen
-	Rect screenRect = _globals->gfxManager()._bounds;
-	screenRect.collapse(4, 4);
-	dialogRect.contain(screenRect);
-
-	_bounds = dialogRect;
-	_gfxManager._bounds = _bounds;
-
-	_highlightedButton = NULL;
-	_selectedAction = -1;
-}
-
-RightClickDialog::~RightClickDialog() {
-}
-
-RightClickButton *RightClickDialog::findButton(const Common::Point &pt) {
-	RightClickButton *btnList[] = {  &_walkButton, &_lookButton, &_useButton, &_talkButton, &_inventoryButton, &_optionsButton };
-
-	for (int i = 0; i < 6; ++i) {
-		btnList[i]->_owner = this;
-
-		if (btnList[i]->_bounds.contains(pt))
-			return btnList[i];
-	}
-
-	return NULL;
-}
-
-void RightClickDialog::draw() {
-	// Save the covered background area
-	_savedArea = Surface_getArea(_globals->_gfxManagerInstance.getSurface(), _bounds);
-
-	// Draw the dialog image
-	_globals->gfxManager().copyFrom(_surface, _bounds.left, _bounds.top);
-}
-
-bool RightClickDialog::process(Event &event) {
-	switch (event.eventType) {
-	case EVENT_MOUSE_MOVE: {
-		// Check whether a button is highlighted
-		RightClickButton *btn = findButton(event.mousePos);
-
-		if (btn != _highlightedButton) {
-			// De-highlight any previously selected button
-			if (_highlightedButton) {
-				_highlightedButton->highlight();
-				_highlightedButton = NULL;
-			}
-			if (btn) {
-				// Highlight the new button
-				btn->highlight();
-				_highlightedButton = btn;
-			}
-		}
-		event.handled = true;
-		return true;
-	}
-
-	case EVENT_BUTTON_DOWN:
-		// If a button is highlighted, then flag the selected button index
-		if (_highlightedButton)
-			_selectedAction = _highlightedButton->_buttonIndex;
-		else
-			_selectedAction = _lookButton._buttonIndex;
-		event.handled = true;
-		return true;
-
-	default:
-		break;
-	}
-
-	return false;
-}
-
-void RightClickDialog::execute() {
-	// Draw the dialog
-	draw();
-
-	// Dialog event handler loop
-	_gfxManager.activate();
-
-	while (!_vm->shouldQuit() && (_selectedAction == -1)) {
-		Event evt;
-		while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) {
-			evt.mousePos.x -= _bounds.left;
-			evt.mousePos.y -= _bounds.top;
-
-			process(evt);
-		}
-
-		g_system->delayMillis(10);
-		g_system->updateScreen();
-	}
-
-	// Execute the specified action
-	switch (_selectedAction) {
-	case 1:
-		// Look action
-		_globals->_events.setCursor(CURSOR_LOOK);
-		break;
-	case 2:
-		// Walk action
-		_globals->_events.setCursor(CURSOR_WALK);
-		break;
-	case 3:
-		// Use cursor
-		_globals->_events.setCursor(CURSOR_USE);
-		break;
-	case 4:
-		// Talk cursor
-		_globals->_events.setCursor(CURSOR_TALK);
-		break;
-	case 5:
-		// Inventory dialog
-		InventoryDialog::show();
-		break;
-	case 6:
-		// Dialog options
-		OptionsDialog::show();
-		break;
-	}
-
-	_gfxManager.deactivate();
-}
-
-/*--------------------------------------------------------------------------*/
-
 void ModalDialog::draw() {
 	// Set the palette for use in the dialog
 	setPalette();
diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h
index 55adb6c..7355ea1 100644
--- a/engines/tsage/dialogs.h
+++ b/engines/tsage/dialogs.h
@@ -49,35 +49,6 @@ public:
 	ConfigDialog();
 };
 
-class RightClickButton : public GfxButton {
-private:
-	GfxSurface *_savedButton;
-public:
-	int _buttonIndex;
-
-	RightClickButton(int buttonIndex, int xp, int yp);
-	~RightClickButton() { delete _savedButton; }
-
-	virtual void highlight();
-};
-
-class RightClickDialog : public GfxDialog {
-private:
-	GfxSurface _surface;
-	RightClickButton *_highlightedButton;
-	int _selectedAction;
-	RightClickButton _walkButton, _lookButton, _useButton, _talkButton, _inventoryButton, _optionsButton;
-
-	RightClickButton *findButton(const Common::Point &pt);
-public:
-	RightClickDialog();
-	~RightClickDialog();
-
-	virtual void draw();
-	virtual bool process(Event &event);
-	void execute();
-};
-
 /*--------------------------------------------------------------------------*/
 
 class ModalDialog : public GfxDialog {
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index a6471dc..7239383 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -164,19 +164,30 @@ void EventsClass::setCursor(CursorType cursorType) {
 
 	case CURSOR_LOOK:
 		// Look cursor
-		cursor = _resourceManager->getSubResource(4, 1, 5, &size);
+		if (_vm->getGameID() == GType_BlueForce)
+			cursor = _resourceManager->getSubResource(1, 5, 3, &size);
+		else
+			cursor = _resourceManager->getSubResource(4, 1, 5, &size);
 		_currentCursor = CURSOR_LOOK;
 		break;
 
 	case CURSOR_USE:
 		// Use cursor
-		cursor = _resourceManager->getSubResource(4, 1, 4, &size);
+		if (_vm->getGameID() == GType_BlueForce) {
+			cursor = _resourceManager->getSubResource(1, 5, 2, &size);
+		} else {
+			cursor = _resourceManager->getSubResource(4, 1, 4, &size);
+		}
 		_currentCursor = CURSOR_USE;
 		break;
 
 	case CURSOR_TALK:
 		// Talk cursor
-		cursor = _resourceManager->getSubResource(4, 1, 3, &size);
+		if (_vm->getGameID() == GType_BlueForce) {
+			cursor = _resourceManager->getSubResource(1, 5, 4, &size);
+		} else {
+			cursor = _resourceManager->getSubResource(4, 1, 3, &size);
+		}
 		_currentCursor = CURSOR_TALK;
 		break;
 
@@ -189,9 +200,13 @@ void EventsClass::setCursor(CursorType cursorType) {
 	case CURSOR_WALK:
 	default:
 		// Walk cursor
-		cursor = CURSOR_WALK_DATA;
+		if (_vm->getGameID() == GType_BlueForce) {
+			cursor = _resourceManager->getSubResource(1, 5, 1, &size);
+		} else {
+			cursor = CURSOR_WALK_DATA;
+			delFlag = false;
+		}
 		_currentCursor = CURSOR_WALK;
-		delFlag = false;
 		break;
 	}
 
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 1884bfb..69c9995 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -1069,12 +1069,23 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) {
 }
 
 void GfxDialog::setPalette() {
-	_globals->_scenePalette.loadPalette(0);
-	_globals->_scenePalette.setPalette(0, 1);
-	_globals->_scenePalette.setPalette(_globals->_scenePalette._colors.foreground, 1);
-	_globals->_scenePalette.setPalette(_globals->_fontColors.background, 1);
-	_globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1);
-	_globals->_scenePalette.setPalette(255, 1);
+	if (_vm->getGameID() == GType_BlueForce) {
+		_globals->_scenePalette.loadPalette(2);
+		_globals->_scenePalette.setPalette(0, 1);
+		_globals->_scenePalette.setPalette(_globals->_gfxColors.background, 1);
+		_globals->_scenePalette.setPalette(_globals->_gfxColors.foreground, 1);
+		_globals->_scenePalette.setPalette(_globals->_fontColors.background, 1);
+		_globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1);
+		_globals->_scenePalette.setEntry(255, 0xff, 0xff, 0xff);
+		_globals->_scenePalette.setPalette(255, 1);	
+	} else {
+		_globals->_scenePalette.loadPalette(0);
+		_globals->_scenePalette.setPalette(0, 1);
+		_globals->_scenePalette.setPalette(_globals->_scenePalette._colors.foreground, 1);
+		_globals->_scenePalette.setPalette(_globals->_fontColors.background, 1);
+		_globals->_scenePalette.setPalette(_globals->_fontColors.foreground, 1);
+		_globals->_scenePalette.setPalette(255, 1);
+	}
 }
 
 /*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/module.mk b/engines/tsage/module.mk
index ed6fb29..ef71533 100644
--- a/engines/tsage/module.mk
+++ b/engines/tsage/module.mk
@@ -1,6 +1,7 @@
 MODULE := engines/tsage
 
 MODULE_OBJS := \
+	blue_force/blueforce_dialogs.o \
 	blue_force/blueforce_logic.o \
 	blue_force/blueforce_scenes0.o \
 	blue_force/blueforce_scenes1.o \
@@ -16,6 +17,7 @@ MODULE_OBJS := \
 	graphics.o \
 	resources.o \
 	ringworld/ringworld_demo.o \
+	ringworld/ringworld_dialogs.o \
 	ringworld/ringworld_logic.o \
 	ringworld/ringworld_scenes1.o \
 	ringworld/ringworld_scenes2.o \
diff --git a/engines/tsage/ringworld/ringworld_logic.cpp b/engines/tsage/ringworld/ringworld_logic.cpp
index 2a34e49..366076d 100644
--- a/engines/tsage/ringworld/ringworld_logic.cpp
+++ b/engines/tsage/ringworld/ringworld_logic.cpp
@@ -28,6 +28,7 @@
 #include "tsage/tsage.h"
 #include "tsage/staticres.h"
 #include "tsage/ringworld/ringworld_demo.h"
+#include "tsage/ringworld/ringworld_dialogs.h"
 #include "tsage/ringworld/ringworld_scenes1.h"
 #include "tsage/ringworld/ringworld_scenes2.h"
 #include "tsage/ringworld/ringworld_scenes3.h"
@@ -1489,6 +1490,12 @@ void RingworldGame::processEvent(Event &event) {
 	}
 }
 
+void RingworldGame::rightClick() {
+	RightClickDialog *dlg = new RightClickDialog();
+	dlg->execute();
+	delete dlg;
+}
+
 } // End of namespace Ringworld
 
 } // End of namespace TsAGE
diff --git a/engines/tsage/ringworld/ringworld_logic.h b/engines/tsage/ringworld/ringworld_logic.h
index 69e5520..830b283 100644
--- a/engines/tsage/ringworld/ringworld_logic.h
+++ b/engines/tsage/ringworld/ringworld_logic.h
@@ -456,6 +456,7 @@ public:
 
 	virtual Scene *createScene(int sceneNumber);
 	virtual void processEvent(Event &event);
+	virtual void rightClick();
 };
 
 } // End of namespace Ringworld
diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h
index 7e8c26f..793013b 100644
--- a/engines/tsage/scenes.h
+++ b/engines/tsage/scenes.h
@@ -132,6 +132,7 @@ public:
 	virtual void endGame(int resNum, int lineNum) {}
 	virtual Scene *createScene(int sceneNumber) = 0;
 	virtual void processEvent(Event &event) {}
+	virtual void rightClick() {}
 };
 
 } // End of namespace TsAGE






More information about the Scummvm-git-logs mailing list