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/n64/osys_n64_base.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'backends/platform/n64/osys_n64_base.cpp') diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp index f36f7399e1..d8956404f5 100644 --- a/backends/platform/n64/osys_n64_base.cpp +++ b/backends/platform/n64/osys_n64_base.cpp @@ -442,17 +442,18 @@ void OSystem_N64::setCursorPalette(const byte *colors, uint start, uint num) { _dirtyOffscreen = true; } -void OSystem_N64::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { +void OSystem_N64::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) { //Clip the coordinates + const byte *src = (const byte *)buf; if (x < 0) { w += x; - buf -= x; + src -= x; x = 0; } if (y < 0) { h += y; - buf -= y * pitch; + src -= y * pitch; y = 0; } @@ -472,14 +473,14 @@ void OSystem_N64::copyRectToScreen(const byte *buf, int pitch, int x, int y, int do { for (int hor = 0; hor < w; hor++) { - if (dst_pal[hor] != buf[hor]) { - uint16 color = _screenPalette[buf[hor]]; + if (dst_pal[hor] != src[hor]) { + uint16 color = _screenPalette[src[hor]]; dst_hicol[hor] = color; // Save image converted to 16-bit - dst_pal[hor] = buf[hor]; // Save palettized display + dst_pal[hor] = src[hor]; // Save palettized display } } - buf += pitch; + src += pitch; dst_pal += _screenWidth; dst_hicol += _screenWidth; } while (--h); -- cgit v1.2.3