diff options
Diffstat (limited to 'backends/platform/gp32')
-rw-r--r-- | backends/platform/gp32/gp32_osys.cpp | 28 | ||||
-rw-r--r-- | backends/platform/gp32/gp32_osys.h | 5 |
2 files changed, 22 insertions, 11 deletions
diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp index ab2ac1616b..f6e0a10bbc 100644 --- a/backends/platform/gp32/gp32_osys.cpp +++ b/backends/platform/gp32/gp32_osys.cpp @@ -209,14 +209,18 @@ void OSystem_GP32::copyRectToScreen(const byte *src, int pitch, int x, int y, in } } -bool OSystem_GP32::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_GP32::lockScreen() { + _framebuffer.pixels = _gameScreen; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - - memcpy(surf->pixels, _gameScreen, _screenWidth * _screenHeight); + return &_framebuffer; +} - return true; +void OSystem_GP32::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } //TODO: Implement Dirty rect? @@ -524,8 +528,10 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYDOWN; if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; - else - event.kbd.keycode = event.kbd.ascii = 319; + else { + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { // SELECT = pause @@ -596,8 +602,10 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYUP; if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; - else - event.kbd.keycode = event.kbd.ascii = 319; + else { + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { diff --git a/backends/platform/gp32/gp32_osys.h b/backends/platform/gp32/gp32_osys.h index fa8a0903ad..94578e8e15 100644 --- a/backends/platform/gp32/gp32_osys.h +++ b/backends/platform/gp32/gp32_osys.h @@ -49,6 +49,8 @@ protected: uint16 *_tmpScreen, *_hwScreen; OverlayColor *_overlayBuffer; + Graphics::Surface _framebuffer; + int _overlayWidth, _overlayHeight; bool _overlayVisible; uint32 _shakePos; @@ -111,7 +113,8 @@ public: void grabOverlay(OverlayColor *buf, int pitch); void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); - bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); int16 getOverlayHeight(); int16 getOverlayWidth(); |