Prefix non-static private functions with '_gl'
This commit is contained in:
parent
926214bd82
commit
5f7fef2cf9
|
@ -14,11 +14,11 @@
|
||||||
|
|
||||||
static unsigned char ZCLIP_ENABLED = 1;
|
static unsigned char ZCLIP_ENABLED = 1;
|
||||||
|
|
||||||
unsigned char isClippingEnabled() {
|
unsigned char _glIsClippingEnabled() {
|
||||||
return ZCLIP_ENABLED;
|
return ZCLIP_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void enableClipping(unsigned char v) {
|
void _glEnableClipping(unsigned char v) {
|
||||||
ZCLIP_ENABLED = v;
|
ZCLIP_ENABLED = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
GL/draw.c
16
GL/draw.c
|
@ -999,7 +999,7 @@ static void mat_transform_normal3(const float* xyz, const float* xyzOut, const u
|
||||||
}
|
}
|
||||||
|
|
||||||
static void light(ClipVertex* output, const GLsizei count) {
|
static void light(ClipVertex* output, const GLsizei count) {
|
||||||
if(!isLightingEnabled()) {
|
if(!_glIsLightingEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,7 +1038,7 @@ static void light(ClipVertex* output, const GLsizei count) {
|
||||||
GLfloat to_add [] = {0.0f, 0.0f, 0.0f, 0.0f};
|
GLfloat to_add [] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||||
GLubyte j;
|
GLubyte j;
|
||||||
for(j = 0; j < MAX_LIGHTS; ++j) {
|
for(j = 0; j < MAX_LIGHTS; ++j) {
|
||||||
if(isLightEnabled(j)) {
|
if(_glIsLightEnabled(j)) {
|
||||||
_glCalculateLightingContribution(j, ES->xyz, ES->n, vertex->bgra, to_add);
|
_glCalculateLightingContribution(j, ES->xyz, ES->n, vertex->bgra, to_add);
|
||||||
|
|
||||||
total[0] += to_add[0];
|
total[0] += to_add[0];
|
||||||
|
@ -1070,7 +1070,7 @@ static void divide(ClipVertex* output, const GLsizei count) {
|
||||||
|
|
||||||
static void push(PVRHeader* header, ClipVertex* output, const GLsizei count, PolyList* activePolyList, GLshort textureUnit) {
|
static void push(PVRHeader* header, ClipVertex* output, const GLsizei count, PolyList* activePolyList, GLshort textureUnit) {
|
||||||
// Compile the header
|
// Compile the header
|
||||||
pvr_poly_cxt_t cxt = *getPVRContext();
|
pvr_poly_cxt_t cxt = *_glGetPVRContext();
|
||||||
cxt.list_type = activePolyList->list_type;
|
cxt.list_type = activePolyList->list_type;
|
||||||
|
|
||||||
_glUpdatePVRTextureContext(&cxt, textureUnit);
|
_glUpdatePVRTextureContext(&cxt, textureUnit);
|
||||||
|
@ -1104,7 +1104,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
|
||||||
glActiveTextureARB(GL_TEXTURE1);
|
glActiveTextureARB(GL_TEXTURE1);
|
||||||
glGetBooleanv(GL_TEXTURE_2D, &doMultitexture);
|
glGetBooleanv(GL_TEXTURE_2D, &doMultitexture);
|
||||||
|
|
||||||
doLighting = isLightingEnabled();
|
doLighting = _glIsLightingEnabled();
|
||||||
|
|
||||||
glActiveTextureARB(activeTexture);
|
glActiveTextureARB(activeTexture);
|
||||||
|
|
||||||
|
@ -1139,7 +1139,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
|
||||||
|
|
||||||
profiler_checkpoint("transform");
|
profiler_checkpoint("transform");
|
||||||
|
|
||||||
if(isClippingEnabled()) {
|
if(_glIsClippingEnabled()) {
|
||||||
|
|
||||||
uint32_t offset = ((start - 1) - (ClipVertex*) activeList->vector.data);
|
uint32_t offset = ((start - 1) - (ClipVertex*) activeList->vector.data);
|
||||||
|
|
||||||
|
@ -1200,7 +1200,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureObject* texture1 = getTexture1();
|
TextureObject* texture1 = _glGetTexture1();
|
||||||
|
|
||||||
if(!texture1 || ((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) {
|
if(!texture1 || ((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) {
|
||||||
/* Multitexture implicitly disabled */
|
/* Multitexture implicitly disabled */
|
||||||
|
@ -1252,7 +1252,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
|
||||||
void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
|
void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) {
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
if(checkImmediateModeInactive(__func__)) {
|
if(_glCheckImmediateModeInactive(__func__)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1262,7 +1262,7 @@ void APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvo
|
||||||
void APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
void APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
if(checkImmediateModeInactive(__func__)) {
|
if(_glCheckImmediateModeInactive(__func__)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ static void _glInitPVR() {
|
||||||
|
|
||||||
|
|
||||||
PolyList* _glActivePolyList() {
|
PolyList* _glActivePolyList() {
|
||||||
if(isBlendingEnabled()) {
|
if(_glIsBlendingEnabled()) {
|
||||||
return &TR_LIST;
|
return &TR_LIST;
|
||||||
} else {
|
} else {
|
||||||
return &OP_LIST;
|
return &OP_LIST;
|
||||||
|
|
|
@ -20,7 +20,7 @@ void _glInitFramebuffers() {
|
||||||
named_array_init(&FRAMEBUFFERS, sizeof(FrameBuffer), 32);
|
named_array_init(&FRAMEBUFFERS, sizeof(FrameBuffer), 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wipeTextureOnFramebuffers(GLuint texture) {
|
void _glWipeTextureOnFramebuffers(GLuint texture) {
|
||||||
/* Spec says we don't update inactive framebuffers, they'll presumably just cause
|
/* Spec says we don't update inactive framebuffers, they'll presumably just cause
|
||||||
* a GL_INVALID_OPERATION if we try to render to them */
|
* a GL_INVALID_OPERATION if we try to render to them */
|
||||||
if(ACTIVE_FRAMEBUFFER && ACTIVE_FRAMEBUFFER->texture_id == texture) {
|
if(ACTIVE_FRAMEBUFFER && ACTIVE_FRAMEBUFFER->texture_id == texture) {
|
||||||
|
@ -201,7 +201,7 @@ void APIENTRY glGenerateMipmapEXT(GLenum target) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureObject* tex = getBoundTexture();
|
TextureObject* tex = _glGetBoundTexture();
|
||||||
|
|
||||||
if(!tex || !tex->data || !tex->mipmapCount) {
|
if(!tex || !tex->data || !tex->mipmapCount) {
|
||||||
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
_glKosThrowError(GL_INVALID_OPERATION, __func__);
|
||||||
|
|
|
@ -36,7 +36,7 @@ void _glInitImmediateMode() {
|
||||||
aligned_vector_init(&NORMALS, sizeof(GLfloat));
|
aligned_vector_init(&NORMALS, sizeof(GLfloat));
|
||||||
}
|
}
|
||||||
|
|
||||||
GLubyte checkImmediateModeInactive(const char* func) {
|
GLubyte _glCheckImmediateModeInactive(const char* func) {
|
||||||
/* Returns 1 on error */
|
/* Returns 1 on error */
|
||||||
if(IMMEDIATE_MODE_ACTIVE) {
|
if(IMMEDIATE_MODE_ACTIVE) {
|
||||||
_glKosThrowError(GL_INVALID_OPERATION, func);
|
_glKosThrowError(GL_INVALID_OPERATION, func);
|
||||||
|
|
22
GL/private.h
22
GL/private.h
|
@ -110,10 +110,10 @@ void _glApplyRenderMatrix();
|
||||||
|
|
||||||
matrix_t* _glGetProjectionMatrix();
|
matrix_t* _glGetProjectionMatrix();
|
||||||
|
|
||||||
void wipeTextureOnFramebuffers(GLuint texture);
|
void _glWipeTextureOnFramebuffers(GLuint texture);
|
||||||
GLubyte checkImmediateModeInactive(const char* func);
|
GLubyte _glCheckImmediateModeInactive(const char* func);
|
||||||
|
|
||||||
pvr_poly_cxt_t* getPVRContext();
|
pvr_poly_cxt_t* _glGetPVRContext();
|
||||||
GLubyte _glInitTextures();
|
GLubyte _glInitTextures();
|
||||||
|
|
||||||
void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit);
|
void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit);
|
||||||
|
@ -135,27 +135,27 @@ AttribPointer* _glGetUVAttribPointer();
|
||||||
AttribPointer* _glGetSTAttribPointer();
|
AttribPointer* _glGetSTAttribPointer();
|
||||||
GLenum _glGetShadeModel();
|
GLenum _glGetShadeModel();
|
||||||
|
|
||||||
TextureObject* getTexture0();
|
TextureObject* _glGetTexture0();
|
||||||
TextureObject* getTexture1();
|
TextureObject* _glGetTexture1();
|
||||||
TextureObject* getBoundTexture();
|
TextureObject* _glGetBoundTexture();
|
||||||
GLubyte _glGetActiveTexture();
|
GLubyte _glGetActiveTexture();
|
||||||
GLuint _glGetActiveClientTexture();
|
GLuint _glGetActiveClientTexture();
|
||||||
|
|
||||||
GLboolean _glIsSharedTexturePaletteEnabled();
|
GLboolean _glIsSharedTexturePaletteEnabled();
|
||||||
void _glApplyColorTable();
|
void _glApplyColorTable();
|
||||||
|
|
||||||
GLboolean isBlendingEnabled();
|
GLboolean _glIsBlendingEnabled();
|
||||||
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
||||||
GLubyte* _glGetMipmapLocation(TextureObject* obj, GLuint level);
|
GLubyte* _glGetMipmapLocation(TextureObject* obj, GLuint level);
|
||||||
GLuint _glGetMipmapLevelCount(TextureObject* obj);
|
GLuint _glGetMipmapLevelCount(TextureObject* obj);
|
||||||
|
|
||||||
GLboolean isLightingEnabled();
|
GLboolean _glIsLightingEnabled();
|
||||||
GLboolean isLightEnabled(GLubyte light);
|
GLboolean _glIsLightEnabled(GLubyte light);
|
||||||
GLboolean _glIsColorMaterialEnabled();
|
GLboolean _glIsColorMaterialEnabled();
|
||||||
void _glCalculateLightingContribution(const GLint light, const GLfloat* pos, const GLfloat* normal, uint8_t* bgra, GLfloat* colour);
|
void _glCalculateLightingContribution(const GLint light, const GLfloat* pos, const GLfloat* normal, uint8_t* bgra, GLfloat* colour);
|
||||||
|
|
||||||
unsigned char isClippingEnabled();
|
unsigned char _glIsClippingEnabled();
|
||||||
void enableClipping(unsigned char v);
|
void _glEnableClipping(unsigned char v);
|
||||||
|
|
||||||
void _glKosThrowError(GLenum error, const char *function);
|
void _glKosThrowError(GLenum error, const char *function);
|
||||||
void _glKosPrintError();
|
void _glKosPrintError();
|
||||||
|
|
16
GL/state.c
16
GL/state.c
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
static pvr_poly_cxt_t GL_CONTEXT;
|
static pvr_poly_cxt_t GL_CONTEXT;
|
||||||
|
|
||||||
pvr_poly_cxt_t* getPVRContext() {
|
pvr_poly_cxt_t* _glGetPVRContext() {
|
||||||
return &GL_CONTEXT;
|
return &GL_CONTEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ static GLenum BLEND_SFACTOR = GL_ONE;
|
||||||
static GLenum BLEND_DFACTOR = GL_ZERO;
|
static GLenum BLEND_DFACTOR = GL_ZERO;
|
||||||
static GLboolean BLEND_ENABLED = GL_FALSE;
|
static GLboolean BLEND_ENABLED = GL_FALSE;
|
||||||
|
|
||||||
GLboolean isBlendingEnabled() {
|
GLboolean _glIsBlendingEnabled() {
|
||||||
return BLEND_ENABLED;
|
return BLEND_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ GLboolean _glCheckValidEnum(GLint param, GLenum* values, const char* func) {
|
||||||
static GLboolean TEXTURES_ENABLED [] = {GL_FALSE, GL_FALSE};
|
static GLboolean TEXTURES_ENABLED [] = {GL_FALSE, GL_FALSE};
|
||||||
|
|
||||||
void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit) {
|
void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit) {
|
||||||
const TextureObject *tx1 = (textureUnit == 0) ? getTexture0() : getTexture1();
|
const TextureObject *tx1 = (textureUnit == 0) ? _glGetTexture0() : _glGetTexture1();
|
||||||
|
|
||||||
if(!TEXTURES_ENABLED[textureUnit] || !tx1) {
|
if(!TEXTURES_ENABLED[textureUnit] || !tx1) {
|
||||||
context->txr.enable = PVR_TEXTURE_DISABLE;
|
context->txr.enable = PVR_TEXTURE_DISABLE;
|
||||||
|
@ -226,11 +226,11 @@ void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit) {
|
||||||
static GLboolean LIGHTING_ENABLED = GL_FALSE;
|
static GLboolean LIGHTING_ENABLED = GL_FALSE;
|
||||||
static GLboolean LIGHT_ENABLED[MAX_LIGHTS];
|
static GLboolean LIGHT_ENABLED[MAX_LIGHTS];
|
||||||
|
|
||||||
GLboolean isLightingEnabled() {
|
GLboolean _glIsLightingEnabled() {
|
||||||
return LIGHTING_ENABLED;
|
return LIGHTING_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean isLightEnabled(unsigned char light) {
|
GLboolean _glIsLightEnabled(unsigned char light) {
|
||||||
return LIGHT_ENABLED[light & 0xF];
|
return LIGHT_ENABLED[light & 0xF];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ GLAPI void APIENTRY glEnable(GLenum cap) {
|
||||||
LIGHT_ENABLED[cap & 0xF] = GL_TRUE;
|
LIGHT_ENABLED[cap & 0xF] = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
case GL_NEARZ_CLIPPING_KOS:
|
case GL_NEARZ_CLIPPING_KOS:
|
||||||
enableClipping(GL_TRUE);
|
_glEnableClipping(GL_TRUE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -370,7 +370,7 @@ GLAPI void APIENTRY glDisable(GLenum cap) {
|
||||||
LIGHT_ENABLED[cap & 0xF] = GL_FALSE;
|
LIGHT_ENABLED[cap & 0xF] = GL_FALSE;
|
||||||
break;
|
break;
|
||||||
case GL_NEARZ_CLIPPING_KOS:
|
case GL_NEARZ_CLIPPING_KOS:
|
||||||
enableClipping(GL_FALSE);
|
_glEnableClipping(GL_FALSE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -586,7 +586,7 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
||||||
*params = MAX_LIGHTS;
|
*params = MAX_LIGHTS;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_BINDING_2D:
|
case GL_TEXTURE_BINDING_2D:
|
||||||
*params = getBoundTexture()->index;
|
*params = _glGetBoundTexture()->index;
|
||||||
break;
|
break;
|
||||||
case GL_DEPTH_FUNC:
|
case GL_DEPTH_FUNC:
|
||||||
*params = DEPTH_FUNC;
|
*params = DEPTH_FUNC;
|
||||||
|
|
14
GL/texture.c
14
GL/texture.c
|
@ -39,7 +39,7 @@ void _glApplyColorTable() {
|
||||||
if(_glIsSharedTexturePaletteEnabled()) {
|
if(_glIsSharedTexturePaletteEnabled()) {
|
||||||
src = SHARED_PALETTE;
|
src = SHARED_PALETTE;
|
||||||
} else {
|
} else {
|
||||||
TextureObject* active = getBoundTexture();
|
TextureObject* active = _glGetBoundTexture();
|
||||||
|
|
||||||
if(!active) {
|
if(!active) {
|
||||||
return; //? Unload the palette? Make White?
|
return; //? Unload the palette? Make White?
|
||||||
|
@ -152,15 +152,15 @@ GLubyte _glInitTextures() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureObject* getTexture0() {
|
TextureObject* _glGetTexture0() {
|
||||||
return TEXTURE_UNITS[0];
|
return TEXTURE_UNITS[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureObject* getTexture1() {
|
TextureObject* _glGetTexture1() {
|
||||||
return TEXTURE_UNITS[1];
|
return TEXTURE_UNITS[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureObject* getBoundTexture() {
|
TextureObject* _glGetBoundTexture() {
|
||||||
return TEXTURE_UNITS[ACTIVE_TEXTURE];
|
return TEXTURE_UNITS[ACTIVE_TEXTURE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ void APIENTRY glDeleteTextures(GLsizei n, GLuint *textures) {
|
||||||
TextureObject* txr = (TextureObject*) named_array_get(&TEXTURE_OBJECTS, *textures);
|
TextureObject* txr = (TextureObject*) named_array_get(&TEXTURE_OBJECTS, *textures);
|
||||||
|
|
||||||
/* Make sure we update framebuffer objects that have this texture attached */
|
/* Make sure we update framebuffer objects that have this texture attached */
|
||||||
wipeTextureOnFramebuffers(*textures);
|
_glWipeTextureOnFramebuffers(*textures);
|
||||||
|
|
||||||
if(txr == TEXTURE_UNITS[ACTIVE_TEXTURE]) {
|
if(txr == TEXTURE_UNITS[ACTIVE_TEXTURE]) {
|
||||||
TEXTURE_UNITS[ACTIVE_TEXTURE] = NULL;
|
TEXTURE_UNITS[ACTIVE_TEXTURE] = NULL;
|
||||||
|
@ -893,7 +893,7 @@ void APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||||
void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
TextureObject* active = getBoundTexture();
|
TextureObject* active = _glGetBoundTexture();
|
||||||
|
|
||||||
if(!active) {
|
if(!active) {
|
||||||
return;
|
return;
|
||||||
|
@ -1012,7 +1012,7 @@ GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsize
|
||||||
if(target == GL_SHARED_TEXTURE_PALETTE_EXT) {
|
if(target == GL_SHARED_TEXTURE_PALETTE_EXT) {
|
||||||
palette = SHARED_PALETTE;
|
palette = SHARED_PALETTE;
|
||||||
} else {
|
} else {
|
||||||
TextureObject* active = getBoundTexture();
|
TextureObject* active = _glGetBoundTexture();
|
||||||
if(!active->palette) {
|
if(!active->palette) {
|
||||||
active->palette = (TexturePalette*) malloc(sizeof(TexturePalette));
|
active->palette = (TexturePalette*) malloc(sizeof(TexturePalette));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user