aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/dc/display.cpp
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/dc/display.cpp
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/dc/display.cpp')
-rw-r--r--backends/platform/dc/display.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index 73312cafed..da9f6e83ff 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -609,19 +609,24 @@ int OSystem_Dreamcast::getGraphicsMode() const
return 0;
}
-bool OSystem_Dreamcast::grabRawScreen(Graphics::Surface *surf)
+Graphics::Surface *OSystem_Dreamcast::lockScreen()
{
- if(!screen || !surf)
- return false;
+ if (!screen)
+ return 0;
- surf->create(_screen_w, _screen_h, 1);
- unsigned char *src = screen, *dst = (unsigned char *)surf->pixels;
- for(int h = _screen_h; h>0; --h) {
- memcpy(dst, src, _screen_w);
- src += SCREEN_W;
- dst += _screen_w;
- }
- return true;
+ _framebuffer.pixels = screen;
+ _framebuffer.w = _screen_w;
+ _framebuffer.h = _screen_h;
+ _framebuffer.pitch = SCREEN_W;
+ _framebuffer.bytesPerPixel = 1;
+
+ return &_framebuffer;
+}
+
+void OSystem_Dreamcast::unlockScreen()
+{
+ // Force screen update
+ _screen_dirty = true;
}
void OSystem_Dreamcast::clearScreen()