Prefix some non-static private functions with '_gl'

This commit is contained in:
Luke Benstead 2019-03-03 19:02:25 +00:00
parent 2382126603
commit 926214bd82
9 changed files with 40 additions and 40 deletions

View File

@ -19,7 +19,7 @@ static AttribPointer DIFFUSE_POINTER;
static GLuint ENABLED_VERTEX_ATTRIBUTES = 0; static GLuint ENABLED_VERTEX_ATTRIBUTES = 0;
static GLubyte ACTIVE_CLIENT_TEXTURE = 0; static GLubyte ACTIVE_CLIENT_TEXTURE = 0;
void initAttributePointers() { void _glInitAttributePointers() {
TRACE(); TRACE();
VERTEX_POINTER.ptr = NULL; VERTEX_POINTER.ptr = NULL;
@ -263,12 +263,12 @@ static inline IndexParseFunc _calcParseIndexFunc(GLenum type) {
static inline void transformToEyeSpace(GLfloat* point) { static inline void transformToEyeSpace(GLfloat* point) {
_matrixLoadModelView(); _glMatrixLoadModelView();
mat_trans_single3_nodiv(point[0], point[1], point[2]); mat_trans_single3_nodiv(point[0], point[1], point[2]);
} }
static inline void transformNormalToEyeSpace(GLfloat* normal) { static inline void transformNormalToEyeSpace(GLfloat* normal) {
_matrixLoadNormal(); _glMatrixLoadNormal();
mat_trans_normal3(normal[0], normal[1], normal[2]); mat_trans_normal3(normal[0], normal[1], normal[2]);
} }
@ -933,7 +933,7 @@ static void transform(ClipVertex* output, const GLsizei count) {
ClipVertex* vertex = output; ClipVertex* vertex = output;
_applyRenderMatrix(); /* Apply the Render Matrix Stack */ _glApplyRenderMatrix(); /* Apply the Render Matrix Stack */
GLsizei i = count; GLsizei i = count;
while(i--) { while(i--) {
@ -1021,10 +1021,10 @@ static void light(ClipVertex* output, const GLsizei count) {
ClipVertex* vertex = output; ClipVertex* vertex = output;
EyeSpaceData* eye_space = (EyeSpaceData*) eye_space_data->data; EyeSpaceData* eye_space = (EyeSpaceData*) eye_space_data->data;
_matrixLoadModelView(); _glMatrixLoadModelView();
mat_transform3(vertex->xyz, eye_space->xyz, count, sizeof(ClipVertex), sizeof(EyeSpaceData)); mat_transform3(vertex->xyz, eye_space->xyz, count, sizeof(ClipVertex), sizeof(EyeSpaceData));
_matrixLoadNormal(); _glMatrixLoadNormal();
mat_transform_normal3(vertex->nxyz, eye_space->n, count, sizeof(ClipVertex), sizeof(EyeSpaceData)); mat_transform_normal3(vertex->nxyz, eye_space->n, count, sizeof(ClipVertex), sizeof(EyeSpaceData));
GLsizei i; GLsizei i;
@ -1111,7 +1111,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
profiler_push(__func__); profiler_push(__func__);
PolyList* activeList = activePolyList(); PolyList* activeList = _glActivePolyList();
/* Make room in the list buffer */ /* Make room in the list buffer */
GLsizei spaceNeeded = (mode == GL_POLYGON || mode == GL_TRIANGLE_FAN) ? ((count - 2) * 3) : count; GLsizei spaceNeeded = (mode == GL_POLYGON || mode == GL_TRIANGLE_FAN) ? ((count - 2) * 3) : count;
@ -1183,7 +1183,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
profiler_checkpoint("divide"); profiler_checkpoint("divide");
push(header, start, spaceNeeded, activePolyList(), 0); push(header, start, spaceNeeded, _glActivePolyList(), 0);
profiler_checkpoint("push"); profiler_checkpoint("push");
/* /*
@ -1212,7 +1212,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
(hence the - 1) (hence the - 1)
*/ */
ClipVertex* vertex = aligned_vector_push_back( ClipVertex* vertex = aligned_vector_push_back(
&transparentPolyList()->vector, start - 1, spaceNeeded + 1 &_glTransparentPolyList()->vector, start - 1, spaceNeeded + 1
); );
PVRHeader* mtHeader = (PVRHeader*) vertex++; PVRHeader* mtHeader = (PVRHeader*) vertex++;
@ -1240,7 +1240,7 @@ static void submitVertices(GLenum mode, GLsizei first, GLsizei count, GLenum typ
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
/* Send the buffer again to the transparent list */ /* Send the buffer again to the transparent list */
push(mtHeader, mtStart, spaceNeeded, transparentPolyList(), 1); push(mtHeader, mtStart, spaceNeeded, _glTransparentPolyList(), 1);
/* Reset state */ /* Reset state */
glDepthFunc(depthFunc); glDepthFunc(depthFunc);

View File

@ -38,7 +38,7 @@ static void pvr_list_submit(void *src, int n) {
d[0] = d[8] = 0; d[0] = d[8] = 0;
} }
static void _initPVR() { static void _glInitPVR() {
pvr_init_params_t params = { pvr_init_params_t params = {
/* Enable opaque and translucent polygons with size 32 and 32 */ /* Enable opaque and translucent polygons with size 32 and 32 */
{ PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32 }, { PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32, PVR_BINSIZE_0, PVR_BINSIZE_32 },
@ -52,7 +52,7 @@ static void _initPVR() {
} }
PolyList* activePolyList() { PolyList* _glActivePolyList() {
if(isBlendingEnabled()) { if(isBlendingEnabled()) {
return &TR_LIST; return &TR_LIST;
} else { } else {
@ -60,23 +60,23 @@ PolyList* activePolyList() {
} }
} }
PolyList *transparentPolyList() { PolyList *_glTransparentPolyList() {
return &TR_LIST; return &TR_LIST;
} }
void APIENTRY glKosInit() { void APIENTRY glKosInit() {
TRACE(); TRACE();
_initPVR(); _glInitPVR();
initMatrices(); _glInitMatrices();
initAttributePointers(); _glInitAttributePointers();
_glInitContext(); _glInitContext();
_glInitLights(); _glInitLights();
initImmediateMode(); _glInitImmediateMode();
initFramebuffers(); _glInitFramebuffers();
_glKosInitTextures(); _glInitTextures();
OP_LIST.list_type = PVR_LIST_OP_POLY; OP_LIST.list_type = PVR_LIST_OP_POLY;
PT_LIST.list_type = PVR_LIST_PT_POLY; PT_LIST.list_type = PVR_LIST_PT_POLY;

View File

@ -16,7 +16,7 @@ static FrameBuffer* ACTIVE_FRAMEBUFFER = NULL;
static NamedArray FRAMEBUFFERS; static NamedArray FRAMEBUFFERS;
void initFramebuffers() { void _glInitFramebuffers() {
named_array_init(&FRAMEBUFFERS, sizeof(FrameBuffer), 32); named_array_init(&FRAMEBUFFERS, sizeof(FrameBuffer), 32);
} }

View File

@ -28,7 +28,7 @@ static GLfloat UV_COORD[2] = {0.0f, 0.0f};
static GLfloat ST_COORD[2] = {0.0f, 0.0f}; static GLfloat ST_COORD[2] = {0.0f, 0.0f};
void initImmediateMode() { void _glInitImmediateMode() {
aligned_vector_init(&VERTICES, sizeof(GLfloat)); aligned_vector_init(&VERTICES, sizeof(GLfloat));
aligned_vector_init(&COLOURS, sizeof(GLfloat)); aligned_vector_init(&COLOURS, sizeof(GLfloat));
aligned_vector_init(&UV_COORDS, sizeof(GLfloat)); aligned_vector_init(&UV_COORDS, sizeof(GLfloat));

View File

@ -109,7 +109,7 @@ void APIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat *params) {
memcpy(LIGHTS[idx].specular, params, sizeof(GLfloat) * 4); memcpy(LIGHTS[idx].specular, params, sizeof(GLfloat) * 4);
break; break;
case GL_POSITION: { case GL_POSITION: {
_matrixLoadModelView(); _glMatrixLoadModelView();
memcpy(LIGHTS[idx].position, params, sizeof(GLfloat) * 4); memcpy(LIGHTS[idx].position, params, sizeof(GLfloat) * 4);
LIGHTS[idx].is_directional = (params[3] == 0.0f) ? GL_TRUE : GL_FALSE; LIGHTS[idx].is_directional = (params[3] == 0.0f) ? GL_TRUE : GL_FALSE;

View File

@ -37,7 +37,7 @@ matrix_t* _glGetProjectionMatrix() {
return (matrix_t*) stack_top(&MATRIX_STACKS[1]); return (matrix_t*) stack_top(&MATRIX_STACKS[1]);
} }
void initMatrices() { void _glInitMatrices() {
init_stack(&MATRIX_STACKS[0], sizeof(matrix_t), 32); init_stack(&MATRIX_STACKS[0], sizeof(matrix_t), 32);
init_stack(&MATRIX_STACKS[1], sizeof(matrix_t), 32); init_stack(&MATRIX_STACKS[1], sizeof(matrix_t), 32);
init_stack(&MATRIX_STACKS[2], sizeof(matrix_t), 32); init_stack(&MATRIX_STACKS[2], sizeof(matrix_t), 32);
@ -385,20 +385,20 @@ void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx,
glhLookAtf2(eye, point, up); glhLookAtf2(eye, point, up);
} }
void _applyRenderMatrix() { void _glApplyRenderMatrix() {
mat_load(&SCREENVIEW_MATRIX); mat_load(&SCREENVIEW_MATRIX);
mat_apply(stack_top(MATRIX_STACKS + (GL_PROJECTION & 0xF))); mat_apply(stack_top(MATRIX_STACKS + (GL_PROJECTION & 0xF)));
mat_apply(stack_top(MATRIX_STACKS + (GL_MODELVIEW & 0xF))); mat_apply(stack_top(MATRIX_STACKS + (GL_MODELVIEW & 0xF)));
} }
void _matrixLoadTexture() { void _glMatrixLoadTexture() {
mat_load(stack_top(MATRIX_STACKS + (GL_TEXTURE & 0xF))); mat_load(stack_top(MATRIX_STACKS + (GL_TEXTURE & 0xF)));
} }
void _matrixLoadModelView() { void _glMatrixLoadModelView() {
mat_load(stack_top(MATRIX_STACKS + (GL_MODELVIEW & 0xF))); mat_load(stack_top(MATRIX_STACKS + (GL_MODELVIEW & 0xF)));
} }
void _matrixLoadNormal() { void _glMatrixLoadNormal() {
mat_load(&NORMAL_MATRIX); mat_load(&NORMAL_MATRIX);
} }

View File

@ -93,20 +93,20 @@ typedef struct {
} LightSource; } LightSource;
PolyList *activePolyList(); PolyList *_glActivePolyList();
PolyList *transparentPolyList(); PolyList *_glTransparentPolyList();
void initAttributePointers(); void _glInitAttributePointers();
void _glInitContext(); void _glInitContext();
void _glInitLights(); void _glInitLights();
void initImmediateMode(); void _glInitImmediateMode();
void initMatrices(); void _glInitMatrices();
void initFramebuffers(); void _glInitFramebuffers();
void _matrixLoadNormal(); void _glMatrixLoadNormal();
void _matrixLoadModelView(); void _glMatrixLoadModelView();
void _matrixLoadTexture(); void _glMatrixLoadTexture();
void _applyRenderMatrix(); void _glApplyRenderMatrix();
matrix_t* _glGetProjectionMatrix(); matrix_t* _glGetProjectionMatrix();
@ -114,7 +114,7 @@ void wipeTextureOnFramebuffers(GLuint texture);
GLubyte checkImmediateModeInactive(const char* func); GLubyte checkImmediateModeInactive(const char* func);
pvr_poly_cxt_t* getPVRContext(); pvr_poly_cxt_t* getPVRContext();
GLubyte _glKosInitTextures(); GLubyte _glInitTextures();
void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit); void _glUpdatePVRTextureContext(pvr_poly_cxt_t* context, GLshort textureUnit);

View File

@ -490,7 +490,7 @@ void glPixelStorei(GLenum pname, GLint param) {
*/ */
void APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) { void APIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) {
/*!!! FIXME: Shouldn't this be added to *all* lists? */ /*!!! FIXME: Shouldn't this be added to *all* lists? */
PVRTileClipCommand *c = aligned_vector_extend(&activePolyList()->vector, 1); PVRTileClipCommand *c = aligned_vector_extend(&_glActivePolyList()->vector, 1);
GLint miny, maxx, maxy; GLint miny, maxx, maxy;
GLsizei gl_scissor_width = CLAMP(width, 0, vid_mode->width); GLsizei gl_scissor_width = CLAMP(width, 0, vid_mode->width);

View File

@ -142,7 +142,7 @@ static GLuint _glGetMipmapDataSize(TextureObject* obj) {
return size; return size;
} }
GLubyte _glKosInitTextures() { GLubyte _glInitTextures() {
named_array_init(&TEXTURE_OBJECTS, sizeof(TextureObject), MAX_TEXTURE_COUNT); named_array_init(&TEXTURE_OBJECTS, sizeof(TextureObject), MAX_TEXTURE_COUNT);
// Reserve zero so that it is never given to anyone as an ID! // Reserve zero so that it is never given to anyone as an ID!