From b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 19 Jun 2007 22:39:59 +0000 Subject: Implemented the OSystem framebuffer API, as discussed on scummvm-devel. All changes are just fine, and won't cause any compile problems or regressions, despite the fact that I can't test most of the non-SDL backend changes, at an improbability level of two to the power of two hundred and seventy-six thousand to one against - possibly much higher. Anything you still can't cope with is therefore your own problem. Please relax. svn-id: r27548 --- backends/platform/gp32/gp32_osys.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'backends/platform/gp32/gp32_osys.cpp') diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp index ab2ac1616b..1cb5eb2d9f 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? -- cgit v1.2.3 From 2b23374468549722c8068d448d9bbf5e100d7301 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 22 Jun 2007 20:04:44 +0000 Subject: Converted lots of code to use Common::ASCII_* and COMMON::KEYCODE_* constants. This also revealed the evil mixing of keycodes and ascii we do in many places :-/ svn-id: r27616 --- backends/platform/gp32/gp32_osys.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'backends/platform/gp32/gp32_osys.cpp') diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp index 1cb5eb2d9f..1f07b0660d 100644 --- a/backends/platform/gp32/gp32_osys.cpp +++ b/backends/platform/gp32/gp32_osys.cpp @@ -528,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::ASCII_F5; // FIXME: Should be KEYCODE_F5 + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { // SELECT = pause @@ -600,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::ASCII_F5; // FIXME: Should be KEYCODE_F5 + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { -- cgit v1.2.3 From 05a70fc8e404bd2003e8faa3bc1d4564918eca03 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 22 Jun 2007 23:43:17 +0000 Subject: Produce 'correct' keycode/ascii values for function keys svn-id: r27642 --- backends/platform/gp32/gp32_osys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/gp32/gp32_osys.cpp') diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp index 1f07b0660d..f6e0a10bbc 100644 --- a/backends/platform/gp32/gp32_osys.cpp +++ b/backends/platform/gp32/gp32_osys.cpp @@ -529,7 +529,7 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; else { - event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5 + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = Common::ASCII_F5; } return true; @@ -603,7 +603,7 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; else { - event.kbd.keycode = Common::ASCII_F5; // FIXME: Should be KEYCODE_F5 + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = Common::ASCII_F5; } return true; -- cgit v1.2.3