From b69562824866e86245209fc9448a38b6c18dab39 Mon Sep 17 00:00:00 2001 From: John Willis Date: Wed, 7 Feb 2007 22:33:06 +0000 Subject: Update GP2X port to hack around the odd grabRawScreen issues. This is not a fix rather a workaround for now. svn-id: r25420 --- backends/platform/gp2x/graphics.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'backends') diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index 64f31f10e4..01a79e154c 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -771,22 +771,13 @@ void OSystem_GP2X::copyRectToScreen(const byte *src, int pitch, int x, int y, in SDL_UnlockSurface(_screen); } +// TIDY: DIRTY HACK: Try a REALLY simple version of grabRawScreen to +// debug why it will not work on the GP2X. bool OSystem_GP2X::grabRawScreen(Graphics::Surface *surf) { - assert(_screen); assert(surf); - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - surf->create(_screenWidth, _screenHeight, _screen->format->BytesPerPixel); - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - memcpy(surf->pixels, _screen->pixels, _screenWidth * _screenHeight * _screen->format->BytesPerPixel); - - // Unlock the screen surface - SDL_UnlockSurface(_screen); + surf->create(_screenWidth, _screenHeight, 1); + memcpy(surf->pixels, _screen->pixels, _screenWidth * _screenHeight); return true; } -- cgit v1.2.3