aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authordhewg2011-03-13 22:56:44 +0100
committerdhewg2011-03-13 23:30:17 +0100
commitc63c2a9e59ab9f9013a5e0e1f6c443352ce4f20f (patch)
treee6ad3c3528a0285f5f80f77e206b80b119d4ed59 /backends
parent2dd669d808b89f0d3777d196091b404a4e9baf05 (diff)
downloadscummvm-rg350-c63c2a9e59ab9f9013a5e0e1f6c443352ce4f20f.tar.gz
scummvm-rg350-c63c2a9e59ab9f9013a5e0e1f6c443352ce4f20f.tar.bz2
scummvm-rg350-c63c2a9e59ab9f9013a5e0e1f6c443352ce4f20f.zip
ANDROID: Fix texture clear color
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/android/gfx.cpp6
-rw-r--r--backends/platform/android/texture.cpp12
-rw-r--r--backends/platform/android/texture.h4
3 files changed, 19 insertions, 3 deletions
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 20534331bc..332442345c 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -143,7 +143,7 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
}
(*texture)->allocBuffer(width, height);
- (*texture)->fillBuffer(0);
+ (*texture)->clearBuffer();
}
#endif
@@ -264,7 +264,7 @@ void OSystem_Android::initSize(uint width, uint height,
initTexture(&_game_texture, width, height, format);
#else
_game_texture->allocBuffer(width, height);
- _game_texture->fillBuffer(0);
+ _game_texture->clearBuffer();
#endif
updateScreenRect();
@@ -686,7 +686,7 @@ void OSystem_Android::setMouseCursor(const byte *buf, uint w, uint h,
delete[] tmp;
- _mouse_texture->fillBuffer(0);
+ _mouse_texture->clearBuffer();
return;
}
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 499de00f56..b129b5ed48 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -267,6 +267,10 @@ void GLESTexture::fillBuffer(uint32 color) {
setDirty();
}
+void GLESTexture::clearBuffer() {
+ fillBuffer(_pixelFormat.ARGBToColor(0xff, 0, 0, 0));
+}
+
void GLESTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
if (_all_dirty) {
_dirty_rect.top = 0;
@@ -377,6 +381,10 @@ void GLESPaletteTexture::fillBuffer(uint32 color) {
setDirty();
}
+void GLESPaletteTexture::clearBuffer() {
+ fillBuffer(0);
+}
+
void GLESPaletteTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h,
const void *buf, int pitch_buf) {
setDirtyRect(Common::Rect(x, y, x + w, y + h));
@@ -497,6 +505,10 @@ void GLESFakePaletteTexture::fillBuffer(uint32 color) {
setDirty();
}
+void GLESFakePaletteTexture::clearBuffer() {
+ fillBuffer(_palettePixelFormat.ARGBToColor(0xff, 0, 0, 0));
+}
+
void GLESFakePaletteTexture::updateBuffer(GLuint x, GLuint y, GLuint w,
GLuint h, const void *buf,
int pitch_buf) {
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 547051996b..9b41627893 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -56,6 +56,7 @@ public:
virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
const void *buf, int pitch_buf) = 0;
virtual void fillBuffer(uint32 color) = 0;
+ virtual void clearBuffer() = 0;
virtual void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);
@@ -179,6 +180,7 @@ public:
virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
const void *buf, int pitch_buf);
virtual void fillBuffer(uint32 color);
+ virtual void clearBuffer();
virtual void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);
@@ -232,6 +234,7 @@ public:
virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
const void *buf, int pitch_buf);
virtual void fillBuffer(uint32 color);
+ virtual void clearBuffer();
virtual void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);
@@ -296,6 +299,7 @@ public:
virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
const void *buf, int pitch_buf);
virtual void fillBuffer(uint32 color);
+ virtual void clearBuffer();
virtual void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);