mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-16 17:01:44 +00:00
Avoid dangling &m pointer warning in BE_GenTempMeshVBO.
meshes and meshcount are always updated after the function call, so the assignments had no effect. Also make the function void as it always returns true.
This commit is contained in:
parent
c95a739208
commit
21d3080fbe
1 changed files with 6 additions and 12 deletions
|
@ -2289,7 +2289,7 @@ static void colourgen(const shaderpass_t *pass, int cnt, vec4_t *src, vec4_t *ds
|
|||
}
|
||||
#endif
|
||||
|
||||
static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m);
|
||||
static void BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m);
|
||||
static void DeformGen_Text(int stringid, int cnt, vecV_t *src, vecV_t *dst, const mesh_t *mesh)
|
||||
{
|
||||
#define maxlen 32
|
||||
|
@ -2361,8 +2361,8 @@ static void DeformGen_Text(int stringid, int cnt, vecV_t *src, vecV_t *dst, cons
|
|||
textmesh.numindexes = i*6;
|
||||
textmesh.numvertexes = i*4;
|
||||
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, &textmesh))
|
||||
return;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, &textmesh);
|
||||
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &meshptr;
|
||||
#undef maxlen
|
||||
|
@ -4908,7 +4908,7 @@ static void DrawMeshes(void)
|
|||
}
|
||||
}
|
||||
|
||||
static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
||||
static void BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
||||
{
|
||||
*vbo = &shaderstate.dummyvbo;
|
||||
|
||||
|
@ -5093,10 +5093,6 @@ static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
|||
}
|
||||
shaderstate.dummyvbo.bones = m->bones;
|
||||
shaderstate.dummyvbo.numbones = m->numbones;
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &m;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GLBE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_t *vbo, texnums_t *texnums, unsigned int beflags)
|
||||
|
@ -5123,8 +5119,7 @@ void GLBE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_
|
|||
{
|
||||
m = *meshlist++;
|
||||
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, m))
|
||||
continue;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, m);
|
||||
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &m;
|
||||
|
@ -5172,8 +5167,7 @@ void GLBE_SubmitBatch(batch_t *batch)
|
|||
else
|
||||
{
|
||||
//we're only allowed one mesh per batch if there's no vbo info.
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, batch->mesh[0]))
|
||||
return;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, batch->mesh[0]);
|
||||
}
|
||||
|
||||
sh = batch->shader;
|
||||
|
|
Loading…
Reference in a new issue