[Scummvm-cvs-logs] scummvm master -> 6ffbbc8ab247b5d61ab02ae7944bdeeafecac280

urukgit urukgit at users.noreply.github.com
Tue Feb 11 23:13:39 CET 2014


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:
6ffbbc8ab2 AVALANCHE: Move/rename/implement Help::plotButton().


Commit: 6ffbbc8ab247b5d61ab02ae7944bdeeafecac280
    https://github.com/scummvm/scummvm/commit/6ffbbc8ab247b5d61ab02ae7944bdeeafecac280
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-11T14:10:16-08:00

Commit Message:
AVALANCHE: Move/rename/implement Help::plotButton().

Changed paths:
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/help.cpp
    engines/avalanche/help.h



diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9a6e48c..ec1446d 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -653,6 +653,40 @@ void GraphicManager::ghostDrawBackgroundItems(Common::File &file) {
 }
 
 /**
+* @remarks	Originally called 'plot_button'
+*/
+void GraphicManager::helpDrawButton(int y, byte which) {
+	if (y > 200) {
+		_vm->_graphics->setBackgroundColor(kColorGreen);
+		_vm->_system->delayMillis(10);
+		_vm->_graphics->setBackgroundColor(kColorBlack);
+		return;
+	}
+
+	Common::File file;
+
+	if (!file.open("buttons.avd"))
+		error("AVALANCHE: Help: File not found: buttons.avd");
+
+	file.seek(which * 930); // 930 is the size of one button.
+
+	Graphics::Surface button = loadPictureGraphic(file);
+
+	int x = 0;
+	if (y == -177) {
+		x = 229;
+		y = 5;
+	}
+	else
+		x = 470;
+
+	_vm->_graphics->drawPicture(_surface, button, x, y);
+
+	button.free();
+	file.close();
+}
+
+/**
  * This function mimics Pascal's getimage().
  */
 Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) {
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 71f1a09..8e74b18 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -103,6 +103,9 @@ public:
 	void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY);
 	void ghostDrawBackgroundItems(Common::File &file);
 
+	// Help's function:
+	void helpDrawButton(int y, byte which);
+
 	void clearAlso();
 	void clearTextBar();
 	void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp
index a34ac4c..c75be19 100644
--- a/engines/avalanche/help.cpp
+++ b/engines/avalanche/help.cpp
@@ -38,11 +38,8 @@ Help::Help(AvalancheEngine *vm) {
 	_highlightWas = 0;
 }
 
-void Help::plotButton(int8 y, byte which) {
-	warning("STUB: Help::plotButton()");
-}
-
 void Help::getMe(byte which) {
+	// Help icons are 80x20.
 	
 	_highlightWas = 177; // Forget where the highlight was.
 
@@ -61,7 +58,7 @@ void Help::getMe(byte which) {
 	_vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 450, 200), kColorWhite);
 
 	byte index = file.readByte();
-	plotButton(-177, index);
+	_vm->_graphics->helpDrawButton(-177, index);
 
 	// Plot the title:
 	_vm->_graphics->drawNormalText(title, _vm->_font, 8, 629 - 8 * title.size(), 26, kColorBlack);
diff --git a/engines/avalanche/help.h b/engines/avalanche/help.h
index 912927a..f2d02f3 100644
--- a/engines/avalanche/help.h
+++ b/engines/avalanche/help.h
@@ -49,7 +49,6 @@ private:
 	Button _buttons[10];
 	byte _highlightWas;
 
-	void plotButton(int8 y, byte which);
 	void getMe(byte which);
 	Common::String getLine(Common::File &file); // It was a nested function in getMe().
 	byte checkMouse(); // Returns clicked-on button, or 0 if none.






More information about the Scummvm-git-logs mailing list