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/psp/osys_psp.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'backends/platform/psp/osys_psp.cpp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index bee422d36f..f7c18e5142 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -209,13 +209,18 @@ void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } } -bool OSystem_PSP::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_PSP::lockScreen() { + _framebuffer.pixels = _offscreen; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - memcpy(surf->pixels, _offscreen, _screenWidth * _screenHeight); - - return true; + return &_framebuffer; +} + +void OSystem_PSP::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } void OSystem_PSP::updateScreen() { -- 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/psp/osys_psp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/platform/psp/osys_psp.cpp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index f7c18e5142..20a50c1b47 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -447,19 +447,19 @@ bool OSystem_PSP::pollEvent(Common::Event &event) { event.kbd.flags = 0; if (buttonsChanged & PSP_CTRL_LTRIGGER) { - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = 27; } else if (buttonsChanged & PSP_CTRL_RTRIGGER) { - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; event.kbd.ascii = 13; } else if (buttonsChanged & PSP_CTRL_START) { - event.kbd.keycode = SDLK_F5; - event.kbd.ascii = 319; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; /* } else if (buttonsChanged & PSP_CTRL_SELECT) { - event.kbd.keycode = SDLK_0; + event.kbd.keycode = Common::KEYCODE_0; event.kbd.ascii = '0'; */ } else if (buttonsChanged & PSP_CTRL_SQUARE) { - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = '.'; } -- cgit v1.2.3