Support twiddled and non-twiddled paletted textures

This commit is contained in:
Luke Benstead 2019-03-03 18:49:33 +00:00
parent d12032c961
commit 3c3018450f
3 changed files with 9 additions and 3 deletions

View File

@ -527,7 +527,11 @@ static GLuint _determinePVRFormat(GLint internalFormat, GLenum type) {
case GL_COMPRESSED_ARGB_1555_VQ_MIPMAP_TWID_KOS:
return PVR_TXRFMT_ARGB1555 | PVR_TXRFMT_TWIDDLED | PVR_TXRFMT_VQ_ENABLE;
case GL_COLOR_INDEX8_EXT:
return PVR_TXRFMT_PAL8BPP;
if(type == GL_UNSIGNED_BYTE_TWID_KOS) {
return PVR_TXRFMT_PAL8BPP | PVR_TXRFMT_TWIDDLED;
} else {
return PVR_TXRFMT_PAL8BPP | PVR_TXRFMT_NONTWIDDLED;
}
default:
return 0;
}

View File

@ -32,6 +32,8 @@ __BEGIN_DECLS
#define GL_NEARZ_CLIPPING_KOS 0xEEFA
#define GL_UNSIGNED_BYTE_TWID_KOS 0xEEFB
GLAPI void APIENTRY glKosSwapBuffers();

View File

@ -121,8 +121,8 @@ void LoadGLTextures() {
// 2d texture, level of detail 0 (normal), 3 components (red, green, blue), x size from image, y size from image,
// border 0 (normal), rgb color data, unsigned byte data, and finally the data itself.
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, image1->width, image1->height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, image1->data);
};
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, image1->width, image1->height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE_TWID_KOS, image1->data);
}
/* A general OpenGL initialization function. Sets all of the initial parameters. */
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.