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/wii/osystem_gfx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'backends/platform/wii/osystem_gfx.cpp') diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp index a00cea8252..c2b6553bac 100644 --- a/backends/platform/wii/osystem_gfx.cpp +++ b/backends/platform/wii/osystem_gfx.cpp @@ -395,7 +395,7 @@ void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) { _cursorPaletteDirty = true; } -void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y, +void OSystem_Wii::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) { assert(x >= 0 && x < _gameWidth); assert(y >= 0 && y < _gameHeight); @@ -407,7 +407,7 @@ void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y, if (!Graphics::crossBlit(_gamePixels + y * _gameWidth * _pfGame.bytesPerPixel + x * _pfGame.bytesPerPixel, - buf, _gameWidth * _pfGame.bytesPerPixel, + (const byte *)buf, _gameWidth * _pfGame.bytesPerPixel, pitch, w, h, _pfGameTexture, _pfGame)) { printf("crossBlit failed\n"); ::abort(); @@ -418,9 +418,10 @@ void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y, if (_gameWidth == pitch && pitch == w) { memcpy(dst, buf, h * w); } else { + const byte *src = (const byte *)buf; do { - memcpy(dst, buf, w); - buf += pitch; + memcpy(dst, src, w); + src += pitch; dst += _gameWidth; } while (--h); } -- cgit v1.2.3