projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disabled bomb spraying particles all over the screen
[supertux.git]
/
src
/
video
/
gl_texture.cpp
diff --git
a/src/video/gl_texture.cpp
b/src/video/gl_texture.cpp
index
e9d72d0
..
2839673
100644
(file)
--- a/
src/video/gl_texture.cpp
+++ b/
src/video/gl_texture.cpp
@@
-110,10
+110,25
@@
namespace GL
glBindTexture(GL_TEXTURE_2D, handle);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, handle);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+#ifdef GL_UNPACK_ROW_LENGTH
glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel);
+#else
+ /* OpenGL ES doesn't support UNPACK_ROW_LENGTH, let's hope SDL didn't add
+ * padding bytes, otherwise we need some extra code here... */
+ assert(convert->pitch == texture_width * convert->format->BytesPerPixel);
+#endif
+
+ 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");
@@
-136,8
+151,11
@@
namespace GL
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+#ifdef GL_CLAMP
+ /* OpenGL ES doesn't support it */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+#endif
assert_gl("set texture params");
}
assert_gl("set texture params");
}