aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/minigames/geisha/diving.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-01-28 17:02:43 +0100
committerSven Hesse2012-01-28 17:46:38 +0100
commit9dd703532706c049b14b4bc1e239c9cd08366f2a (patch)
tree082e964997d3a22d7a50fe9a7c34d95d07888094 /engines/gob/minigames/geisha/diving.cpp
parent7ee77cbd26f131ce00cd4a9ddf6515a283b646a3 (diff)
downloadscummvm-rg350-9dd703532706c049b14b4bc1e239c9cd08366f2a.tar.gz
scummvm-rg350-9dd703532706c049b14b4bc1e239c9cd08366f2a.tar.bz2
scummvm-rg350-9dd703532706c049b14b4bc1e239c9cd08366f2a.zip
GOB: Add the air and health meters in Geisha's Diving minigame
Diffstat (limited to 'engines/gob/minigames/geisha/diving.cpp')
-rw-r--r--engines/gob/minigames/geisha/diving.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp
index 4b08a21fb4..59ebe7f7b1 100644
--- a/engines/gob/minigames/geisha/diving.cpp
+++ b/engines/gob/minigames/geisha/diving.cpp
@@ -32,6 +32,7 @@
#include "gob/minigames/geisha/evilfish.h"
#include "gob/minigames/geisha/oko.h"
+#include "gob/minigames/geisha/meter.h"
#include "gob/minigames/geisha/diving.h"
namespace Gob {
@@ -57,10 +58,14 @@ const Diving::PlantLevel Diving::kPlantLevels[] = {
Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
_objects(0), _gui(0), _okoAnim(0), _lungs(0), _heart(0),
- _blackPearl(0), _whitePearlCount(0), _blackPearlCount(0) {
+ _blackPearl(0), _airMeter(0), _healthMeter(0),
+ _whitePearlCount(0), _blackPearlCount(0) {
_blackPearl = new Surface(11, 8, 1);
+ _airMeter = new Meter(4 , 195, 38, 2, 5, 7, 38, Meter::kFillToLeft);
+ _healthMeter = new Meter(276, 195, 38, 2, 6, 7, 38, Meter::kFillToLeft);
+
for (uint i = 0; i < kEvilFishCount; i++)
_evilFish[i].evilFish = 0;
@@ -79,6 +84,9 @@ Diving::Diving(GobEngine *vm) : _vm(vm), _background(0),
}
Diving::~Diving() {
+ delete _airMeter;
+ delete _healthMeter;
+
delete _blackPearl;
deinit();
@@ -234,6 +242,9 @@ void Diving::init() {
_anims.push_back(_oko);
_anims.push_back(_lungs);
_anims.push_back(_heart);
+
+ _airMeter->setValue(38);
+ _healthMeter->setValue(38);
}
void Diving::deinit() {
@@ -584,6 +595,13 @@ void Diving::updateAnims() {
(*a)->advance();
}
+
+ // Draw the meters
+ _airMeter->draw(*_vm->_draw->_backSurface, left, top, right, bottom);
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
+
+ _healthMeter->draw(*_vm->_draw->_backSurface, left, top, right, bottom);
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
}
int16 Diving::checkInput(int16 &mouseX, int16 &mouseY, MouseButtons &mouseButtons) {