[Scummvm-cvs-logs] scummvm master -> 0dff818594a67982afbe499898a95937797c33aa

urukgit urukgit at users.noreply.github.com
Mon Mar 3 21:11:37 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:
0dff818594 AVALANCHE: Implement the status leds on the toolbar.


Commit: 0dff818594a67982afbe499898a95937797c33aa
    https://github.com/scummvm/scummvm/commit/0dff818594a67982afbe499898a95937797c33aa
Author: uruk (koppirnyo at gmail.com)
Date: 2014-03-03T12:11:07-08:00

Commit Message:
AVALANCHE: Implement the status leds on the toolbar.

Changed paths:
    engines/avalanche/avalot.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/graphics.h
    engines/avalanche/sound.cpp



diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2e89287..20e16a5 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -201,6 +201,8 @@ void AvalancheEngine::setup() {
 
 	_menu->init();
 
+	_graphics->drawSoundLight(_sound->_soundFl);
+
 	int16 loadSlot = ConfMan.instance().getInt("save_slot");
 	if (loadSlot >= 0) {
 		_thinks = 2; // You always have money.
@@ -210,8 +212,6 @@ void AvalancheEngine::setup() {
 	} else {
 		newGame();
 
-		_soundFx = !_soundFx;
-		fxToggle();
 		thinkAbout(kObjectMoney, kThing);
 
 		_dialogs->displayScrollChain('Q', 83); // Info on the game, etc.
@@ -1155,7 +1155,7 @@ void AvalancheEngine::checkClick() {
 				_animation->_sprites[0]->_speedX = kRun;
 				_animation->updateSpeed();
 			} else if ((396 <= cursorPos.x) && (cursorPos.x <= 483))
-				fxToggle();
+				_sound->toggleSound();
 			else if ((535 <= cursorPos.x) && (cursorPos.x <= 640))
 				_mouseText.insertChar(kControlNewLine, 0);
 		} else if (!_dropsOk)
@@ -1164,7 +1164,14 @@ void AvalancheEngine::checkClick() {
 }
 
 void AvalancheEngine::errorLed() {
-	warning("STUB: errorled()");
+	_dialogs->setReadyLight(0);
+	_graphics->drawErrorLight(true);
+	for (int i = 177; i >= 1; i--) {
+		_sound->playNote(177 + (i * 177177) / 999, 1);
+		_system->delayMillis(1);
+	}
+	_graphics->drawErrorLight(false);
+	_dialogs->setReadyLight(2);
 }
 
 /**
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 36f6f44..dc1c277 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -93,6 +93,7 @@ void Dialogs::setReadyLight(byte state) {
 	if (_vm->_ledStatus == state)
 		return; // Already like that!
 
+	// TODO: Implement different patterns for green color.
 	Color color = kColorBlack;
 	switch (state) {
 	case 0:
@@ -104,9 +105,7 @@ void Dialogs::setReadyLight(byte state) {
 		color = kColorGreen;
 		break; // Hit a key
 	}
-	warning("STUB: Dialogs::setReadyLight()");
-
-	CursorMan.showMouse(false);
+	
 	_vm->_graphics->drawReadyLight(color);
 	CursorMan.showMouse(true);
 	_vm->_ledStatus = state;
@@ -175,7 +174,8 @@ void Dialogs::scrollModeNormal() {
 				(event.kbd.keycode == Common::KEYCODE_PLUS)))) {
 				escape = true;
 				break;
-			}
+			} else if (event.type == Common::EVENT_KEYDOWN)
+				_vm->errorLed();
 		}
 	}
 
@@ -822,6 +822,8 @@ void Dialogs::displayText(Common::String text) {
 			}
 		}
 	}
+
+	setReadyLight(2);
 }
 
 void Dialogs::setTalkPos(int16 x, int16 y) {
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 9510f4f..11b149b 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -992,7 +992,27 @@ void GraphicManager::drawCursor(byte pos) {
 }
 
 void GraphicManager::drawReadyLight(Color color) {
-	_surface.fillRect(Common::Rect(419, 195, 438, 197), color);
+	_surface.fillRect(Common::Rect(419, 195, 439, 198), color);
+	_scrolls.fillRect(Common::Rect(419, 195, 439, 198), color);
+}
+
+void GraphicManager::drawSoundLight(bool state) {
+	Color color = kColorBlack;
+	if (state)
+		color = kColorCyan;
+	else
+		color = kColorBlack;
+	_surface.fillRect(Common::Rect(419, 175, 439, 178), color);
+}
+
+void GraphicManager::drawErrorLight(bool state) {
+	Color color = kColorBlack;
+	if (state)
+		color = kColorRed;
+	else
+		color = kColorBlack;
+	_surface.fillRect(Common::Rect(419, 184, 439, 187), color);
+	refreshScreen();
 }
 
 /**
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index acc0c92..579aa2e 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -131,6 +131,8 @@ public:
 	void drawToolbar();
 	void drawCursor(byte pos);
 	void drawReadyLight(Color color);
+	void drawSoundLight(bool state);
+	void drawErrorLight(bool state);
 	void drawSign(Common::String name, int16 xl, int16 yl, int16 y);
 	void drawIcon(int16 x, int16 y, byte which);
 	void drawScreenLine(int16 x, int16 y, int16 x2, int16 y2, Color color);
diff --git a/engines/avalanche/sound.cpp b/engines/avalanche/sound.cpp
index 229d046..0223bea 100644
--- a/engines/avalanche/sound.cpp
+++ b/engines/avalanche/sound.cpp
@@ -51,6 +51,7 @@ void SoundHandler::stopSound() {
  */
 void SoundHandler::toggleSound() {
 	_soundFl = !_soundFl;
+	_vm->_graphics->drawSoundLight(_soundFl);
 }
 
 void SoundHandler::syncVolume() {






More information about the Scummvm-git-logs mailing list