OGL32CTX: Replace a couple of draw2DImage/draw2DRectangle

This commit is contained in:
Vincent Lejeune 2014-01-21 23:01:58 +01:00
parent 271a26eaf0
commit 5f942a9d8b
2 changed files with 15 additions and 14 deletions

View File

@ -19,6 +19,7 @@
#include "guiengine/engine.hpp" #include "guiengine/engine.hpp"
#include "guiengine/scalable_font.hpp" #include "guiengine/scalable_font.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
#include "graphics/glwrap.hpp"
#include "states_screens/cutscene_gui.hpp" #include "states_screens/cutscene_gui.hpp"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -41,7 +42,7 @@ void CutsceneGUI::renderGlobal(float dt)
{ {
if (m_fade_level > 0.0f) if (m_fade_level > 0.0f)
{ {
irr_driver->getVideoDriver()->draw2DRectangle( GL32_draw2DRectangle(
video::SColor((int)(m_fade_level*255), 0,0,0), video::SColor((int)(m_fade_level*255), 0,0,0),
core::rect<s32>(0, 0, core::rect<s32>(0, 0,
UserConfigParams::m_width, UserConfigParams::m_width,

View File

@ -26,6 +26,7 @@ using namespace irr;
#include "challenges/unlock_manager.hpp" #include "challenges/unlock_manager.hpp"
#include "config/user_config.hpp" #include "config/user_config.hpp"
#include "graphics/camera.hpp" #include "graphics/camera.hpp"
#include "graphics/glwrap.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp" #include "graphics/material_manager.hpp"
#include "guiengine/engine.hpp" #include "guiengine/engine.hpp"
@ -143,8 +144,7 @@ void RaceGUIOverworld::renderGlobal(float dt)
!GUIEngine::ModalDialog::isADialogActive()) !GUIEngine::ModalDialog::isADialogActive())
{ {
static video::SColor black = video::SColor(255,0,0,0); static video::SColor black = video::SColor(255,0,0,0);
irr_driver->getVideoDriver() GL32_draw2DRectangle(black,
->draw2DRectangle(black,
core::rect<s32>(UserConfigParams::m_width/2, core::rect<s32>(UserConfigParams::m_width/2,
UserConfigParams::m_height/2, UserConfigParams::m_height/2,
UserConfigParams::m_width, UserConfigParams::m_width,
@ -233,7 +233,7 @@ void RaceGUIOverworld::drawTrophyPoints()
if (!m_close_to_a_challenge) if (!m_close_to_a_challenge)
{ {
irr_driver->getVideoDriver()->draw2DImage(m_trophy1, dest, source, NULL, draw2DImage(m_trophy1, dest, source, NULL,
NULL, true /* alpha */); NULL, true /* alpha */);
} }
@ -248,7 +248,7 @@ void RaceGUIOverworld::drawTrophyPoints()
dest += core::position2di(size*2, 0); dest += core::position2di(size*2, 0);
if (!m_close_to_a_challenge) if (!m_close_to_a_challenge)
{ {
irr_driver->getVideoDriver()->draw2DImage(m_trophy2, dest, source, NULL, draw2DImage(m_trophy2, dest, source, NULL,
NULL, true /* alpha */); NULL, true /* alpha */);
} }
@ -263,7 +263,7 @@ void RaceGUIOverworld::drawTrophyPoints()
dest += core::position2di(size*2, 0); dest += core::position2di(size*2, 0);
if (!m_close_to_a_challenge) if (!m_close_to_a_challenge)
{ {
irr_driver->getVideoDriver()->draw2DImage(m_trophy3, dest, source, NULL, draw2DImage(m_trophy3, dest, source, NULL,
NULL, true /* alpha */); NULL, true /* alpha */);
} }
dest += core::position2di((int)(size*1.5f), 0); dest += core::position2di((int)(size*1.5f), 0);
@ -277,7 +277,7 @@ void RaceGUIOverworld::drawTrophyPoints()
dest = core::rect<s32>(pos.UpperLeftCorner.X - size - 5, pos.UpperLeftCorner.Y, dest = core::rect<s32>(pos.UpperLeftCorner.X - size - 5, pos.UpperLeftCorner.Y,
pos.UpperLeftCorner.X - 5, pos.UpperLeftCorner.Y + size); pos.UpperLeftCorner.X - 5, pos.UpperLeftCorner.Y + size);
irr_driver->getVideoDriver()->draw2DImage(m_open_challenge, dest, source, NULL, draw2DImage(m_open_challenge, dest, source, NULL,
NULL, true /* alpha */); NULL, true /* alpha */);
pos.LowerRightCorner.Y = dest.LowerRightCorner.Y; pos.LowerRightCorner.Y = dest.LowerRightCorner.Y;
@ -330,7 +330,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
core::rect<s32> dest(m_map_left, upper_y, core::rect<s32> dest(m_map_left, upper_y,
m_map_left + m_map_width, lower_y); m_map_left + m_map_width, lower_y);
core::rect<s32> source(core::position2di(0, 0), mini_map->getOriginalSize()); core::rect<s32> source(core::position2di(0, 0), mini_map->getOriginalSize());
irr_driver->getVideoDriver()->draw2DImage(mini_map, dest, source, 0, 0, true); draw2DImage(mini_map, dest, source, 0, 0, true);
} }
Vec3 kart_xyz; Vec3 kart_xyz;
@ -376,11 +376,11 @@ void RaceGUIOverworld::drawGlobalMiniMap()
const core::rect<s32> rect(core::position2d<s32>(0,0), const core::rect<s32> rect(core::position2d<s32>(0,0),
m_icons_frame->getTexture()->getOriginalSize()); m_icons_frame->getTexture()->getOriginalSize());
irr_driver->getVideoDriver()->draw2DImage(m_icons_frame->getTexture(), position, draw2DImage(m_icons_frame->getTexture(), position,
rect, NULL, colors, true); rect, NULL, colors, true);
} // if isPlayerController } // if isPlayerController
irr_driver->getVideoDriver()->draw2DImage(m_marker, position, source, draw2DImage(m_marker, position, source,
NULL, NULL, true); NULL, NULL, true);
} // for i<getNumKarts } // for i<getNumKarts
} // for only_draw_player_kart } // for only_draw_player_kart
@ -420,7 +420,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
lower_y -(int)(draw_at.getY()-marker_size/2)); lower_y -(int)(draw_at.getY()-marker_size/2));
m_current_challenge = &(challenges[n]); m_current_challenge = &(challenges[n]);
} }
irr_driver->getVideoDriver()->draw2DImage(m_icons[state], draw2DImage(m_icons[state],
dest, source, NULL, NULL, true); dest, source, NULL, NULL, true);
} }
@ -546,7 +546,7 @@ void RaceGUIOverworld::drawEnergyMeter(int x, int y, const AbstractKart *kart,
x -= w; x -= w;
// Background // Background
irr_driver->getVideoDriver()->draw2DImage(m_gauge_empty, core::rect<s32>(x, y, x+w, y+h) /* dest rect */, draw2DImage(m_gauge_empty, core::rect<s32>(x, y, x+w, y+h) /* dest rect */,
core::rect<s32>(0, 0, 64, 256) /* source rect */, core::rect<s32>(0, 0, 64, 256) /* source rect */,
NULL /* clip rect */, NULL /* colors */, NULL /* clip rect */, NULL /* colors */,
true /* alpha */); true /* alpha */);
@ -565,7 +565,7 @@ void RaceGUIOverworld::drawEnergyMeter(int x, int y, const AbstractKart *kart,
if (state >= 1.0f) y1 = y; if (state >= 1.0f) y1 = y;
core::rect<s32> clip(x, y1, x + w, y + h); core::rect<s32> clip(x, y1, x + w, y + h);
irr_driver->getVideoDriver()->draw2DImage(m_gauge_goal, core::rect<s32>(x, y, x+w, y+h) /* dest rect */, draw2DImage(m_gauge_goal, core::rect<s32>(x, y, x+w, y+h) /* dest rect */,
core::rect<s32>(0, 0, 64, 256) /* source rect */, core::rect<s32>(0, 0, 64, 256) /* source rect */,
&clip, NULL /* colors */, true /* alpha */); &clip, NULL /* colors */, true /* alpha */);
} }
@ -581,7 +581,7 @@ void RaceGUIOverworld::drawEnergyMeter(int x, int y, const AbstractKart *kart,
if (state >= 1.0f) y1 = y; if (state >= 1.0f) y1 = y;
core::rect<s32> clip(x, y1, x + w, y + h); core::rect<s32> clip(x, y1, x + w, y + h);
irr_driver->getVideoDriver()->draw2DImage(m_gauge_full, core::rect<s32>(x, y, x+w, y+h) /* dest rect */, draw2DImage(m_gauge_full, core::rect<s32>(x, y, x+w, y+h) /* dest rect */,
core::rect<s32>(0, 0, 64, 256) /* source rect */, core::rect<s32>(0, 0, 64, 256) /* source rect */,
&clip, NULL /* colors */, true /* alpha */); &clip, NULL /* colors */, true /* alpha */);
} }