aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authordhewg2011-03-25 00:35:47 +0100
committerdhewg2011-03-25 00:41:01 +0100
commitb4a6c89662700b448db41d1e0c99cdf39a2dc5e0 (patch)
tree46f26f682617952760342740c39d666459a0c82b /backends/platform
parentb9e4d77ade60a3293f426f6d01e176e33d729f95 (diff)
downloadscummvm-rg350-b4a6c89662700b448db41d1e0c99cdf39a2dc5e0.tar.gz
scummvm-rg350-b4a6c89662700b448db41d1e0c99cdf39a2dc5e0.tar.bz2
scummvm-rg350-b4a6c89662700b448db41d1e0c99cdf39a2dc5e0.zip
ANDROID: Always set the surface properties
Didn't happen on the shortcut, which led to wrong properties and surface functions scribbling over memory
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/android/texture.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 407ba0419d..573f8f83e1 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -231,6 +231,8 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) {
GLESBaseTexture::allocBuffer(w, h);
+ _surface.pitch = w * _pixelFormat.bytesPerPixel;
+
if (_surface.w == oldw && _surface.h == oldh) {
fillBuffer(0);
return;
@@ -243,7 +245,6 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) {
assert(_pixels);
_surface.pixels = _pixels;
- _surface.pitch = w * _pixelFormat.bytesPerPixel;
fillBuffer(0);
@@ -364,6 +365,8 @@ void GLESPaletteTexture::allocBuffer(GLuint w, GLuint h) {
GLESBaseTexture::allocBuffer(w, h);
+ _surface.pitch = _texture_width;
+
if (_surface.w == oldw && _surface.h == oldh) {
fillBuffer(0);
return;
@@ -375,7 +378,6 @@ void GLESPaletteTexture::allocBuffer(GLuint w, GLuint h) {
assert(_texture);
_surface.pixels = _texture + _paletteSize;
- _surface.pitch = _texture_width;
fillBuffer(0);
@@ -490,6 +492,9 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
GLESBaseTexture::allocBuffer(w, h);
+ _surface.bytesPerPixel = 1;
+ _surface.pitch = w;
+
if (_surface.w == oldw && _surface.h == oldh) {
fillBuffer(0);
return;
@@ -503,8 +508,6 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
// fixup surface, for the outside this is a CLUT8 surface
_surface.pixels = _pixels;
- _surface.bytesPerPixel = 1;
- _surface.pitch = w;
fillBuffer(0);