mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Add a stride field to iqm_t.
Since iqm vertex arrays are variable, and I don't want to calculate the stride every time I render a model, cached the value used when building the arrays.
This commit is contained in:
parent
15d35fbdc9
commit
078cb10caf
2 changed files with 2 additions and 0 deletions
|
@ -127,6 +127,7 @@ typedef struct {
|
|||
int num_meshes;
|
||||
iqmmesh *meshes;
|
||||
byte *vertices;
|
||||
int stride;
|
||||
uint16_t *elements;
|
||||
int num_arrays;
|
||||
iqmvertexarray *vertexarrays;
|
||||
|
|
|
@ -295,6 +295,7 @@ load_iqm_vertex_arrays (model_t *mod, const iqmheader *hdr, byte *buffer)
|
|||
iqm->vertexarrays = realloc (iqm->vertexarrays,
|
||||
iqm->num_arrays * sizeof (iqmvertexarray));
|
||||
iqm->vertices = malloc (hdr->num_vertexes * bytes);
|
||||
iqm->stride = bytes;
|
||||
for (i = 0; i < hdr->num_vertexes; i++) {
|
||||
va = iqm->vertexarrays;
|
||||
vert = iqm->vertices + i * bytes;
|
||||
|
|
Loading…
Reference in a new issue