aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/texture.cpp
diff options
context:
space:
mode:
authordhewg2011-03-05 18:21:35 +0100
committerdhewg2011-03-05 18:47:05 +0100
commit94db3403a3fbe228aa25cdde310e2a8daa5c33eb (patch)
tree3872223dcf94d33fdd28dce21f3fe6f6a1f300a5 /backends/platform/android/texture.cpp
parent7d506ef853a66cc35816926fe739785c2fd1f2d1 (diff)
downloadscummvm-rg350-94db3403a3fbe228aa25cdde310e2a8daa5c33eb.tar.gz
scummvm-rg350-94db3403a3fbe228aa25cdde310e2a8daa5c33eb.tar.bz2
scummvm-rg350-94db3403a3fbe228aa25cdde310e2a8daa5c33eb.zip
ANDROID: Add initial 16bit gfx support
Supported pixel formats: 565, 5551, 4444 Missing: 555 (doesn't exist on GLES)
Diffstat (limited to 'backends/platform/android/texture.cpp')
-rw-r--r--backends/platform/android/texture.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 05c551803b..e4c98e3ce0 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -83,11 +83,12 @@ void GLESTexture::initGLExtensions() {
}
GLESTexture::GLESTexture(byte bytesPerPixel, GLenum glFormat, GLenum glType,
- size_t paletteSize) :
+ size_t paletteSize, Graphics::PixelFormat pixelFormat) :
_bytesPerPixel(bytesPerPixel),
_glFormat(glFormat),
_glType(glType),
_paletteSize(paletteSize),
+ _pixelFormat(pixelFormat),
_texture_width(0),
_texture_height(0),
_all_dirty(true)
@@ -279,14 +280,21 @@ void GLESTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
}
GLES4444Texture::GLES4444Texture() :
- GLESTexture(2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 0) {
+ GLESTexture(2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 0, getPixelFormat()) {
}
GLES4444Texture::~GLES4444Texture() {
}
+GLES5551Texture::GLES5551Texture() :
+ GLESTexture(2, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 0, getPixelFormat()) {
+}
+
+GLES5551Texture::~GLES5551Texture() {
+}
+
GLES565Texture::GLES565Texture() :
- GLESTexture(2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0) {
+ GLESTexture(2, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0, getPixelFormat()) {
}
GLES565Texture::~GLES565Texture() {
@@ -294,7 +302,8 @@ GLES565Texture::~GLES565Texture() {
GLESPaletteTexture::GLESPaletteTexture(byte bytesPerPixel, GLenum glFormat,
GLenum glType, size_t paletteSize) :
- GLESTexture(bytesPerPixel, glFormat, glType, paletteSize),
+ GLESTexture(bytesPerPixel, glFormat, glType, paletteSize,
+ Graphics::PixelFormat::createFormatCLUT8()),
_texture(0)
{
}