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/PalmOS/Src/be_os5.h | 5 ++++- backends/platform/PalmOS/Src/os5_gfx.cpp | 17 +++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'backends/platform/PalmOS') diff --git a/backends/platform/PalmOS/Src/be_os5.h b/backends/platform/PalmOS/Src/be_os5.h index 13e8b4ff20..bb38c51ca6 100644 --- a/backends/platform/PalmOS/Src/be_os5.h +++ b/backends/platform/PalmOS/Src/be_os5.h @@ -110,6 +110,8 @@ private: typedef void (OSystem_PalmOS5::*RendererProc)(RectangleType &r, PointType &p); RendererProc _render; + Graphics::Surface _framebuffer; + OverlayColor *_overlayP; WinHandle _overlayH, _workScreenH; int16 *_workScreenP; @@ -168,7 +170,8 @@ public: void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); void clearScreen(); - bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); void setCursorPalette(const byte *colors, uint start, uint num); void disableCursorPalette(bool disable); diff --git a/backends/platform/PalmOS/Src/os5_gfx.cpp b/backends/platform/PalmOS/Src/os5_gfx.cpp index cff9e79abe..be5d28bc56 100644 --- a/backends/platform/PalmOS/Src/os5_gfx.cpp +++ b/backends/platform/PalmOS/Src/os5_gfx.cpp @@ -219,13 +219,18 @@ void OSystem_PalmOS5::copyRectToScreen(const byte *buf, int pitch, int x, int y, } } -bool OSystem_PalmOS5::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_PalmOS5::lockScreen() { + _framebuffer.pixels = _offScreenP; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; + + return &_framebuffer; +} - surf->create(_screenWidth, _screenHeight, 1); - MemMove(surf->pixels, _offScreenP, _screenWidth * _screenHeight); - - return true; +void OSystem_PalmOS5::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } void OSystem_PalmOS5::int_updateScreen() { -- cgit v1.2.3