aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt2005-10-15 14:15:22 +0000
committerMarcus Comstedt2005-10-15 14:15:22 +0000
commitdbea2b5a1d6920d056e9fe7bd17efc409756e11a (patch)
treeffc8113058ede903f0a7180fb97cafd7d0542401
parent4d85ddbc28263ab140f82af1ee9dfd8326c7cfac (diff)
downloadscummvm-rg350-dbea2b5a1d6920d056e9fe7bd17efc409756e11a.tar.gz
scummvm-rg350-dbea2b5a1d6920d056e9fe7bd17efc409756e11a.tar.bz2
scummvm-rg350-dbea2b5a1d6920d056e9fe7bd17efc409756e11a.zip
Added some missing functions.
svn-id: r19099
-rw-r--r--backends/dc/dc.h12
-rw-r--r--backends/dc/display.cpp53
2 files changed, 65 insertions, 0 deletions
diff --git a/backends/dc/dc.h b/backends/dc/dc.h
index 2f07759754..b385891168 100644
--- a/backends/dc/dc.h
+++ b/backends/dc/dc.h
@@ -76,6 +76,12 @@ class OSystem_Dreamcast : public OSystem {
// The screen will not be updated to reflect the new bitmap
void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
+ // Copies the current screen contents to a new surface.
+ bool grabRawScreen(Graphics::Surface *surf);
+
+ // Clear the screen to black.
+ void clearScreen();
+
// Update the dirty areas of the screen
void updateScreen();
@@ -129,6 +135,12 @@ class OSystem_Dreamcast : public OSystem {
void quit();
// Overlay
+ int16 getOverlayHeight();
+ int16 getOverlayWidth();
+ int screenToOverlayX(int x);
+ int screenToOverlayY(int y);
+ int overlayToScreenX(int x);
+ int overlayToScreenY(int y);
void showOverlay();
void hideOverlay();
void clearOverlay();
diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp
index 4d7be44568..b9880a7d98 100644
--- a/backends/dc/display.cpp
+++ b/backends/dc/display.cpp
@@ -25,6 +25,7 @@
#include <common/stdafx.h>
#include <common/scummsys.h>
#include <common/scaler/intern.h>
+#include <graphics/surface.h>
#include "dc.h"
#define SCREEN_W 640
@@ -580,3 +581,55 @@ int OSystem_Dreamcast::getGraphicsMode() const
{
return 0;
}
+
+bool OSystem_Dreamcast::grabRawScreen(Graphics::Surface *surf)
+{
+ if(!screen || !surf)
+ return false;
+
+ 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;
+}
+
+void OSystem_Dreamcast::clearScreen()
+{
+ memset(screen, 0, SCREEN_W*SCREEN_H);
+ _screen_dirty = true;
+}
+
+int16 OSystem_Dreamcast::getOverlayHeight()
+{
+ return OVL_H;
+}
+
+int16 OSystem_Dreamcast::getOverlayWidth()
+{
+ return OVL_W;
+}
+
+int OSystem_Dreamcast::screenToOverlayX(int x)
+{
+ return x - _overlay_x;
+}
+
+int OSystem_Dreamcast::screenToOverlayY(int y)
+{
+ return y - _overlay_y;
+}
+
+int OSystem_Dreamcast::overlayToScreenX(int x)
+{
+ return x + _overlay_x;
+}
+
+int OSystem_Dreamcast::overlayToScreenY(int y)
+{
+ return y + _overlay_y;
+}
+