aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-08-29 01:35:35 +0200
committersapier <Sapier at GMX dot net>2014-08-29 01:35:35 +0200
commite5b4748bb44a12fd09a92f7d36986b4bda86e6bf (patch)
tree5e3488d6958e6925a55a49e2cb852dba8e181ca4
parentfb2183b61da9298e78b483da5a6ad79779eac64b (diff)
downloadminetest-e5b4748bb44a12fd09a92f7d36986b4bda86e6bf.tar.gz
minetest-e5b4748bb44a12fd09a92f7d36986b4bda86e6bf.tar.bz2
minetest-e5b4748bb44a12fd09a92f7d36986b4bda86e6bf.zip
Fix only one texture being updated on window resize breaking sidebyside and topbottom 3d modes
-rw-r--r--src/drawscene.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/drawscene.cpp b/src/drawscene.cpp
index 5d214d128..08b089908 100644
--- a/src/drawscene.cpp
+++ b/src/drawscene.cpp
@@ -131,18 +131,12 @@ void draw_anaglyph_3d_mode(Camera& camera, bool show_hud, Hud& hud,
void init_texture(video::IVideoDriver* driver, const v2u32& screensize,
video::ITexture** texture)
{
- static v2u32 last_screensize = v2u32(0,0);
-
- if (( *texture == NULL ) || (screensize != last_screensize))
+ if (*texture != NULL)
{
- if (*texture != NULL)
- {
- driver->removeTexture(*texture);
- }
- *texture = driver->addRenderTargetTexture(
- core::dimension2d<u32>(screensize.X, screensize.Y));
- last_screensize = screensize;
+ driver->removeTexture(*texture);
}
+ *texture = driver->addRenderTargetTexture(
+ core::dimension2d<u32>(screensize.X, screensize.Y));
}
video::ITexture* draw_image(const v2u32& screensize,
@@ -154,16 +148,16 @@ video::ITexture* draw_image(const v2u32& screensize,
video::SColor skycolor )
{
static video::ITexture* images[2] = { NULL, NULL };
+ static v2u32 last_screensize = v2u32(0,0);
video::ITexture* image = NULL;
- if (psign == RIGHT)
- {
+ if (screensize != last_screensize) {
init_texture(driver, screensize, &images[1]);
image = images[1];
- } else {
init_texture(driver, screensize, &images[0]);
image = images[0];
+ last_screensize = screensize;
}
driver->setRenderTarget(image, true, true,