diff options
author | Sven Hesse | 2011-09-03 20:49:10 +0200 |
---|---|---|
committer | Sven Hesse | 2011-09-14 18:54:27 +0200 |
commit | 358f55db402d1c8acd72c65f76b37a310575809d (patch) | |
tree | bc1c63811bdb26a980174bdcc00ba66c2e72cc2f /engines | |
parent | 918fe978e2d4f1e149cf8040e087b7b70e54c9d4 (diff) | |
download | scummvm-rg350-358f55db402d1c8acd72c65f76b37a310575809d.tar.gz scummvm-rg350-358f55db402d1c8acd72c65f76b37a310575809d.tar.bz2 scummvm-rg350-358f55db402d1c8acd72c65f76b37a310575809d.zip |
GOB: Add stubby "Diving" black pearl drawing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/minigames/geisha/diving.cpp | 31 | ||||
-rw-r--r-- | engines/gob/minigames/geisha/diving.h | 6 |
2 files changed, 35 insertions, 2 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index 6130ebad78..d2f51e645c 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -37,11 +37,15 @@ namespace Gob { namespace Geisha { Diving::Diving(GobEngine *vm) : _vm(vm), _background(0), - _objects(0), _gui(0), _oko(0), _lungs(0), _heart(0) { + _objects(0), _gui(0), _oko(0), _lungs(0), _heart(0), + _blackPearl(0), _blackPearlCount(0) { + _blackPearl = new Surface(11, 8, 1); } Diving::~Diving() { + delete _blackPearl; + deinit(); } @@ -88,10 +92,13 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) { _vm->_util->waitEndFrame(); _vm->_util->processInput(); + + if (_blackPearlCount >= 2) + break; } deinit(); - return true; + return _blackPearlCount >= 2; } void Diving::init() { @@ -117,6 +124,14 @@ void Diving::init() { _heart->setPosition(); _heart->setVisible(true); _heart->setPause(true); + + Surface tmp(320, 103, 1); + + _vm->_video->drawPackedSprite("tperlobj.cmp", tmp); + + _blackPearl->blit(tmp, 282, 80, 292, 87, 0, 0); + + _blackPearlCount = 0; } void Diving::deinit() { @@ -154,6 +169,18 @@ void Diving::initScreen() { _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, 0, 0, 319, 199); } +void Diving::foundBlackPearl() { + _blackPearlCount++; + + if (_blackPearlCount == 1) { + _vm->_draw->_backSurface->blit(*_blackPearl, 0, 0, 10, 7, 147, 179, 0); + _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, 147, 179, 157, 186); + } else if (_blackPearlCount == 2) { + _vm->_draw->_backSurface->blit(*_blackPearl, 0, 0, 10, 7, 160, 179, 0); + _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, 147, 179, 160, 186); + } +} + } // End of namespace Geisha } // End of namespace Gob diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h index 238a1ad75b..96a8a74903 100644 --- a/engines/gob/minigames/geisha/diving.h +++ b/engines/gob/minigames/geisha/diving.h @@ -28,6 +28,7 @@ namespace Gob { class GobEngine; +class Surface; class DECFile; class ANIFile; class ANIObject; @@ -54,11 +55,16 @@ private: ANIObject *_lungs; ANIObject *_heart; + Surface *_blackPearl; + + uint8 _blackPearlCount; void init(); void deinit(); void initScreen(); + + void foundBlackPearl(); }; } // End of namespace Geisha |