aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wii
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-16 04:17:14 +0200
committerJohannes Schickel2012-06-16 04:17:14 +0200
commitaec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95 (patch)
tree94d1ddb5cf823bb08d86161f9e5415c54011a0ea /backends/platform/wii
parent99229fc7ab3a15da8b964443cb58bc00caa5f0a4 (diff)
downloadscummvm-rg350-aec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95.tar.gz
scummvm-rg350-aec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95.tar.bz2
scummvm-rg350-aec9b9e22a9bff54ae3c39bb796bae0f4b4c2d95.zip
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.
Diffstat (limited to 'backends/platform/wii')
-rw-r--r--backends/platform/wii/osystem.h4
-rw-r--r--backends/platform/wii/osystem_gfx.cpp20
2 files changed, 13 insertions, 11 deletions
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index ecd69178bb..f1c8d77533 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -177,8 +177,8 @@ public:
virtual void showOverlay();
virtual void hideOverlay();
virtual void clearOverlay();
- virtual void grabOverlay(OverlayColor *buf, int pitch);
- virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
+ virtual void grabOverlay(void *buf, int pitch);
+ virtual void copyRectToOverlay(const void *buf, int pitch,
int x, int y, int w, int h);
virtual int16 getOverlayWidth();
virtual int16 getOverlayHeight();
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 741acd4f4a..6b0e31bd7b 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -571,28 +571,30 @@ void OSystem_Wii::clearOverlay() {
_overlayDirty = true;
}
-void OSystem_Wii::grabOverlay(OverlayColor *buf, int pitch) {
+void OSystem_Wii::grabOverlay(void *buf, int pitch) {
int h = _overlayHeight;
OverlayColor *src = _overlayPixels;
+ 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_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
+void OSystem_Wii::copyRectToOverlay(const void *buf, int pitch, int x,
int y, int w, int h) {
+ const byte *src = (const byte *)buf;
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;
}
@@ -607,11 +609,11 @@ void OSystem_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
OverlayColor *dst = _overlayPixels + (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);
}