aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhewg2011-03-14 18:06:08 +0100
committerdhewg2011-03-14 19:35:36 +0100
commitf587b6ee04b18366205277f76c3f048313e971a6 (patch)
treef3e9da2db6203ade519ee7eb2681ff0e7c3ff344
parente1575e57f818f57b022531f31161e521869d7483 (diff)
downloadscummvm-rg350-f587b6ee04b18366205277f76c3f048313e971a6.tar.gz
scummvm-rg350-f587b6ee04b18366205277f76c3f048313e971a6.tar.bz2
scummvm-rg350-f587b6ee04b18366205277f76c3f048313e971a6.zip
ANDROID: Implement grabOverlay()
-rw-r--r--backends/platform/android/gfx.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 191d82efad..2a66fcf247 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -253,6 +253,7 @@ void OSystem_Android::initOverlay() {
LOGI("overlay size is %ux%u", overlay_width, overlay_height);
_overlay_texture->allocBuffer(overlay_width, overlay_height);
+ _overlay_texture->clearBuffer();
_overlay_texture->setDrawRect(0, 0,
_egl_surface_width, _egl_surface_height);
}
@@ -618,17 +619,15 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) {
GLTHREADCHECK;
- // We support overlay alpha blending, so the pixel data here
- // shouldn't actually be used. Let's fill it with zeros, I'm sure
- // it will be fine...
const Graphics::Surface *surface = _overlay_texture->surface_const();
assert(surface->bytesPerPixel == sizeof(buf[0]));
+ const byte *src = (const byte *)surface->pixels;
uint h = surface->h;
do {
- memset(buf, 0, surface->w * sizeof(buf[0]));
-
+ memcpy(buf, src, surface->w * surface->bytesPerPixel);
+ src += surface->pitch;
// This 'pitch' is pixels not bytes
buf += pitch;
} while (--h);