projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved SDL_Surface optimizer to handle images that have fairly constant alpha and...
[supertux.git]
/
src
/
video
/
gl_texture.cpp
diff --git
a/src/video/gl_texture.cpp
b/src/video/gl_texture.cpp
index
e9d72d0
..
413d0ce
100644
(file)
--- a/
src/video/gl_texture.cpp
+++ b/
src/video/gl_texture.cpp
@@
-111,9
+111,17
@@
namespace GL
glBindTexture(GL_TEXTURE_2D, handle);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
glBindTexture(GL_TEXTURE_2D, handle);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
+ if(SDL_MUSTLOCK(convert))
+ {
+ SDL_LockSurface(convert);
+ }
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
texture_height, 0, sdl_format,
GL_UNSIGNED_BYTE, convert->pixels);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture_width,
texture_height, 0, sdl_format,
GL_UNSIGNED_BYTE, convert->pixels);
+ if(SDL_MUSTLOCK(convert))
+ {
+ SDL_UnlockSurface(convert);
+ }
assert_gl("creating texture");
assert_gl("creating texture");