diff options
Diffstat (limited to 'backends/platform/android')
| -rw-r--r-- | backends/platform/android/android.h | 8 | ||||
| -rw-r--r-- | backends/platform/android/gfx.cpp | 19 | 
2 files changed, 13 insertions, 14 deletions
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index 4dad1ee7ed..4b13ca4b0f 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -244,7 +244,7 @@ protected:  	virtual void grabPalette(byte *colors, uint start, uint num);  public: -	virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, +	virtual void copyRectToScreen(const void *buf, int pitch, int x, int y,  									int w, int h);  	virtual void updateScreen();  	virtual Graphics::Surface *lockScreen(); @@ -257,8 +257,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 getOverlayHeight();  	virtual int16 getOverlayWidth(); @@ -267,7 +267,7 @@ public:  	virtual bool showMouse(bool visible);  	virtual void warpMouse(int x, int y); -	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, +	virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX,  								int hotspotY, uint32 keycolor,  								bool dontScale,  								const Graphics::PixelFormat *format); diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 304031b4ba..44046cb1c1 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -421,7 +421,7 @@ void OSystem_Android::grabPalette(byte *colors, uint start, uint num) {  		pf.colorToRGB(READ_UINT16(p), colors[0], colors[1], colors[2]);  } -void OSystem_Android::copyRectToScreen(const byte *buf, int pitch, +void OSystem_Android::copyRectToScreen(const void *buf, int pitch,  										int x, int y, int w, int h) {  	ENTER("%p, %d, %d, %d, %d, %d", buf, pitch, x, y, w, h); @@ -636,7 +636,7 @@ void OSystem_Android::clearOverlay() {  	_overlay_texture->fillBuffer(0);  } -void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) { +void OSystem_Android::grabOverlay(void *buf, int pitch) {  	ENTER("%p, %d", buf, pitch);  	GLTHREADCHECK; @@ -644,25 +644,24 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) {  	const Graphics::Surface *surface = _overlay_texture->surface_const();  	assert(surface->format.bytesPerPixel == sizeof(buf[0])); +	byte *dst = (byte *)buf;  	const byte *src = (const byte *)surface->pixels;  	uint h = surface->h;  	do { -		memcpy(buf, src, surface->w * surface->format.bytesPerPixel); +		memcpy(dst, src, surface->w * surface->format.bytesPerPixel);  		src += surface->pitch; -		// This 'pitch' is pixels not bytes -		buf += pitch; +		dst += pitch;  	} while (--h);  } -void OSystem_Android::copyRectToOverlay(const OverlayColor *buf, int pitch, +void OSystem_Android::copyRectToOverlay(const void *buf, int pitch,  										int x, int y, int w, int h) {  	ENTER("%p, %d, %d, %d, %d, %d", buf, pitch, x, y, w, h);  	GLTHREADCHECK; -	// This 'pitch' is pixels not bytes -	_overlay_texture->updateBuffer(x, y, w, h, buf, pitch * sizeof(buf[0])); +	_overlay_texture->updateBuffer(x, y, w, h, buf, pitch);  }  int16 OSystem_Android::getOverlayHeight() { @@ -685,7 +684,7 @@ bool OSystem_Android::showMouse(bool visible) {  	return true;  } -void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h, +void OSystem_Android::setMouseCursor(const void *buf, uint w, uint h,  										int hotspotX, int hotspotY,  										uint32 keycolor, bool dontScale,  										const Graphics::PixelFormat *format) { @@ -741,7 +740,7 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,  		byte *tmp = new byte[pitch * h];  		// meh, a 16bit cursor without alpha bits... this is so silly -		if (!crossBlit(tmp, buf, pitch, w * 2, w, h, +		if (!crossBlit(tmp, (const byte *)buf, pitch, w * 2, w, h,  						_mouse_texture->getPixelFormat(),  						*format)) {  			LOGE("crossblit failed");  | 
