aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/n64/osys_n64_base.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-16 02:18:01 +0200
committerJohannes Schickel2012-06-16 02:18:01 +0200
commit31880186e1c78023e2e552a7fceaa27c3d2d08b1 (patch)
tree08f62b1b8d032a490e1d3d63f33814ed93785439 /backends/platform/n64/osys_n64_base.cpp
parentf917db972e0ae7e4e82a6430010a155cbb3a92c0 (diff)
downloadscummvm-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/osys_n64_base.cpp')
-rw-r--r--backends/platform/n64/osys_n64_base.cpp15
1 files changed, 8 insertions, 7 deletions
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);