mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 15:31:59 +00:00
ANDROID: Always set the surface properties
Didn't happen on the shortcut, which led to wrong properties and surface functions scribbling over memory
This commit is contained in:
parent
b9e4d77ade
commit
b4a6c89662
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user