aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/n64/osys_n64_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/n64/osys_n64_base.cpp')
-rw-r--r--backends/platform/n64/osys_n64_base.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index b526c68762..ed2badb305 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -683,28 +683,30 @@ void OSystem_N64::clearOverlay() {
_dirtyOffscreen = true;
}
-void OSystem_N64::grabOverlay(OverlayColor *buf, int pitch) {
+void OSystem_N64::grabOverlay(void *buf, int pitch) {
int h = _overlayHeight;
OverlayColor *src = _overlayBuffer;
+ byte *dst = (byte *)buf;
do {
- memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
+ memcpy(dst, src, _overlayWidth * sizeof(OverlayColor));
src += _overlayWidth;
- buf += pitch;
+ dst += pitch;
} while (--h);
}
-void OSystem_N64::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
+void OSystem_N64::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
+ const byte *src = (const byte *)buf;
//Clip the coordinates
if (x < 0) {
w += x;
- buf -= x;
+ src -= x * sizeof(OverlayColor);
x = 0;
}
if (y < 0) {
h += y;
- buf -= y * pitch;
+ src -= y * pitch;
y = 0;
}
@@ -723,11 +725,11 @@ void OSystem_N64::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, i
OverlayColor *dst = _overlayBuffer + (y * _overlayWidth + x);
if (_overlayWidth == pitch && pitch == w) {
- memcpy(dst, buf, h * w * sizeof(OverlayColor));
+ memcpy(dst, src, h * w * sizeof(OverlayColor));
} else {
do {
- memcpy(dst, buf, w * sizeof(OverlayColor));
- buf += pitch;
+ memcpy(dst, src, w * sizeof(OverlayColor));
+ src += pitch;
dst += _overlayWidth;
} while (--h);
}