ANDROID: Do not access Surface::pixels directly.

This commit is contained in:
Johannes Schickel 2013-08-06 03:43:08 +02:00
parent 9179f0b78f
commit d9b90d67d3
2 changed files with 7 additions and 7 deletions

View file

@ -552,7 +552,7 @@ Graphics::Surface *OSystem_Android::lockScreen() {
GLTHREADCHECK;
Graphics::Surface *surface = _game_texture->surface();
assert(surface->pixels);
assert(surface->getPixels());
return surface;
}
@ -645,7 +645,7 @@ void OSystem_Android::grabOverlay(void *buf, int pitch) {
assert(surface->format.bytesPerPixel == sizeof(uint16));
byte *dst = (byte *)buf;
const byte *src = (const byte *)surface->pixels;
const byte *src = (const byte *)surface->getPixels();
uint h = surface->h;
do {

View file

@ -233,7 +233,7 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) {
_pixels = new byte[w * h * _surface.format.bytesPerPixel];
assert(_pixels);
_surface.pixels = _pixels;
_surface.setPixels(_pixels);
fillBuffer(0);
@ -256,7 +256,7 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h,
}
void GLESTexture::fillBuffer(uint32 color) {
assert(_surface.pixels);
assert(_surface.getPixels());
if (_pixelFormat.bytesPerPixel == 1 ||
((color & 0xff) == ((color >> 8) & 0xff)))
@ -377,7 +377,7 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
assert(_pixels);
// fixup surface, for the outside this is a CLUT8 surface
_surface.pixels = _pixels;
_surface.setPixels(_pixels);
fillBuffer(0);
@ -386,8 +386,8 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
}
void GLESFakePaletteTexture::fillBuffer(uint32 color) {
assert(_surface.pixels);
memset(_surface.pixels, color & 0xff, _surface.pitch * _surface.h);
assert(_surface.getPixels());
memset(_surface.getPixels(), color & 0xff, _surface.pitch * _surface.h);
setDirty();
}