aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/gp32
diff options
context:
space:
mode:
authorMax Horn2007-06-19 22:39:59 +0000
committerMax Horn2007-06-19 22:39:59 +0000
commitb51f2f3212ae8a5abbdce4d947ec2d1cad1a0b6f (patch)
tree45a838924ce55038021cd3c3d8760e80ff630f38 /backends/platform/gp32
parentab9b9a1bf362e68f5f6a69462ef2b7c146e6e08f (diff)
downloadscummvm-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/gp32')
-rw-r--r--backends/platform/gp32/gp32_osys.cpp16
-rw-r--r--backends/platform/gp32/gp32_osys.h5
2 files changed, 14 insertions, 7 deletions
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?
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();