diff --git a/src/client/refresh/gl3/gl3_lightmap.c b/src/client/refresh/gl3/gl3_lightmap.c index 3c4cb408..a4cb32be 100644 --- a/src/client/refresh/gl3/gl3_lightmap.c +++ b/src/client/refresh/gl3/gl3_lightmap.c @@ -136,7 +136,7 @@ GL3_LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa) /* draw texture */ poly = Hunk_Alloc(sizeof(glpoly_t) + - (lnumverts - 4) * sizeof(gl3_3D_vtx_t)); + (lnumverts - 4) * sizeof(mvtx_t)); poly->next = fa->polys; poly->flags = fa->flags; fa->polys = poly; @@ -153,7 +153,7 @@ GL3_LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa) for (i = 0; i < lnumverts; i++) { - gl3_3D_vtx_t* vert = &poly->vertices[i]; + mvtx_t* vert = &poly->vertices[i]; lindex = currentmodel->surfedges[fa->firstedge + i]; diff --git a/src/client/refresh/gl3/gl3_main.c b/src/client/refresh/gl3/gl3_main.c index 2e194b5c..7028430a 100644 --- a/src/client/refresh/gl3/gl3_main.c +++ b/src/client/refresh/gl3/gl3_main.c @@ -702,14 +702,14 @@ GL3_Shutdown(void) } // assumes gl3state.v[ab]o3D are bound -// buffers and draws gl3_3D_vtx_t vertices +// buffers and draws mvtx_t vertices // drawMode is something like GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN or whatever void -GL3_BufferAndDraw3D(const gl3_3D_vtx_t* verts, int numVerts, GLenum drawMode) +GL3_BufferAndDraw3D(const mvtx_t* verts, int numVerts, GLenum drawMode) { if(!gl3config.useBigVBO) { - glBufferData( GL_ARRAY_BUFFER, sizeof(gl3_3D_vtx_t)*numVerts, verts, GL_STREAM_DRAW ); + glBufferData( GL_ARRAY_BUFFER, sizeof(mvtx_t)*numVerts, verts, GL_STREAM_DRAW ); glDrawArrays( drawMode, 0, numVerts ); } else // gl3config.useBigVBO == true @@ -739,11 +739,11 @@ GL3_BufferAndDraw3D(const gl3_3D_vtx_t* verts, int numVerts, GLenum drawMode) #if 0 // I /think/ doing it with glBufferSubData() didn't really help const int bufSize = gl3state.vbo3Dsize; - int neededSize = numVerts*sizeof(gl3_3D_vtx_t); + int neededSize = numVerts*sizeof(mvtx_t); int curOffset = gl3state.vbo3DcurOffset; if(curOffset + neededSize > gl3state.vbo3Dsize) curOffset = 0; - int curIdx = curOffset / sizeof(gl3_3D_vtx_t); + int curIdx = curOffset / sizeof(mvtx_t); gl3state.vbo3DcurOffset = curOffset + neededSize; @@ -751,7 +751,7 @@ GL3_BufferAndDraw3D(const gl3_3D_vtx_t* verts, int numVerts, GLenum drawMode) glDrawArrays( drawMode, curIdx, numVerts ); #else int curOffset = gl3state.vbo3DcurOffset; - int neededSize = numVerts*sizeof(gl3_3D_vtx_t); + int neededSize = numVerts*sizeof(mvtx_t); if(curOffset+neededSize > gl3state.vbo3Dsize) { // buffer is full, need to start again from the beginning @@ -768,7 +768,7 @@ GL3_BufferAndDraw3D(const gl3_3D_vtx_t* verts, int numVerts, GLenum drawMode) memcpy(data, verts, neededSize); glUnmapBuffer(GL_ARRAY_BUFFER); - glDrawArrays(drawMode, curOffset/sizeof(gl3_3D_vtx_t), numVerts); + glDrawArrays(drawMode, curOffset/sizeof(mvtx_t), numVerts); gl3state.vbo3DcurOffset = curOffset + neededSize; // TODO: padding or sth needed? #endif @@ -788,7 +788,7 @@ GL3_DrawBeam(entity_t *e) vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS]; vec3_t oldorigin, origin; - gl3_3D_vtx_t verts[NUM_BEAM_SEGS*4]; + mvtx_t verts[NUM_BEAM_SEGS*4]; unsigned int pointb; oldorigin[0] = e->oldorigin[0]; @@ -860,7 +860,7 @@ static void GL3_DrawSpriteModel(entity_t *e, gl3model_t *currentmodel) { float alpha = 1.0F; - gl3_3D_vtx_t verts[4]; + mvtx_t verts[4]; dsprframe_t *frame; float *up, *right; dsprite_t *psprite; @@ -967,7 +967,7 @@ GL3_DrawNullModel(entity_t *currententity) GL3_BindVAO(gl3state.vao3D); GL3_BindVBO(gl3state.vbo3D); - gl3_3D_vtx_t vtxA[6] = { + mvtx_t vtxA[6] = { {{0, 0, -16}, {0,0}, {0,0}}, {{16 * cos( 0 * M_PI / 2 ), 16 * sin( 0 * M_PI / 2 ), 0}, {0,0}, {0,0}}, {{16 * cos( 1 * M_PI / 2 ), 16 * sin( 1 * M_PI / 2 ), 0}, {0,0}, {0,0}}, @@ -978,7 +978,7 @@ GL3_DrawNullModel(entity_t *currententity) GL3_BufferAndDraw3D(vtxA, 6, GL_TRIANGLE_FAN); - gl3_3D_vtx_t vtxB[6] = { + mvtx_t vtxB[6] = { {{0, 0, 16}, {0,0}, {0,0}}, vtxA[5], vtxA[4], vtxA[3], vtxA[2], vtxA[1] }; diff --git a/src/client/refresh/gl3/gl3_model.c b/src/client/refresh/gl3/gl3_model.c index 61c0750e..d8b62bc7 100644 --- a/src/client/refresh/gl3/gl3_model.c +++ b/src/client/refresh/gl3/gl3_model.c @@ -294,7 +294,7 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl // GL3_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // for each (pot. recursive) call to R_SubdividePolygon(): - // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(gl3_3D_vtx_t) + // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t) // this is tricky, how much is allocated depends on the size of the surface // which we don't know (we'd need the vertices etc to know, but we can't load @@ -306,8 +306,8 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl else { // GL3_LM_BuildPolygonFromSurface(out); - // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(gl3_3D_vtx_t)); - int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(gl3_3D_vtx_t); + // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t)); + int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t); polySize = (polySize + 31) & ~31; ret += polySize; } @@ -370,7 +370,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t // GL3_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // for each (pot. recursive) call to R_SubdividePolygon(): - // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(gl3_3D_vtx_t) + // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t) // this is tricky, how much is allocated depends on the size of the surface // which we don't know (we'd need the vertices etc to know, but we can't load @@ -382,8 +382,8 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t else { // GL3_LM_BuildPolygonFromSurface(out); - // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(gl3_3D_vtx_t)); - int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(gl3_3D_vtx_t); + // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t)); + int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t); polySize = (polySize + 31) & ~31; ret += polySize; } diff --git a/src/client/refresh/gl3/gl3_surf.c b/src/client/refresh/gl3/gl3_surf.c index 2b441f98..039c1ae5 100644 --- a/src/client/refresh/gl3/gl3_surf.c +++ b/src/client/refresh/gl3/gl3_surf.c @@ -61,19 +61,19 @@ void GL3_SurfInit(void) } glEnableVertexAttribArray(GL3_ATTRIB_POSITION); - qglVertexAttribPointer(GL3_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(gl3_3D_vtx_t), 0); + qglVertexAttribPointer(GL3_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), 0); glEnableVertexAttribArray(GL3_ATTRIB_TEXCOORD); - qglVertexAttribPointer(GL3_ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(gl3_3D_vtx_t), offsetof(gl3_3D_vtx_t, texCoord)); + qglVertexAttribPointer(GL3_ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, texCoord)); glEnableVertexAttribArray(GL3_ATTRIB_LMTEXCOORD); - qglVertexAttribPointer(GL3_ATTRIB_LMTEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(gl3_3D_vtx_t), offsetof(gl3_3D_vtx_t, lmTexCoord)); + qglVertexAttribPointer(GL3_ATTRIB_LMTEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, lmTexCoord)); glEnableVertexAttribArray(GL3_ATTRIB_NORMAL); - qglVertexAttribPointer(GL3_ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(gl3_3D_vtx_t), offsetof(gl3_3D_vtx_t, normal)); + qglVertexAttribPointer(GL3_ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, normal)); glEnableVertexAttribArray(GL3_ATTRIB_LIGHTFLAGS); - qglVertexAttribIPointer(GL3_ATTRIB_LIGHTFLAGS, 1, GL_UNSIGNED_INT, sizeof(gl3_3D_vtx_t), offsetof(gl3_3D_vtx_t, lightFlags)); + qglVertexAttribIPointer(GL3_ATTRIB_LIGHTFLAGS, 1, GL_UNSIGNED_INT, sizeof(mvtx_t), offsetof(mvtx_t, lightFlags)); @@ -141,7 +141,7 @@ SetLightFlags(msurface_t *surf) lightFlags = surf->dlightbits; } - gl3_3D_vtx_t* verts = surf->polys->vertices; + mvtx_t* verts = surf->polys->vertices; int numVerts = surf->polys->numverts; for(int i=0; ipolys->vertices; + mvtx_t* verts = surf->polys->vertices; int numVerts = surf->polys->numverts; for(int i=0; inext = warpface->polys; warpface->polys = poly; poly->numverts = numverts + 2; @@ -592,7 +592,7 @@ GL3_ClearSkyBox(void) } static void -MakeSkyVec(float s, float t, int axis, gl3_3D_vtx_t* vert) +MakeSkyVec(float s, float t, int axis, mvtx_t* vert) { vec3_t v, b; int j, k; @@ -693,7 +693,7 @@ GL3_DrawSkyBox(void) // TODO: this could all be done in one drawcall.. but.. whatever, it's <= 6 drawcalls/frame - gl3_3D_vtx_t skyVertices[4]; + mvtx_t skyVertices[4]; for (i = 0; i < 6; i++) { diff --git a/src/client/refresh/gl3/header/local.h b/src/client/refresh/gl3/header/local.h index c3010de0..545f757a 100644 --- a/src/client/refresh/gl3/header/local.h +++ b/src/client/refresh/gl3/header/local.h @@ -383,7 +383,7 @@ GL3_BindEBO(GLuint ebo) } } -extern void GL3_BufferAndDraw3D(const gl3_3D_vtx_t* verts, int numVerts, GLenum drawMode); +extern void GL3_BufferAndDraw3D(const mvtx_t* verts, int numVerts, GLenum drawMode); extern void GL3_RotateForEntity(entity_t *e); diff --git a/src/client/refresh/gl3/header/model.h b/src/client/refresh/gl3/header/model.h index 81d8b297..52017398 100644 --- a/src/client/refresh/gl3/header/model.h +++ b/src/client/refresh/gl3/header/model.h @@ -27,16 +27,6 @@ #ifndef SRC_CLIENT_REFRESH_GL3_HEADER_MODEL_H_ #define SRC_CLIENT_REFRESH_GL3_HEADER_MODEL_H_ -// used for vertex array elements when drawing brushes, sprites, sky and more -// (ok, it has the layout used for rendering brushes, but is not used there) -typedef struct gl3_3D_vtx_s { - vec3_t pos; - float texCoord[2]; - float lmTexCoord[2]; // lightmap texture coordinate (sometimes unused) - vec3_t normal; - GLuint lightFlags; // bit i set means: dynlight i affects surface -} gl3_3D_vtx_t; - // used for vertex array elements when drawing models typedef struct gl3_alias_vtx_s { GLfloat pos[3]; @@ -52,7 +42,7 @@ typedef struct glpoly_s struct glpoly_s *chain; int numverts; int flags; /* for SURF_UNDERWATER (not needed anymore?) */ - gl3_3D_vtx_t vertices[4]; /* variable sized */ + mvtx_t vertices[4]; /* variable sized */ } glpoly_t; typedef struct msurface_s diff --git a/src/client/refresh/gl4/gl4_lightmap.c b/src/client/refresh/gl4/gl4_lightmap.c index 5e26ccd5..657421cf 100644 --- a/src/client/refresh/gl4/gl4_lightmap.c +++ b/src/client/refresh/gl4/gl4_lightmap.c @@ -136,7 +136,7 @@ GL4_LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa) /* draw texture */ poly = Hunk_Alloc(sizeof(glpoly_t) + - (lnumverts - 4) * sizeof(gl4_3D_vtx_t)); + (lnumverts - 4) * sizeof(mvtx_t)); poly->next = fa->polys; poly->flags = fa->flags; fa->polys = poly; @@ -153,7 +153,7 @@ GL4_LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa) for (i = 0; i < lnumverts; i++) { - gl4_3D_vtx_t* vert = &poly->vertices[i]; + mvtx_t* vert = &poly->vertices[i]; lindex = currentmodel->surfedges[fa->firstedge + i]; diff --git a/src/client/refresh/gl4/gl4_main.c b/src/client/refresh/gl4/gl4_main.c index 2a2d76f5..521b15b9 100644 --- a/src/client/refresh/gl4/gl4_main.c +++ b/src/client/refresh/gl4/gl4_main.c @@ -689,14 +689,14 @@ GL4_Shutdown(void) } // assumes gl4state.v[ab]o3D are bound -// buffers and draws gl4_3D_vtx_t vertices +// buffers and draws mvtx_t vertices // drawMode is something like GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN or whatever void -GL4_BufferAndDraw3D(const gl4_3D_vtx_t* verts, int numVerts, GLenum drawMode) +GL4_BufferAndDraw3D(const mvtx_t* verts, int numVerts, GLenum drawMode) { if(!gl4config.useBigVBO) { - glBufferData( GL_ARRAY_BUFFER, sizeof(gl4_3D_vtx_t)*numVerts, verts, GL_STREAM_DRAW ); + glBufferData( GL_ARRAY_BUFFER, sizeof(mvtx_t)*numVerts, verts, GL_STREAM_DRAW ); glDrawArrays( drawMode, 0, numVerts ); } else // gl4config.useBigVBO == true @@ -726,11 +726,11 @@ GL4_BufferAndDraw3D(const gl4_3D_vtx_t* verts, int numVerts, GLenum drawMode) #if 0 // I /think/ doing it with glBufferSubData() didn't really help const int bufSize = gl4state.vbo3Dsize; - int neededSize = numVerts*sizeof(gl4_3D_vtx_t); + int neededSize = numVerts*sizeof(mvtx_t); int curOffset = gl4state.vbo3DcurOffset; if(curOffset + neededSize > gl4state.vbo3Dsize) curOffset = 0; - int curIdx = curOffset / sizeof(gl4_3D_vtx_t); + int curIdx = curOffset / sizeof(mvtx_t); gl4state.vbo3DcurOffset = curOffset + neededSize; @@ -738,7 +738,7 @@ GL4_BufferAndDraw3D(const gl4_3D_vtx_t* verts, int numVerts, GLenum drawMode) glDrawArrays( drawMode, curIdx, numVerts ); #else int curOffset = gl4state.vbo3DcurOffset; - int neededSize = numVerts*sizeof(gl4_3D_vtx_t); + int neededSize = numVerts*sizeof(mvtx_t); if(curOffset+neededSize > gl4state.vbo3Dsize) { // buffer is full, need to start again from the beginning @@ -755,7 +755,7 @@ GL4_BufferAndDraw3D(const gl4_3D_vtx_t* verts, int numVerts, GLenum drawMode) memcpy(data, verts, neededSize); glUnmapBuffer(GL_ARRAY_BUFFER); - glDrawArrays(drawMode, curOffset/sizeof(gl4_3D_vtx_t), numVerts); + glDrawArrays(drawMode, curOffset/sizeof(mvtx_t), numVerts); gl4state.vbo3DcurOffset = curOffset + neededSize; // TODO: padding or sth needed? #endif @@ -775,7 +775,7 @@ GL4_DrawBeam(entity_t *e) vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS]; vec3_t oldorigin, origin; - gl4_3D_vtx_t verts[NUM_BEAM_SEGS*4]; + mvtx_t verts[NUM_BEAM_SEGS*4]; unsigned int pointb; oldorigin[0] = e->oldorigin[0]; @@ -847,7 +847,7 @@ static void GL4_DrawSpriteModel(entity_t *e, gl4model_t *currentmodel) { float alpha = 1.0F; - gl4_3D_vtx_t verts[4]; + mvtx_t verts[4]; dsprframe_t *frame; float *up, *right; dsprite_t *psprite; @@ -954,7 +954,7 @@ GL4_DrawNullModel(entity_t *currententity) GL4_BindVAO(gl4state.vao3D); GL4_BindVBO(gl4state.vbo3D); - gl4_3D_vtx_t vtxA[6] = { + mvtx_t vtxA[6] = { {{0, 0, -16}, {0,0}, {0,0}}, {{16 * cos( 0 * M_PI / 2 ), 16 * sin( 0 * M_PI / 2 ), 0}, {0,0}, {0,0}}, {{16 * cos( 1 * M_PI / 2 ), 16 * sin( 1 * M_PI / 2 ), 0}, {0,0}, {0,0}}, @@ -965,7 +965,7 @@ GL4_DrawNullModel(entity_t *currententity) GL4_BufferAndDraw3D(vtxA, 6, GL_TRIANGLE_FAN); - gl4_3D_vtx_t vtxB[6] = { + mvtx_t vtxB[6] = { {{0, 0, 16}, {0,0}, {0,0}}, vtxA[5], vtxA[4], vtxA[3], vtxA[2], vtxA[1] }; diff --git a/src/client/refresh/gl4/gl4_model.c b/src/client/refresh/gl4/gl4_model.c index b2a36115..a15d586f 100644 --- a/src/client/refresh/gl4/gl4_model.c +++ b/src/client/refresh/gl4/gl4_model.c @@ -289,7 +289,7 @@ static int calcTexinfoAndFacesSize(byte *mod_base, const lump_t *fl, const lump_ // GL4_SubdivideSurface(out, loadmodel); /* cut up polygon for warps */ // for each (pot. recursive) call to R_SubdividePolygon(): - // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(gl4_3D_vtx_t) + // sizeof(glpoly_t) + ((numverts - 4) + 2) * sizeof(mvtx_t) // this is tricky, how much is allocated depends on the size of the surface // which we don't know (we'd need the vertices etc to know, but we can't load @@ -301,8 +301,8 @@ static int calcTexinfoAndFacesSize(byte *mod_base, const lump_t *fl, const lump_ else { // GL4_LM_BuildPolygonFromSurface(out); - // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(gl4_3D_vtx_t)); - int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(gl4_3D_vtx_t); + // => poly = Hunk_Alloc(sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t)); + int polySize = sizeof(glpoly_t) + (numverts - 4) * sizeof(mvtx_t); polySize = (polySize + 31) & ~31; ret += polySize; } diff --git a/src/client/refresh/gl4/gl4_surf.c b/src/client/refresh/gl4/gl4_surf.c index 6f72c5e8..5b4f3052 100644 --- a/src/client/refresh/gl4/gl4_surf.c +++ b/src/client/refresh/gl4/gl4_surf.c @@ -61,19 +61,19 @@ void GL4_SurfInit(void) } glEnableVertexAttribArray(GL4_ATTRIB_POSITION); - qglVertexAttribPointer(GL4_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(gl4_3D_vtx_t), 0); + qglVertexAttribPointer(GL4_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), 0); glEnableVertexAttribArray(GL4_ATTRIB_TEXCOORD); - qglVertexAttribPointer(GL4_ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(gl4_3D_vtx_t), offsetof(gl4_3D_vtx_t, texCoord)); + qglVertexAttribPointer(GL4_ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, texCoord)); glEnableVertexAttribArray(GL4_ATTRIB_LMTEXCOORD); - qglVertexAttribPointer(GL4_ATTRIB_LMTEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(gl4_3D_vtx_t), offsetof(gl4_3D_vtx_t, lmTexCoord)); + qglVertexAttribPointer(GL4_ATTRIB_LMTEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, lmTexCoord)); glEnableVertexAttribArray(GL4_ATTRIB_NORMAL); - qglVertexAttribPointer(GL4_ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(gl4_3D_vtx_t), offsetof(gl4_3D_vtx_t, normal)); + qglVertexAttribPointer(GL4_ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, sizeof(mvtx_t), offsetof(mvtx_t, normal)); glEnableVertexAttribArray(GL4_ATTRIB_LIGHTFLAGS); - qglVertexAttribIPointer(GL4_ATTRIB_LIGHTFLAGS, 1, GL_UNSIGNED_INT, sizeof(gl4_3D_vtx_t), offsetof(gl4_3D_vtx_t, lightFlags)); + qglVertexAttribIPointer(GL4_ATTRIB_LIGHTFLAGS, 1, GL_UNSIGNED_INT, sizeof(mvtx_t), offsetof(mvtx_t, lightFlags)); @@ -141,7 +141,7 @@ SetLightFlags(msurface_t *surf) lightFlags = surf->dlightbits; } - gl4_3D_vtx_t* verts = surf->polys->vertices; + mvtx_t* verts = surf->polys->vertices; int numVerts = surf->polys->numverts; for(int i=0; ipolys->vertices; + mvtx_t* verts = surf->polys->vertices; int numVerts = surf->polys->numverts; for(int i=0; inext = warpface->polys; warpface->polys = poly; poly->numverts = numverts + 2; @@ -592,7 +592,7 @@ GL4_ClearSkyBox(void) } static void -MakeSkyVec(float s, float t, int axis, gl4_3D_vtx_t* vert) +MakeSkyVec(float s, float t, int axis, mvtx_t* vert) { vec3_t v, b; int j, k; @@ -693,7 +693,7 @@ GL4_DrawSkyBox(void) // TODO: this could all be done in one drawcall.. but.. whatever, it's <= 6 drawcalls/frame - gl4_3D_vtx_t skyVertices[4]; + mvtx_t skyVertices[4]; for (i = 0; i < 6; i++) { diff --git a/src/client/refresh/gl4/header/local.h b/src/client/refresh/gl4/header/local.h index ba15874b..2e549585 100644 --- a/src/client/refresh/gl4/header/local.h +++ b/src/client/refresh/gl4/header/local.h @@ -383,7 +383,7 @@ GL4_BindEBO(GLuint ebo) } } -extern void GL4_BufferAndDraw3D(const gl4_3D_vtx_t* verts, int numVerts, GLenum drawMode); +extern void GL4_BufferAndDraw3D(const mvtx_t* verts, int numVerts, GLenum drawMode); extern void GL4_RotateForEntity(entity_t *e); diff --git a/src/client/refresh/gl4/header/model.h b/src/client/refresh/gl4/header/model.h index 2528de80..27967d8b 100644 --- a/src/client/refresh/gl4/header/model.h +++ b/src/client/refresh/gl4/header/model.h @@ -27,16 +27,6 @@ #ifndef SRC_CLIENT_REFRESH_GL4_HEADER_MODEL_H_ #define SRC_CLIENT_REFRESH_GL4_HEADER_MODEL_H_ -// used for vertex array elements when drawing brushes, sprites, sky and more -// (ok, it has the layout used for rendering brushes, but is not used there) -typedef struct gl4_3D_vtx_s { - vec3_t pos; - float texCoord[2]; - float lmTexCoord[2]; // lightmap texture coordinate (sometimes unused) - vec3_t normal; - GLuint lightFlags; // bit i set means: dynlight i affects surface -} gl4_3D_vtx_t; - // used for vertex array elements when drawing models typedef struct gl4_alias_vtx_s { GLfloat pos[3]; @@ -52,7 +42,7 @@ typedef struct glpoly_s struct glpoly_s *chain; int numverts; int flags; /* for SURF_UNDERWATER (not needed anymore?) */ - gl4_3D_vtx_t vertices[4]; /* variable sized */ + mvtx_t vertices[4]; /* variable sized */ } glpoly_t; typedef struct msurface_s diff --git a/src/client/refresh/ref_model.h b/src/client/refresh/ref_model.h index 3540cc3b..2e2ef96a 100644 --- a/src/client/refresh/ref_model.h +++ b/src/client/refresh/ref_model.h @@ -2,10 +2,10 @@ /* in memory representation */ -typedef struct glpoly_s +typedef struct mpoly_s { - struct glpoly_s *next; - struct glpoly_s *chain; + struct mpoly_s *next; + struct mpoly_s *chain; int numverts; int flags; /* for SURF_UNDERWATER (not needed anymore?) */ float verts[4][VERTEXSIZE]; /* variable sized (xyz s1t1 s2t2) */ diff --git a/src/client/refresh/ref_shared.h b/src/client/refresh/ref_shared.h index 38a53d52..25944560 100644 --- a/src/client/refresh/ref_shared.h +++ b/src/client/refresh/ref_shared.h @@ -179,6 +179,18 @@ typedef struct mleaf_s int key; /* BSP sequence number for leaf's contents */ } mleaf_t; +/* + * used for vertex array elements when drawing brushes, sprites, sky and more + * (ok, it has the layout used for rendering brushes, but is not used there) + */ +typedef struct mvtx_s { + vec3_t pos; + float texCoord[2]; + float lmTexCoord[2]; /* lightmap texture coordinate (sometimes unused) */ + vec3_t normal; + int lightFlags; /* bit i set means: dynlight i affects surface */ +} mvtx_t; + /* BSPX Light octtree */ #define LGNODE_LEAF (1u<<31) #define LGNODE_MISSING (1u<<30)