mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 15:48:48 +00:00
PEGASUS: Remove unused EnergyBar class
This commit is contained in:
parent
c8752bb1d3
commit
dc463816af
@ -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;
|
||||
}
|
||||
|
@ -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) {}
|
||||
|
Loading…
Reference in New Issue
Block a user