mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-21 03:21:08 +00:00
gl_mesh.c (BuildTris): worked around a type-punned pointer. adapted from quakeforge.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@249 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
e1046e68c6
commit
6bbb06b490
1 changed files with 16 additions and 8 deletions
|
@ -255,6 +255,8 @@ void BuildTris (void)
|
||||||
|
|
||||||
for (j = 0; j < bestlen+2; j++)
|
for (j = 0; j < bestlen+2; j++)
|
||||||
{
|
{
|
||||||
|
int tmp;
|
||||||
|
|
||||||
// emit a vertex into the reorder buffer
|
// emit a vertex into the reorder buffer
|
||||||
k = bestverts[j];
|
k = bestverts[j];
|
||||||
vertexorder[numorder++] = k;
|
vertexorder[numorder++] = k;
|
||||||
|
@ -267,8 +269,14 @@ void BuildTris (void)
|
||||||
s = (s + 0.5) / pheader->skinwidth;
|
s = (s + 0.5) / pheader->skinwidth;
|
||||||
t = (t + 0.5) / pheader->skinheight;
|
t = (t + 0.5) / pheader->skinheight;
|
||||||
|
|
||||||
*(float *)&commands[numcommands++] = s;
|
// *(float *)&commands[numcommands++] = s;
|
||||||
*(float *)&commands[numcommands++] = t;
|
// *(float *)&commands[numcommands++] = t;
|
||||||
|
// NOTE: 4 == sizeof(int)
|
||||||
|
// == sizeof(float)
|
||||||
|
memcpy (&tmp, &s, 4);
|
||||||
|
commands[numcommands++] = tmp;
|
||||||
|
memcpy (&tmp, &t, 4);
|
||||||
|
commands[numcommands++] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue