From 5f7fef2cf9232338bef967ed3e64b9e1bc2ee9b0 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sun, 3 Mar 2019 19:06:01 +0000 Subject: [PATCH] Prefix non-static private functions with '_gl' --- GL/clip.c | 4 ++-- GL/draw.c | 16 ++++++++-------- GL/flush.c | 2 +- GL/framebuffer.c | 4 ++-- GL/immediate.c | 2 +- GL/private.h | 22 +++++++++++----------- GL/state.c | 16 ++++++++-------- GL/texture.c | 14 +++++++------- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/GL/clip.c b/GL/clip.c index 4216577..a3b3d76 100644 --- a/GL/clip.c +++ b/GL/clip.c @@ -14,11 +14,11 @@ static unsigned char ZCLIP_ENABLED = 1; -unsigned char isClippingEnabled() { +unsigned char _glIsClippingEnabled() { return ZCLIP_ENABLED; } -void enableClipping(unsigned char v) { +void _glEnableClipping(unsigned char v) { ZCLIP_ENABLED = v; } diff --git a/GL/draw.c b/GL/draw.c index 77637cc..018656b 100644 --- a/GL/draw.c +++ b/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) { - if(!isLightingEnabled()) { + if(!_glIsLightingEnabled()) { return; } @@ -1038,7 +1038,7 @@ static void light(ClipVertex* output, const GLsizei count) { GLfloat to_add [] = {0.0f, 0.0f, 0.0f, 0.0f}; GLubyte j; for(j = 0; j < MAX_LIGHTS; ++j) { - if(isLightEnabled(j)) { + if(_glIsLightEnabled(j)) { _glCalculateLightingContribution(j, ES->xyz, ES->n, vertex->bgra, to_add); 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) { // Compile the header - pvr_poly_cxt_t cxt = *getPVRContext(); + pvr_poly_cxt_t cxt = *_glGetPVRContext(); cxt.list_type = activePolyList->list_type; _glUpdatePVRTextureContext(&cxt, textureUnit); @@ -1104,7 +1104,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ glActiveTextureARB(GL_TEXTURE1); glGetBooleanv(GL_TEXTURE_2D, &doMultitexture); - doLighting = isLightingEnabled(); + doLighting = _glIsLightingEnabled(); glActiveTextureARB(activeTexture); @@ -1139,7 +1139,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ profiler_checkpoint("transform"); - if(isClippingEnabled()) { + if(_glIsClippingEnabled()) { 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; } - TextureObject* texture1 = getTexture1(); + TextureObject* texture1 = _glGetTexture1(); if(!texture1 || ((ENABLED_VERTEX_ATTRIBUTES & ST_ENABLED_FLAG) != ST_ENABLED_FLAG)) { /* 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) { TRACE(); - if(checkImmediateModeInactive(__func__)) { + if(_glCheckImmediateModeInactive(__func__)) { 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) { TRACE(); - if(checkImmediateModeInactive(__func__)) { + if(_glCheckImmediateModeInactive(__func__)) { return; } diff --git a/GL/flush.c b/GL/flush.c index d5f164a..0d4dd64 100644 --- a/GL/flush.c +++ b/GL/flush.c @@ -53,7 +53,7 @@ static void _glInitPVR() { PolyList* _glActivePolyList() { - if(isBlendingEnabled()) { + if(_glIsBlendingEnabled()) { return &TR_LIST; } else { return &OP_LIST; diff --git a/GL/framebuffer.c b/GL/framebuffer.c index daedabf..6b5e67e 100644 --- a/GL/framebuffer.c +++ b/GL/framebuffer.c @@ -20,7 +20,7 @@ void _glInitFramebuffers() { 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 * a GL_INVALID_OPERATION if we try to render to them */ if(ACTIVE_FRAMEBUFFER && ACTIVE_FRAMEBUFFER->texture_id == texture) { @@ -201,7 +201,7 @@ void APIENTRY glGenerateMipmapEXT(GLenum target) { return; } - TextureObject* tex = getBoundTexture(); + TextureObject* tex = _glGetBoundTexture(); if(!tex || !tex->data || !tex->mipmapCount) { _glKosThrowError(GL_INVALID_OPERATION, __func__); diff --git a/GL/immediate.c b/GL/immediate.c index 4773625..d805246 100644 --- a/GL/immediate.c +++ b/GL/immediate.c @@ -36,7 +36,7 @@ void _glInitImmediateMode() { aligned_vector_init(&NORMALS, sizeof(GLfloat)); } -GLubyte checkImmediateModeInactive(const char* func) { +GLubyte _glCheckImmediateModeInactive(const char* func) { /* Returns 1 on error */ if(IMMEDIATE_MODE_ACTIVE) { _glKosThrowError(GL_INVALID_OPERATION, func); diff --git a/GL/private.h b/GL/private.h index e3dffe6..1295878 100644 --- a/GL/private.h +++ b/GL/private.h @@ -110,10 +110,10 @@ void _glApplyRenderMatrix(); matrix_t* _glGetProjectionMatrix(); -void wipeTextureOnFramebuffers(GLuint texture); -GLubyte checkImmediateModeInactive(const char* func); +void _glWipeTextureOnFramebuffers(GLuint texture); +GLubyte _glCheckImmediateModeInactive(const char* func); -pvr_poly_cxt_t* getPVRContext(); +pvr_poly_cxt_t* _glGetPVRContext(); GLubyte _glInitTextures(); void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit); @@ -135,27 +135,27 @@ AttribPointer* _glGetUVAttribPointer(); AttribPointer* _glGetSTAttribPointer(); GLenum _glGetShadeModel(); -TextureObject* getTexture0(); -TextureObject* getTexture1(); -TextureObject* getBoundTexture(); +TextureObject* _glGetTexture0(); +TextureObject* _glGetTexture1(); +TextureObject* _glGetBoundTexture(); GLubyte _glGetActiveTexture(); GLuint _glGetActiveClientTexture(); GLboolean _glIsSharedTexturePaletteEnabled(); void _glApplyColorTable(); -GLboolean isBlendingEnabled(); +GLboolean _glIsBlendingEnabled(); GLboolean _glIsMipmapComplete(const TextureObject* obj); GLubyte* _glGetMipmapLocation(TextureObject* obj, GLuint level); GLuint _glGetMipmapLevelCount(TextureObject* obj); -GLboolean isLightingEnabled(); -GLboolean isLightEnabled(GLubyte light); +GLboolean _glIsLightingEnabled(); +GLboolean _glIsLightEnabled(GLubyte light); GLboolean _glIsColorMaterialEnabled(); void _glCalculateLightingContribution(const GLint light, const GLfloat* pos, const GLfloat* normal, uint8_t* bgra, GLfloat* colour); -unsigned char isClippingEnabled(); -void enableClipping(unsigned char v); +unsigned char _glIsClippingEnabled(); +void _glEnableClipping(unsigned char v); void _glKosThrowError(GLenum error, const char *function); void _glKosPrintError(); diff --git a/GL/state.c b/GL/state.c index 793b9c5..32d4b22 100644 --- a/GL/state.c +++ b/GL/state.c @@ -14,7 +14,7 @@ static pvr_poly_cxt_t GL_CONTEXT; -pvr_poly_cxt_t* getPVRContext() { +pvr_poly_cxt_t* _glGetPVRContext() { return &GL_CONTEXT; } @@ -80,7 +80,7 @@ static GLenum BLEND_SFACTOR = GL_ONE; static GLenum BLEND_DFACTOR = GL_ZERO; static GLboolean BLEND_ENABLED = GL_FALSE; -GLboolean isBlendingEnabled() { +GLboolean _glIsBlendingEnabled() { return BLEND_ENABLED; } @@ -146,7 +146,7 @@ GLboolean _glCheckValidEnum(GLint param, GLenum* values, const char* func) { static GLboolean TEXTURES_ENABLED [] = {GL_FALSE, GL_FALSE}; 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) { 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 LIGHT_ENABLED[MAX_LIGHTS]; -GLboolean isLightingEnabled() { +GLboolean _glIsLightingEnabled() { return LIGHTING_ENABLED; } -GLboolean isLightEnabled(unsigned char light) { +GLboolean _glIsLightEnabled(unsigned char light) { return LIGHT_ENABLED[light & 0xF]; } @@ -316,7 +316,7 @@ GLAPI void APIENTRY glEnable(GLenum cap) { LIGHT_ENABLED[cap & 0xF] = GL_TRUE; break; case GL_NEARZ_CLIPPING_KOS: - enableClipping(GL_TRUE); + _glEnableClipping(GL_TRUE); break; default: break; @@ -370,7 +370,7 @@ GLAPI void APIENTRY glDisable(GLenum cap) { LIGHT_ENABLED[cap & 0xF] = GL_FALSE; break; case GL_NEARZ_CLIPPING_KOS: - enableClipping(GL_FALSE); + _glEnableClipping(GL_FALSE); break; default: break; @@ -586,7 +586,7 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) { *params = MAX_LIGHTS; break; case GL_TEXTURE_BINDING_2D: - *params = getBoundTexture()->index; + *params = _glGetBoundTexture()->index; break; case GL_DEPTH_FUNC: *params = DEPTH_FUNC; diff --git a/GL/texture.c b/GL/texture.c index 002f22f..b2e7597 100644 --- a/GL/texture.c +++ b/GL/texture.c @@ -39,7 +39,7 @@ void _glApplyColorTable() { if(_glIsSharedTexturePaletteEnabled()) { src = SHARED_PALETTE; } else { - TextureObject* active = getBoundTexture(); + TextureObject* active = _glGetBoundTexture(); if(!active) { return; //? Unload the palette? Make White? @@ -152,15 +152,15 @@ GLubyte _glInitTextures() { return 1; } -TextureObject* getTexture0() { +TextureObject* _glGetTexture0() { return TEXTURE_UNITS[0]; } -TextureObject* getTexture1() { +TextureObject* _glGetTexture1() { return TEXTURE_UNITS[1]; } -TextureObject* getBoundTexture() { +TextureObject* _glGetBoundTexture() { 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); /* Make sure we update framebuffer objects that have this texture attached */ - wipeTextureOnFramebuffers(*textures); + _glWipeTextureOnFramebuffers(*textures); if(txr == TEXTURE_UNITS[ACTIVE_TEXTURE]) { 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) { TRACE(); - TextureObject* active = getBoundTexture(); + TextureObject* active = _glGetBoundTexture(); if(!active) { return; @@ -1012,7 +1012,7 @@ GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsize if(target == GL_SHARED_TEXTURE_PALETTE_EXT) { palette = SHARED_PALETTE; } else { - TextureObject* active = getBoundTexture(); + TextureObject* active = _glGetBoundTexture(); if(!active->palette) { active->palette = (TexturePalette*) malloc(sizeof(TexturePalette)); }