diff options
-rw-r--r-- | engines/pegasus/elements.cpp | 53 | ||||
-rw-r--r-- | engines/pegasus/elements.h | 28 |
2 files changed, 0 insertions, 81 deletions
diff --git a/engines/pegasus/elements.cpp b/engines/pegasus/elements.cpp index 6f94fe5789..99f3fbd67b 100644 --- a/engines/pegasus/elements.cpp +++ b/engines/pegasus/elements.cpp @@ -193,59 +193,6 @@ void DropHighlight::draw(const Common::Rect &) { } } -EnergyBar::EnergyBar(const tDisplayElementID id) : DisplayElement(id) { - _maxEnergy = 0; - _energyLevel = 0; - _barColor = 0; -} - -void EnergyBar::checkRedraw() { - if (_elementIsVisible) { - Common::Rect r; - calcLevelRect(r); - if (r != _levelRect) - triggerRedraw(); - } -} - -void EnergyBar::setEnergyLevel(const uint32 newLevel) { - if (_energyLevel != newLevel) { - _energyLevel = newLevel; - checkRedraw(); - } -} - -void EnergyBar::setMaxEnergy(const uint32 newMax) { - if (_maxEnergy != newMax) { - if (_energyLevel > newMax) - _energyLevel = newMax; - _maxEnergy = newMax; - checkRedraw(); - } -} - -void EnergyBar::setBounds(const Common::Rect &r) { - DisplayElement::setBounds(r); - checkRedraw(); -} - -void EnergyBar::draw(const Common::Rect &r) { - Common::Rect levelRect; - calcLevelRect(levelRect); - - if (r.intersects(levelRect)) - ((PegasusEngine *)g_engine)->_gfx->getWorkArea()->fillRect(levelRect, _barColor); -} - -void EnergyBar::calcLevelRect(Common::Rect &r) const { - if (_maxEnergy > 0) { - r = _bounds; - r.left = r.right - _bounds.width() * _energyLevel / _maxEnergy; - } else { - r = Common::Rect(0, 0, 0, 0); - } -} - IdlerAnimation::IdlerAnimation(const tDisplayElementID id) : Animation(id) { _lastTime = 0xffffffff; } diff --git a/engines/pegasus/elements.h b/engines/pegasus/elements.h index 97f982a6d9..46b3bc5927 100644 --- a/engines/pegasus/elements.h +++ b/engines/pegasus/elements.h @@ -111,34 +111,6 @@ protected: uint16 _cornerDiameter; }; -class EnergyBar : public DisplayElement { -public: - EnergyBar(const tDisplayElementID); - virtual ~EnergyBar() {} - - void getBarColor(uint32 &color) const { color = _barColor; } - void setBarColor(const uint32 &color) { _barColor = color; } - - long getEnergyLevel() const { return _energyLevel; } - void setEnergyLevel(const uint32); - - long getMaxEnergy() const { return _maxEnergy; } - void setMaxEnergy(const uint32); - - virtual void setBounds(const Common::Rect&); - - virtual void draw(const Common::Rect&); - -protected: - void calcLevelRect(Common::Rect&) const; - void checkRedraw(); - - uint32 _energyLevel; - uint32 _maxEnergy; - Common::Rect _levelRect; - uint32 _barColor; -}; - class Animation : public DisplayElement, public DynamicElement { public: Animation(const tDisplayElementID id) : DisplayElement(id) {} |