diff options
author | Johannes Schickel | 2012-06-16 02:18:01 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-06-16 02:18:01 +0200 |
commit | 31880186e1c78023e2e552a7fceaa27c3d2d08b1 (patch) | |
tree | 08f62b1b8d032a490e1d3d63f33814ed93785439 /backends/platform/n64 | |
parent | f917db972e0ae7e4e82a6430010a155cbb3a92c0 (diff) | |
download | scummvm-rg350-31880186e1c78023e2e552a7fceaa27c3d2d08b1.tar.gz scummvm-rg350-31880186e1c78023e2e552a7fceaa27c3d2d08b1.tar.bz2 scummvm-rg350-31880186e1c78023e2e552a7fceaa27c3d2d08b1.zip |
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.
Diffstat (limited to 'backends/platform/n64')
-rw-r--r-- | backends/platform/n64/osys_n64.h | 2 | ||||
-rw-r--r-- | backends/platform/n64/osys_n64_base.cpp | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h index b8519eeea6..8e28dc9c98 100644 --- a/backends/platform/n64/osys_n64.h +++ b/backends/platform/n64/osys_n64.h @@ -162,7 +162,7 @@ protected: virtual void grabPalette(byte *colors, uint start, uint num); public: - virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); + virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); virtual void updateScreen(); virtual Graphics::Surface *lockScreen(); virtual void unlockScreen(); 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); |