[Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.43,1.44 display.cpp,1.39,1.40

Marcus Comstedt marcus_c at users.sourceforge.net
Sat Oct 15 07:16:38 CEST 2005


Update of /cvsroot/scummvm/scummvm/backends/dc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2336

Modified Files:
	dc.h display.cpp 
Log Message:
Added some missing functions.

Index: dc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dc.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- dc.h	30 Jul 2005 21:10:50 -0000	1.43
+++ dc.h	15 Oct 2005 14:15:22 -0000	1.44
@@ -76,6 +76,12 @@
   // 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 @@
   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();

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/display.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- display.cpp	10 Oct 2005 17:58:35 -0000	1.39
+++ display.cpp	15 Oct 2005 14:15:22 -0000	1.40
@@ -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 @@
 {
   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;
+}
+





More information about the Scummvm-git-logs mailing list