Stub out glColorTableEXT
This commit is contained in:
parent
52e1be498e
commit
baf7cf5bdd
|
@ -827,7 +827,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
|
||||||
|
|
||||||
/* Clipping may have realloc'd so reset the start pointer */
|
/* Clipping may have realloc'd so reset the start pointer */
|
||||||
start = ((ClipVertex*) activeList->vector.data) + startOffset;
|
start = ((ClipVertex*) activeList->vector.data) + startOffset;
|
||||||
header = start - 1; /* Update the header pointer */
|
header = (PVRHeader*) (start - 1); /* Update the header pointer */
|
||||||
|
|
||||||
#if DEBUG_CLIPPING
|
#if DEBUG_CLIPPING
|
||||||
fprintf(stderr, "--------\n");
|
fprintf(stderr, "--------\n");
|
||||||
|
|
10
GL/private.h
10
GL/private.h
|
@ -41,6 +41,14 @@ typedef struct {
|
||||||
AlignedVector vector;
|
AlignedVector vector;
|
||||||
} PolyList;
|
} PolyList;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* Palette data is always stored in RAM as RGBA8888 and packed as ARGB8888
|
||||||
|
* when uploaded to the PVR */
|
||||||
|
GLubyte* data;
|
||||||
|
GLsizei width;
|
||||||
|
GLenum format;
|
||||||
|
} TexturePalette;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GLushort width;
|
GLushort width;
|
||||||
GLushort height;
|
GLushort height;
|
||||||
|
@ -57,6 +65,8 @@ typedef struct {
|
||||||
GLenum magFilter;
|
GLenum magFilter;
|
||||||
|
|
||||||
GLboolean isCompressed;
|
GLboolean isCompressed;
|
||||||
|
|
||||||
|
TexturePalette* palette;
|
||||||
} TextureObject;
|
} TextureObject;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
78
GL/texture.c
78
GL/texture.c
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "../include/glext.h"
|
#include "../include/glext.h"
|
||||||
#include "../include/glkos.h"
|
#include "../include/glkos.h"
|
||||||
|
@ -141,6 +142,7 @@ void APIENTRY glGenTextures(GLsizei n, GLuint *textures) {
|
||||||
txr->mipmapCount = 0;
|
txr->mipmapCount = 0;
|
||||||
txr->minFilter = GL_NEAREST;
|
txr->minFilter = GL_NEAREST;
|
||||||
txr->magFilter = GL_NEAREST;
|
txr->magFilter = GL_NEAREST;
|
||||||
|
txr->palette = NULL;
|
||||||
|
|
||||||
*textures = id;
|
*textures = id;
|
||||||
|
|
||||||
|
@ -769,3 +771,79 @@ void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data) {
|
||||||
|
GLenum validTargets[] = {GL_TEXTURE_2D, 0};
|
||||||
|
GLenum validInternalFormats[] = {GL_RGB8, GL_RGBA8, 0};
|
||||||
|
GLenum validFormats[] = {GL_RGB, GL_RGBA, 0};
|
||||||
|
GLenum validTypes[] = {GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, 0};
|
||||||
|
|
||||||
|
if(_glCheckValidEnum(target, validTargets, __func__) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_glCheckValidEnum(internalFormat, validInternalFormats, __func__) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_glCheckValidEnum(format, validFormats, __func__) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_glCheckValidEnum(type, validTypes, __func__) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GLuint sourceStride = _determineStride(format, type);
|
||||||
|
|
||||||
|
TextureConversionFunc convert = _determineConversion(
|
||||||
|
GL_RGBA8, /* We always store palettes in this format */
|
||||||
|
format,
|
||||||
|
type
|
||||||
|
);
|
||||||
|
|
||||||
|
if(!convert) {
|
||||||
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
|
_glKosPrintError();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TextureObject* active = getBoundTexture();
|
||||||
|
if(active->palette) {
|
||||||
|
free(active->palette->data);
|
||||||
|
active->palette->data = NULL;
|
||||||
|
} else {
|
||||||
|
active->palette = (TexturePalette*) malloc(sizeof(TexturePalette));
|
||||||
|
}
|
||||||
|
|
||||||
|
active->palette->data = (GLubyte*) malloc(width * 4);
|
||||||
|
|
||||||
|
GLubyte* src = (GLubyte*) data;
|
||||||
|
GLubyte* dst = (GLubyte*) active->palette->data;
|
||||||
|
|
||||||
|
/* Transform and copy the source palette to the texture */
|
||||||
|
GLushort i = 0;
|
||||||
|
for(; i < width; ++i) {
|
||||||
|
convert(src, (GLushort*) dst);
|
||||||
|
|
||||||
|
src += sourceStride;
|
||||||
|
dst += 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
14
include/gl.h
14
include/gl.h
|
@ -349,6 +349,20 @@ __BEGIN_DECLS
|
||||||
#define GL_LUMINANCE_ALPHA 0x190A
|
#define GL_LUMINANCE_ALPHA 0x190A
|
||||||
#define GL_BGRA 0x80E1
|
#define GL_BGRA 0x80E1
|
||||||
|
|
||||||
|
#define GL_RGB4 0x804F
|
||||||
|
#define GL_RGB5 0x8050
|
||||||
|
#define GL_RGB8 0x8051
|
||||||
|
#define GL_RGB10 0x8052
|
||||||
|
#define GL_RGB12 0x8053
|
||||||
|
#define GL_RGB16 0x8054
|
||||||
|
#define GL_RGBA2 0x8055
|
||||||
|
#define GL_RGBA4 0x8056
|
||||||
|
#define GL_RGB5_A1 0x8057
|
||||||
|
#define GL_RGBA8 0x8058
|
||||||
|
#define GL_RGB10_A2 0x8059
|
||||||
|
#define GL_RGBA12 0x805A
|
||||||
|
#define GL_RGBA16 0x805B
|
||||||
|
|
||||||
#define GLbyte char
|
#define GLbyte char
|
||||||
#define GLshort short
|
#define GLshort short
|
||||||
#define GLint int
|
#define GLint int
|
||||||
|
|
|
@ -134,6 +134,31 @@ GLAPI void APIENTRY glGenerateMipmapEXT(GLenum target);
|
||||||
GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT(GLenum target);
|
GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT(GLenum target);
|
||||||
GLAPI GLboolean APIENTRY glIsFramebufferEXT(GLuint framebuffer);
|
GLAPI GLboolean APIENTRY glIsFramebufferEXT(GLuint framebuffer);
|
||||||
|
|
||||||
|
/* ext_paletted_texture */
|
||||||
|
#define GL_COLOR_INDEX1_EXT 0x80E2
|
||||||
|
#define GL_COLOR_INDEX2_EXT 0x80E3
|
||||||
|
#define GL_COLOR_INDEX4_EXT 0x80E4
|
||||||
|
#define GL_COLOR_INDEX8_EXT 0x80E5
|
||||||
|
#define GL_COLOR_INDEX12_EXT 0x80E6
|
||||||
|
#define GL_COLOR_INDEX16_EXT 0x80E7
|
||||||
|
|
||||||
|
#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
|
||||||
|
#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
|
||||||
|
#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
|
||||||
|
#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
|
||||||
|
#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
|
||||||
|
#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
|
||||||
|
#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
|
||||||
|
#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
|
||||||
|
|
||||||
|
#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
|
||||||
|
|
||||||
|
GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data);
|
||||||
|
GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
|
||||||
|
GLAPI void APIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *data);
|
||||||
|
GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params);
|
||||||
|
GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params);
|
||||||
|
|
||||||
/* Loads VQ compressed texture from SH4 RAM into PVR VRAM */
|
/* Loads VQ compressed texture from SH4 RAM into PVR VRAM */
|
||||||
/* internalformat must be one of the following constants:
|
/* internalformat must be one of the following constants:
|
||||||
GL_UNSIGNED_SHORT_5_6_5_VQ
|
GL_UNSIGNED_SHORT_5_6_5_VQ
|
||||||
|
|
Loading…
Reference in New Issue
Block a user