From 31880186e1c78023e2e552a7fceaa27c3d2d08b1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 16 Jun 2012 02:18:01 +0200 Subject: BACKENDS: Let copyRectToScreen take a "const void *" instead of "const byte *" as buffer. This removes the need to convert the parameter to copyRectToScreen to "const byte *", which is commonly used in games, which use Graphics::Surface to store their graphics data. --- backends/platform/dc/dc.h | 2 +- backends/platform/dc/display.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'backends/platform/dc') diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index ffe003ea1d..95cb88c44b 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -127,7 +127,7 @@ public: // Draw a bitmap to screen. // 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); + void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); virtual Graphics::Surface *lockScreen(); virtual void unlockScreen(); diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index e4e9a94ec8..264b86646c 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -260,7 +260,7 @@ void OSystem_Dreamcast::initSize(uint w, uint h, const Graphics::PixelFormat *fo _devpoll = Timer(); } -void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int y, +void OSystem_Dreamcast::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) { if (w<1 || h<1) @@ -269,10 +269,11 @@ void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int x<<=1; w<<=1; } unsigned char *dst = screen + y*SCREEN_W*2 + x; + const byte *src = (const byte *)buf; do { - memcpy(dst, buf, w); + memcpy(dst, src, w); dst += SCREEN_W*2; - buf += pitch; + src += pitch; } while (--h); _screen_dirty = true; } -- cgit v1.2.3