OGL32CTX: Uses draw2DImage in skin.cpp

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14915 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
vincentlj 2014-01-04 21:43:49 +00:00
parent bfc7efa5cc
commit 3598643332

View File

@ -613,34 +613,34 @@ X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
if ((areas & BoxRenderParams::LEFT) != 0) if ((areas & BoxRenderParams::LEFT) != 0)
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_left, draw2DImage(source, dest_area_left,
m_source_area_left, clipRect, m_source_area_left, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ((areas & BoxRenderParams::BODY) != 0) if ((areas & BoxRenderParams::BODY) != 0)
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_center, draw2DImage(source, dest_area_center,
m_source_area_center, clipRect, m_source_area_center, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ((areas & BoxRenderParams::RIGHT) != 0) if ((areas & BoxRenderParams::RIGHT) != 0)
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_right, draw2DImage(source, dest_area_right,
m_source_area_right, clipRect, m_source_area_right, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ((areas & BoxRenderParams::TOP) != 0) if ((areas & BoxRenderParams::TOP) != 0)
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_top, draw2DImage(source, dest_area_top,
m_source_area_top, clipRect, m_source_area_top, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ((areas & BoxRenderParams::BOTTOM) != 0) if ((areas & BoxRenderParams::BOTTOM) != 0)
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_bottom, draw2DImage(source, dest_area_bottom,
m_source_area_bottom, clipRect, m_source_area_bottom, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
@ -648,21 +648,21 @@ X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
if ( ((areas & BoxRenderParams::LEFT) != 0) && if ( ((areas & BoxRenderParams::LEFT) != 0) &&
((areas & BoxRenderParams::TOP ) != 0) ) ((areas & BoxRenderParams::TOP ) != 0) )
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_top_left, draw2DImage(source, dest_area_top_left,
m_source_area_top_left, clipRect, m_source_area_top_left, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ( ((areas & BoxRenderParams::RIGHT) != 0) && if ( ((areas & BoxRenderParams::RIGHT) != 0) &&
((areas & BoxRenderParams::TOP ) != 0) ) ((areas & BoxRenderParams::TOP ) != 0) )
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_top_right, draw2DImage(source, dest_area_top_right,
m_source_area_top_right, clipRect, m_source_area_top_right, clipRect,
colorptr, true /* alpha */); colorptr, true /* alpha */);
} }
if ( ((areas & BoxRenderParams::LEFT ) != 0) && if ( ((areas & BoxRenderParams::LEFT ) != 0) &&
((areas & BoxRenderParams::BOTTOM) != 0) ) ((areas & BoxRenderParams::BOTTOM) != 0) )
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_bottom_left, draw2DImage(source, dest_area_bottom_left,
m_source_area_bottom_left, m_source_area_bottom_left,
clipRect, colorptr, clipRect, colorptr,
/*alpha*/true ); /*alpha*/true );
@ -670,7 +670,7 @@ X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
if ( ((areas & BoxRenderParams::RIGHT ) != 0) && if ( ((areas & BoxRenderParams::RIGHT ) != 0) &&
((areas & BoxRenderParams::BOTTOM) != 0) ) ((areas & BoxRenderParams::BOTTOM) != 0) )
{ {
GUIEngine::getDriver()->draw2DImage(source, dest_area_bottom_right, draw2DImage(source, dest_area_bottom_right,
m_source_area_bottom_right, m_source_area_bottom_right,
clipRect, colorptr, clipRect, colorptr,
/*alpha*/true ); /*alpha*/true );
@ -859,7 +859,7 @@ void Skin::drawRatingBar(Widget *w, const core::recti &rect,
const core::recti source_area(texture_w * step, 0, const core::recti source_area(texture_w * step, 0,
texture_w * (step + 1), texture_h); texture_w * (step + 1), texture_h);
GUIEngine::getDriver()->draw2DImage(texture, draw2DImage(texture,
star_rect, source_area, star_rect, source_area,
0 /* no clipping */, 0 /* no clipping */,
(w->m_deactivated || ID_DEBUG) ? colors : 0, (w->m_deactivated || ID_DEBUG) ? colors : 0,
@ -1022,14 +1022,14 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
SColor(100,255,255,255), SColor(100,255,255,255),
SColor(100,255,255,255), SColor(100,255,255,255),
SColor(100,255,255,255) }; SColor(100,255,255,255) };
GUIEngine::getDriver()->draw2DImage(tex_bubble, rect2, draw2DImage(tex_bubble, rect2,
source_area, source_area,
0 /* no clipping */, 0 /* no clipping */,
colors, true /* alpha */); colors, true /* alpha */);
} }
else else
{ {
GUIEngine::getDriver()->draw2DImage(tex_bubble, rect2, draw2DImage(tex_bubble, rect2,
source_area, source_area,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1078,7 +1078,7 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
glow_center_x + 45 + grow, glow_center_x + 45 + grow,
glow_center_y + 25 + grow/2); glow_center_y + 25 + grow/2);
GUIEngine::getDriver()->draw2DImage(tex_ficonhighlight, rect2, draw2DImage(tex_ficonhighlight, rect2,
source_area, source_area,
/*clipping*/ 0, /*clipping*/ 0,
/*color*/ 0, /*color*/ 0,
@ -1306,7 +1306,7 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
const core::recti source_area(0, 0, texture_w, texture_h); const core::recti source_area(0, 0, texture_w, texture_h);
GUIEngine::getDriver()->draw2DImage(texture, draw2DImage(texture,
dest_area, source_area, dest_area, source_area,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1401,7 +1401,7 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
glow_center_x + 45 + grow, glow_center_x + 45 + grow,
glow_center_y + 25 + grow/2); glow_center_y + 25 + grow/2);
GUIEngine::getDriver()->draw2DImage(tex_ficonhighlight, rect2, draw2DImage(tex_ficonhighlight, rect2,
source_area, source_area,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1444,7 +1444,7 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
SColor(100,255,255,255), SColor(100,255,255,255),
SColor(100,255,255,255) }; SColor(100,255,255,255) };
core::recti r(0,0,icon_widget->m_texture_w, icon_widget->m_texture_h); core::recti r(0,0,icon_widget->m_texture_w, icon_widget->m_texture_h);
GUIEngine::getDriver()->draw2DImage(icon_widget->m_texture, sized_rect, draw2DImage(icon_widget->m_texture, sized_rect,
r, 0 /* no clipping */, colors, r, 0 /* no clipping */, colors,
true /* alpha */); true /* alpha */);
} }
@ -1461,7 +1461,7 @@ void Skin::drawIconButton(const core::recti &rect, Widget* widget,
t = icon_widget->m_highlight_texture; t = icon_widget->m_highlight_texture;
} }
core::recti r(0,0,icon_widget->m_texture_w, icon_widget->m_texture_h); core::recti r(0,0,icon_widget->m_texture_w, icon_widget->m_texture_h);
GUIEngine::getDriver()->draw2DImage(t, sized_rect, r,0 draw2DImage(t, sized_rect, r,0
/* no clipping */, 0, /* no clipping */, 0,
true /* alpha */); true /* alpha */);
} }
@ -1511,13 +1511,13 @@ void Skin::drawCheckBox(const core::recti &rect, Widget* widget, bool focused)
SColor(100,255,255,255), SColor(100,255,255,255),
SColor(100,255,255,255), SColor(100,255,255,255),
SColor(100,255,255,255) }; SColor(100,255,255,255) };
GUIEngine::getDriver()->draw2DImage( texture, rect, source_area, draw2DImage( texture, rect, source_area,
0 /* no clipping */, colors, 0 /* no clipping */, colors,
true /* alpha */); true /* alpha */);
} }
else else
{ {
GUIEngine::getDriver()->draw2DImage( texture, rect, source_area, draw2DImage( texture, rect, source_area,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
} }
@ -1580,7 +1580,7 @@ void Skin::drawListHeader(const irr::core::rect< irr::s32 > &rect,
core::dimension2di(rect.getHeight(), core::dimension2di(rect.getHeight(),
rect.getHeight())); rect.getHeight()));
core::recti srcRect(core::position2d<s32>(0,0), img->getSize()); core::recti srcRect(core::position2d<s32>(0,0), img->getSize());
irr_driver->getVideoDriver()->draw2DImage(img, destRect, srcRect, draw2DImage(img, destRect, srcRect,
NULL, NULL, /* alpha */true); NULL, NULL, /* alpha */true);
} }
@ -1644,7 +1644,7 @@ void Skin::renderSections(PtrVector<Widget>* within_vector)
core::recti r1(0, (int)(widget.m_y - 40*y_size), core::recti r1(0, (int)(widget.m_y - 40*y_size),
framesize.Width, framesize.Height); framesize.Width, framesize.Height);
core::recti r2(core::dimension2di(0,0), tex->getSize()); core::recti r2(core::dimension2di(0,0), tex->getSize());
irr_driver->getVideoDriver()->draw2DImage(tex, r1, r2, draw2DImage(tex, r1, r2,
0, 0, /*alpha*/true); 0, 0, /*alpha*/true);
} }
else if (widget.isTopBar()) else if (widget.isTopBar())
@ -1655,7 +1655,7 @@ void Skin::renderSections(PtrVector<Widget>* within_vector)
core::recti r1(0, 0, core::recti r1(0, 0,
(int)widget.m_w, (int)widget.m_h); (int)widget.m_w, (int)widget.m_h);
core::recti r2(core::dimension2di(0,0), tex->getSize()); core::recti r2(core::dimension2di(0,0), tex->getSize());
irr_driver->getVideoDriver()->draw2DImage(tex, r1, r2, draw2DImage(tex, r1, r2,
0, 0, /*alpha*/false); 0, 0, /*alpha*/false);
} }
else else
@ -1679,7 +1679,7 @@ void Skin::drawScrollbarBackground(const irr::core::rect< irr::s32 > &rect)
BoxRenderParams& p = BoxRenderParams& p =
SkinConfig::m_render_params["scrollbar_background::neutral"]; SkinConfig::m_render_params["scrollbar_background::neutral"];
GUIEngine::getDriver()->draw2DImage(p.getImage(), rect2, draw2DImage(p.getImage(), rect2,
p.m_source_area_center, p.m_source_area_center,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1692,7 +1692,7 @@ void Skin::drawScrollbarThumb(const irr::core::rect< irr::s32 > &rect)
BoxRenderParams& p = BoxRenderParams& p =
SkinConfig::m_render_params["scrollbar_thumb::neutral"]; SkinConfig::m_render_params["scrollbar_thumb::neutral"];
GUIEngine::getDriver()->draw2DImage(p.getImage(), rect, draw2DImage(p.getImage(), rect,
p.m_source_area_center, p.m_source_area_center,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1709,7 +1709,7 @@ void Skin::drawScrollbarButton(const irr::core::rect< irr::s32 > &rect,
if (!bottomArrow) if (!bottomArrow)
{ {
GUIEngine::getDriver()->draw2DImage(p.getImage(), rect, draw2DImage(p.getImage(), rect,
p.m_source_area_center, p.m_source_area_center,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1723,7 +1723,7 @@ void Skin::drawScrollbarButton(const irr::core::rect< irr::s32 > &rect,
const int y0 = source_area.UpperLeftCorner.Y; const int y0 = source_area.UpperLeftCorner.Y;
const int y1 = source_area.LowerRightCorner.Y; const int y1 = source_area.LowerRightCorner.Y;
GUIEngine::getDriver()->draw2DImage(p.getImage(), rect, draw2DImage(p.getImage(), rect,
core::recti(x0, y1, x1, y0), core::recti(x0, y1, x1, y0),
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
@ -1927,7 +1927,7 @@ void doDrawBadge(ITexture* texture, const core::recti& rect,
: rect.LowerRightCorner.X, : rect.LowerRightCorner.X,
rect.LowerRightCorner.Y ); rect.LowerRightCorner.Y );
GUIEngine::getDriver()->draw2DImage(texture, rect2, source_area, draw2DImage(texture, rect2, source_area,
0 /* no clipping */, 0, 0 /* no clipping */, 0,
true /* alpha */); true /* alpha */);
} // doDrawBadge } // doDrawBadge