summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/drawscene.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/drawscene.cpp b/src/drawscene.cpp
index 2080ccb73..20c2e22be 100644
--- a/src/drawscene.cpp
+++ b/src/drawscene.cpp
@@ -132,14 +132,15 @@ void draw_anaglyph_3d_mode(Camera& camera, bool show_hud, Hud& hud,
}
void init_texture(video::IVideoDriver* driver, const v2u32& screensize,
- video::ITexture** texture)
+ video::ITexture** texture, const char* name)
{
if (*texture != NULL)
{
driver->removeTexture(*texture);
}
*texture = driver->addRenderTargetTexture(
- core::dimension2d<u32>(screensize.X, screensize.Y));
+ core::dimension2d<u32>(screensize.X, screensize.Y), name,
+ irr::video::ECF_A8R8G8B8);
}
video::ITexture* draw_image(const v2u32& screensize,
@@ -156,13 +157,16 @@ video::ITexture* draw_image(const v2u32& screensize,
video::ITexture* image = NULL;
if (screensize != last_screensize) {
- init_texture(driver, screensize, &images[1]);
- image = images[1];
- init_texture(driver, screensize, &images[0]);
- image = images[0];
+ init_texture(driver, screensize, &images[1], "mt_drawimage_img1");
+ init_texture(driver, screensize, &images[0], "mt_drawimage_img2");
last_screensize = screensize;
}
+ if (psign == RIGHT)
+ image = images[1];
+ else
+ image = images[0];
+
driver->setRenderTarget(image, true, true,
irr::video::SColor(255,
skycolor.getRed(), skycolor.getGreen(), skycolor.getBlue()));
@@ -205,7 +209,7 @@ video::ITexture* draw_hud(video::IVideoDriver* driver, const v2u32& screensize,
video::SColor skycolor, gui::IGUIEnvironment* guienv, Camera& camera )
{
static video::ITexture* image = NULL;
- init_texture(driver, screensize, &image);
+ init_texture(driver, screensize, &image, "mt_drawimage_hud");
driver->setRenderTarget(image, true, true,
irr::video::SColor(255,0,0,0));