From aec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 16 Jun 2012 04:17:14 +0200 Subject: ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values. This is a first step to get rid of OverlayColor, which is a requirement for proper 4Bpp overlay support. --- backends/platform/dc/display.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'backends/platform/dc/display.cpp') diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index 35e7b70a82..cc5798fc10 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -653,27 +653,29 @@ void OSystem_Dreamcast::clearOverlay() _overlay_dirty = true; } -void OSystem_Dreamcast::grabOverlay(OverlayColor *buf, int pitch) +void OSystem_Dreamcast::grabOverlay(void *buf, int pitch) { int h = OVL_H; unsigned short *src = overlay; + unsigned char *dst = (unsigned char *)buf; do { - memcpy(buf, src, OVL_W*sizeof(int16)); + memcpy(dst, src, OVL_W*sizeof(int16)); src += OVL_W; - buf += pitch; + dst += pitch; } while (--h); } -void OSystem_Dreamcast::copyRectToOverlay(const OverlayColor *buf, int pitch, +void OSystem_Dreamcast::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) { if (w<1 || h<1) return; unsigned short *dst = overlay + y*OVL_W + x; + const unsigned char *src = (const unsigned char *)buf; do { - memcpy(dst, buf, w*sizeof(int16)); + memcpy(dst, src, w*sizeof(int16)); dst += OVL_W; - buf += pitch; + src += pitch; } while (--h); _overlay_dirty = true; } -- cgit v1.2.3