@@ -131,18 +131,12 @@ void draw_anaglyph_3d_mode(Camera& camera, bool show_hud, Hud& hud,
131
131
void init_texture (video::IVideoDriver* driver, const v2u32& screensize,
132
132
video::ITexture** texture)
133
133
{
134
- static v2u32 last_screensize = v2u32 (0 ,0 );
135
-
136
- if (( *texture == NULL ) || (screensize != last_screensize))
134
+ if (*texture != NULL )
137
135
{
138
- if (*texture != NULL )
139
- {
140
- driver->removeTexture (*texture);
141
- }
142
- *texture = driver->addRenderTargetTexture (
143
- core::dimension2d<u32>(screensize.X , screensize.Y ));
144
- last_screensize = screensize;
136
+ driver->removeTexture (*texture);
145
137
}
138
+ *texture = driver->addRenderTargetTexture (
139
+ core::dimension2d<u32>(screensize.X , screensize.Y ));
146
140
}
147
141
148
142
video::ITexture* draw_image (const v2u32& screensize,
@@ -154,16 +148,16 @@ video::ITexture* draw_image(const v2u32& screensize,
154
148
video::SColor skycolor )
155
149
{
156
150
static video::ITexture* images[2 ] = { NULL , NULL };
151
+ static v2u32 last_screensize = v2u32 (0 ,0 );
157
152
158
153
video::ITexture* image = NULL ;
159
154
160
- if (psign == RIGHT)
161
- {
155
+ if (screensize != last_screensize) {
162
156
init_texture (driver, screensize, &images[1 ]);
163
157
image = images[1 ];
164
- } else {
165
158
init_texture (driver, screensize, &images[0 ]);
166
159
image = images[0 ];
160
+ last_screensize = screensize;
167
161
}
168
162
169
163
driver->setRenderTarget (image, true , true ,
0 commit comments