diff options
author | sapier <Sapier at GMX dot net> | 2014-09-25 20:33:17 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-09-25 20:37:06 +0200 |
commit | 121e8cc2a145591000282548ef07dbc70af7c6fc (patch) | |
tree | 6df7778f135b04743f8a113ed46430c0548853d2 /src | |
parent | 15c7460edaa279b96c235ec8bc4ae9bad5739e66 (diff) | |
download | minetest-121e8cc2a145591000282548ef07dbc70af7c6fc.tar.gz minetest-121e8cc2a145591000282548ef07dbc70af7c6fc.tar.bz2 minetest-121e8cc2a145591000282548ef07dbc70af7c6fc.zip |
Fix totally messed up 3d modes interlaced/topbottom/sidebyside
Diffstat (limited to 'src')
-rw-r--r-- | src/drawscene.cpp | 18 |
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)); |