diff options
author | dhewg | 2011-04-05 15:09:46 +0200 |
---|---|---|
committer | dhewg | 2011-04-05 15:09:46 +0200 |
commit | 4440aa431070897215b8b5b588aefe8eeb9b4be2 (patch) | |
tree | 489fbc8017519f7d9d0c576365c194fb591ddbad /backends/platform/android/texture.cpp | |
parent | ea253ff26d2d5ffeec85d34a79c00f0f50598111 (diff) | |
download | scummvm-rg350-4440aa431070897215b8b5b588aefe8eeb9b4be2.tar.gz scummvm-rg350-4440aa431070897215b8b5b588aefe8eeb9b4be2.tar.bz2 scummvm-rg350-4440aa431070897215b8b5b588aefe8eeb9b4be2.zip |
ANDROID: Remove code for paletted textures
Unused now, because the performance isn't good enough on weak GLES
drivers.
Diffstat (limited to 'backends/platform/android/texture.cpp')
-rw-r--r-- | backends/platform/android/texture.cpp | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 2018dfdaab..a6b28ca485 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), |