aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-03-03 21:11:07 +0100
committeruruk2014-03-03 21:11:07 +0100
commit0dff818594a67982afbe499898a95937797c33aa (patch)
tree07a5c2e1a3b8c66bc523ca45cb0b712a4398a820
parente6b56b0b85f6cf6156621b85ecdfb76bea0395ff (diff)
downloadscummvm-rg350-0dff818594a67982afbe499898a95937797c33aa.tar.gz
scummvm-rg350-0dff818594a67982afbe499898a95937797c33aa.tar.bz2
scummvm-rg350-0dff818594a67982afbe499898a95937797c33aa.zip
AVALANCHE: Implement the status leds on the toolbar.
-rw-r--r--engines/avalanche/avalot.cpp15
-rw-r--r--engines/avalanche/dialogs.cpp10
-rw-r--r--engines/avalanche/graphics.cpp22
-rw-r--r--engines/avalanche/graphics.h2
-rw-r--r--engines/avalanche/sound.cpp1
5 files changed, 41 insertions, 9 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2e89287f58..20e16a55b1 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 36f6f4470c..dc1c277877 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 9510f4f72a..11b149babd 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 acc0c92a15..579aa2e056 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 229d046cc1..0223bead48 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() {