PEGASUS: Remove unused EnergyBar class

This commit is contained in:
Matthew Hoops 2011-09-22 15:28:01 -04:00
parent c8752bb1d3
commit dc463816af
2 changed files with 0 additions and 81 deletions

View File

@ -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;
}

View File

@ -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) {}