Remove duplicated code
This commit is contained in:
parent
2da86cab08
commit
6911db0ac2
@ -236,7 +236,7 @@ public:
|
||||
{
|
||||
Message::draw(dt);
|
||||
m_display_timer = 9999999.9f;
|
||||
GUIEngine::getSkin()->drawProgress(&m_swc, m_area,
|
||||
GUIEngine::getSkin()->drawProgressBarInScreen(&m_swc, m_area,
|
||||
m_progress_value.load());
|
||||
video::SColor color(255, 0, 0, 0);
|
||||
GUIEngine::getFont()->draw(m_message, m_area, color, true, true);
|
||||
|
@ -816,39 +816,23 @@ void Skin::drawProgress(Widget* w, const core::recti &rect,
|
||||
else
|
||||
{
|
||||
ProgressBarWidget * progress = (ProgressBarWidget*)w;
|
||||
drawBoxFromStretchableTexture(w, rect,
|
||||
SkinConfig::m_render_params["progress::neutral"],
|
||||
w->m_deactivated);
|
||||
|
||||
core::recti rect2 = rect;
|
||||
|
||||
rect2.LowerRightCorner.X -= rect.getWidth()
|
||||
- progress->getValue()*rect.getWidth() / 100;
|
||||
|
||||
drawBoxFromStretchableTexture(w, rect2,
|
||||
SkinConfig::m_render_params["progress::fill"],
|
||||
w->m_deactivated);
|
||||
#if 0
|
||||
draw2DImage(
|
||||
SkinConfig::m_render_params["progress::fill"].getImage(),
|
||||
sized_rect, core::recti(0,0,progress->m_w, progress->m_h),
|
||||
0 /* no clipping */, colors, true);
|
||||
#endif
|
||||
|
||||
drawProgressBarInScreen(w, rect, progress->getValue(),
|
||||
w->m_deactivated);
|
||||
}
|
||||
} // drawProgress
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void Skin::drawProgress(SkinWidgetContainer* swc,
|
||||
const core::rect< s32 > &rect, int progress)
|
||||
void Skin::drawProgressBarInScreen(SkinWidgetContainer* swc,
|
||||
const core::rect< s32 > &rect, int progress,
|
||||
bool deactivated)
|
||||
{
|
||||
drawBoxFromStretchableTexture(swc, rect,
|
||||
SkinConfig::m_render_params["progress::neutral"]);
|
||||
SkinConfig::m_render_params["progress::neutral"], deactivated);
|
||||
core::recti rect2 = rect;
|
||||
rect2.LowerRightCorner.X -= (rect.getWidth())
|
||||
- progress * rect.getWidth() / 100;
|
||||
drawBoxFromStretchableTexture(swc, rect2,
|
||||
SkinConfig::m_render_params["progress::fill"]);
|
||||
SkinConfig::m_render_params["progress::fill"], deactivated);
|
||||
} // drawProgress
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -336,8 +336,9 @@ namespace GUIEngine
|
||||
void drawBgImage();
|
||||
void drawBGFadeColor();
|
||||
void drawBadgeOn(const Widget* widget, const core::rect<s32>& rect);
|
||||
void drawProgress(SkinWidgetContainer* swc,
|
||||
const core::rect< s32 > &rect, int progress);
|
||||
void drawProgressBarInScreen(SkinWidgetContainer* swc,
|
||||
const core::rect< s32 > &rect,
|
||||
int progress, bool deactivated = false);
|
||||
|
||||
// irrlicht's callbacks
|
||||
virtual void draw2DRectangle (gui::IGUIElement *element,
|
||||
|
Loading…
x
Reference in New Issue
Block a user