mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Convert texcoords to fixed point.
Bah, another weekend wasted on an oversight :( However, Mr. Fixit looks quite alright in the quake palette.
This commit is contained in:
parent
f0285e5a08
commit
3087e685cc
1 changed files with 8 additions and 2 deletions
|
@ -132,6 +132,12 @@ convert_tex (tex_t *tex)
|
|||
return new;
|
||||
}
|
||||
|
||||
static inline void
|
||||
convert_coord (byte *tc, int size)
|
||||
{
|
||||
*(int32_t *) tc = (int32_t) (*(float *) tc * (size - 1)) << 16;
|
||||
}
|
||||
|
||||
static void
|
||||
sw_iqm_load_textures (iqm_t *iqm)
|
||||
{
|
||||
|
@ -171,8 +177,8 @@ sw_iqm_load_textures (iqm_t *iqm)
|
|||
continue;
|
||||
done_verts[vind / 8] |= (1 << (vind % 8));
|
||||
|
||||
*(int32_t *) (tc + 0) = *(float *) (tc + 0) * (tex->width - 1);
|
||||
*(int32_t *) (tc + 4) = *(float *) (tc + 4) * (tex->height - 1);
|
||||
convert_coord (tc + 0, tex->width);
|
||||
convert_coord (tc + 4, tex->height);
|
||||
}
|
||||
}
|
||||
dstring_delete (str);
|
||||
|
|
Loading…
Reference in a new issue