diff options
author | Max Horn | 2007-06-19 22:39:59 +0000 |
---|---|---|
committer | Max Horn | 2007-06-19 22:39:59 +0000 |
commit | b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f (patch) | |
tree | 45a838924ce55038021cd3c3d8760e80ff630f38 /backends/platform/psp | |
parent | ab9b9a1bf362e68f5f6a69462ef2b7c146e6e08f (diff) | |
download | scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.tar.gz scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.tar.bz2 scummvm-rg350-b51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f.zip |
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
Diffstat (limited to 'backends/platform/psp')
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 17 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.h | 4 |
2 files changed, 14 insertions, 7 deletions
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() { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index b833f5e179..c7a5c06051 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -62,6 +62,7 @@ protected: bool _overlayVisible; uint32 _shakePos; + Graphics::Surface _framebuffer; bool _mouseVisible; int _mouseX, _mouseY; @@ -101,7 +102,8 @@ public: virtual int16 getHeight(); virtual void setPalette(const byte *colors, uint start, uint num); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); - virtual bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); virtual void updateScreen(); virtual void setShakePos(int shakeOffset); |