[Scummvm-cvs-logs] scummvm master -> 4440aa431070897215b8b5b588aefe8eeb9b4be2
dhewg
dhewg at wiibrew.org
Tue Apr 5 15:13:25 CEST 2011
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ea253ff26d ANDROID: Use a faked paletted texture for CLUT cursors
4440aa4310 ANDROID: Remove code for paletted textures
Commit: ea253ff26d2d5ffeec85d34a79c00f0f50598111
https://github.com/scummvm/scummvm/commit/ea253ff26d2d5ffeec85d34a79c00f0f50598111
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-05T06:07:07-07:00
Commit Message:
ANDROID: Use a faked paletted texture for CLUT cursors
Same change as for the game screen, reduces CPU usage a little
Changed paths:
backends/platform/android/android.cpp
backends/platform/android/android.h
backends/platform/android/texture.cpp
backends/platform/android/texture.h
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 1a83289..6346ffa 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -359,7 +359,7 @@ void OSystem_Android::initBackend() {
_game_texture = new GLESFakePalette565Texture();
_overlay_texture = new GLES4444Texture();
- _mouse_texture_palette = new GLESPalette5551Texture();
+ _mouse_texture_palette = new GLESFakePalette5551Texture();
_mouse_texture = _mouse_texture_palette;
initOverlay();
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index a5a30ae..55a828b 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -129,7 +129,7 @@ private:
// Mouse layer
GLESBaseTexture *_mouse_texture;
- GLESPaletteTexture *_mouse_texture_palette;
+ GLESBaseTexture *_mouse_texture_palette;
GLES5551Texture *_mouse_texture_rgb;
Common::Point _mouse_hotspot;
uint32 _mouse_keycolor;
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 573f8f8..2018dfd 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -584,5 +584,13 @@ GLESFakePalette565Texture::GLESFakePalette565Texture() :
GLESFakePalette565Texture::~GLESFakePalette565Texture() {
}
+GLESFakePalette5551Texture::GLESFakePalette5551Texture() :
+ GLESFakePaletteTexture(GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1,
+ GLES5551Texture::pixelFormat()) {
+}
+
+GLESFakePalette5551Texture::~GLESFakePalette5551Texture() {
+}
+
#endif
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 9254187..d825357 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -330,6 +330,12 @@ public:
virtual ~GLESFakePalette565Texture();
};
+class GLESFakePalette5551Texture : public GLESFakePaletteTexture {
+public:
+ GLESFakePalette5551Texture();
+ virtual ~GLESFakePalette5551Texture();
+};
+
#endif
#endif
Commit: 4440aa431070897215b8b5b588aefe8eeb9b4be2
https://github.com/scummvm/scummvm/commit/4440aa431070897215b8b5b588aefe8eeb9b4be2
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-05T06:09:46-07:00
Commit Message:
ANDROID: Remove code for paletted textures
Unused now, because the performance isn't good enough on weak GLES
drivers.
Changed paths:
backends/platform/android/texture.cpp
backends/platform/android/texture.h
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 2018dfd..a6b28ca 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -345,125 +345,6 @@ GLES565Texture::GLES565Texture() :
GLES565Texture::~GLES565Texture() {
}
-GLESPaletteTexture::GLESPaletteTexture(GLenum glFormat, GLenum glType,
- Graphics::PixelFormat palettePixelFormat) :
- GLESBaseTexture(glFormat, glType,
- Graphics::PixelFormat::createFormatCLUT8()),
- _texture(0)
-{
- _palettePixelFormat = palettePixelFormat;
- _paletteSize = _palettePixelFormat.bytesPerPixel * 256;
-}
-
-GLESPaletteTexture::~GLESPaletteTexture() {
- delete[] _texture;
-}
-
-void GLESPaletteTexture::allocBuffer(GLuint w, GLuint h) {
- GLuint oldw = _surface.w;
- GLuint oldh = _surface.h;
-
- GLESBaseTexture::allocBuffer(w, h);
-
- _surface.pitch = _texture_width;
-
- if (_surface.w == oldw && _surface.h == oldh) {
- fillBuffer(0);
- return;
- }
-
- byte *old_texture = _texture;
-
- _texture = new byte[_paletteSize + _texture_width * _texture_height];
- assert(_texture);
-
- _surface.pixels = _texture + _paletteSize;
-
- fillBuffer(0);
-
- if (old_texture) {
- // preserve palette
- memcpy(_texture, old_texture, _paletteSize);
- delete[] old_texture;
- }
-}
-
-void GLESPaletteTexture::fillBuffer(uint32 color) {
- assert(_surface.pixels);
- memset(_surface.pixels, color & 0xff, _surface.pitch * _surface.h);
- setDirty();
-}
-
-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));
-
- const byte * src = static_cast<const byte *>(buf);
- byte *dst = static_cast<byte *>(_surface.getBasePtr(x, y));
-
- do {
- memcpy(dst, src, w);
- dst += _surface.pitch;
- src += pitch_buf;
- } while (--h);
-}
-
-void GLESPaletteTexture::drawTexture(GLshort x, GLshort y, GLshort w,
- GLshort h) {
- if (dirty()) {
- GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name));
-
- const size_t texture_size = _paletteSize +
- _texture_width * _texture_height;
-
- GLCALL(glCompressedTexImage2D(GL_TEXTURE_2D, 0, _glType,
- _texture_width, _texture_height,
- 0, texture_size, _texture));
- }
-
- GLESBaseTexture::drawTexture(x, y, w, h);
-}
-
-GLESPalette888Texture::GLESPalette888Texture() :
- GLESPaletteTexture(GL_RGB, GL_PALETTE8_RGB8_OES,
- Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0)) {
-}
-
-GLESPalette888Texture::~GLESPalette888Texture() {
-}
-
-GLESPalette8888Texture::GLESPalette8888Texture() :
- GLESPaletteTexture(GL_RGBA, GL_PALETTE8_RGBA8_OES,
- Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) {
-}
-
-GLESPalette8888Texture::~GLESPalette8888Texture() {
-}
-
-GLESPalette565Texture::GLESPalette565Texture() :
- GLESPaletteTexture(GL_RGB, GL_PALETTE8_R5_G6_B5_OES,
- Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) {
-}
-
-GLESPalette565Texture::~GLESPalette565Texture() {
-}
-
-GLESPalette4444Texture::GLESPalette4444Texture() :
- GLESPaletteTexture(GL_RGBA, GL_PALETTE8_RGBA4_OES,
- Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)) {
-}
-
-GLESPalette4444Texture::~GLESPalette4444Texture() {
-}
-
-GLESPalette5551Texture::GLESPalette5551Texture() :
- GLESPaletteTexture(GL_RGBA, GL_PALETTE8_RGB5_A1_OES,
- Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0)) {
-}
-
-GLESPalette5551Texture::~GLESPalette5551Texture() {
-}
-
GLESFakePaletteTexture::GLESFakePaletteTexture(GLenum glFormat, GLenum glType,
Graphics::PixelFormat pixelFormat) :
GLESBaseTexture(glFormat, glType, pixelFormat),
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index d825357..6344326 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -227,70 +227,6 @@ public:
}
};
-class GLESPaletteTexture : public GLESBaseTexture {
-protected:
- GLESPaletteTexture(GLenum glFormat, GLenum glType,
- Graphics::PixelFormat palettePixelFormat);
-
-public:
- virtual ~GLESPaletteTexture();
-
- virtual void allocBuffer(GLuint w, GLuint h);
- virtual void updateBuffer(GLuint x, GLuint y, GLuint width, GLuint height,
- const void *buf, int pitch_buf);
- virtual void fillBuffer(uint32 color);
-
- virtual void drawTexture(GLshort x, GLshort y, GLshort w, GLshort h);
-
- virtual const byte *palette_const() const {
- return _texture;
- };
-
- virtual byte *palette() {
- setDirty();
- return _texture;
- };
-
-protected:
- byte *_texture;
- size_t _paletteSize;
-};
-
-// RGB888 256-entry paletted texture
-class GLESPalette888Texture : public GLESPaletteTexture {
-public:
- GLESPalette888Texture();
- virtual ~GLESPalette888Texture();
-};
-
-// RGBA8888 256-entry paletted texture
-class GLESPalette8888Texture : public GLESPaletteTexture {
-public:
- GLESPalette8888Texture();
- virtual ~GLESPalette8888Texture();
-};
-
-// RGB565 256-entry paletted texture
-class GLESPalette565Texture : public GLESPaletteTexture {
-public:
- GLESPalette565Texture();
- virtual ~GLESPalette565Texture();
-};
-
-// RGBA4444 256-entry paletted texture
-class GLESPalette4444Texture : public GLESPaletteTexture {
-public:
- GLESPalette4444Texture();
- virtual ~GLESPalette4444Texture();
-};
-
-// RGBA5551 256-entry paletted texture
-class GLESPalette5551Texture : public GLESPaletteTexture {
-public:
- GLESPalette5551Texture();
- virtual ~GLESPalette5551Texture();
-};
-
class GLESFakePaletteTexture : public GLESBaseTexture {
protected:
GLESFakePaletteTexture(GLenum glFormat, GLenum glType,
More information about the Scummvm-git-logs
mailing list