Allow more than 32 surfaces in skin files

Models don't have a surface limit; skins shouldn't either. Some player
models require more than 32 surfaces since vanilla Quake 3 did not
enforce the limit.

Skins are now limited to 256 surfaces because having no limit would
require parsing the skin file twice. The skin surfaces are dynamically
allocated so it doesn't increase memory usage when less surfaces
are used.
This commit is contained in:
Zack Middleton 2017-07-04 13:48:52 -05:00
parent 4dffc52c1d
commit 904bbc1a8f
10 changed files with 54 additions and 32 deletions

View file

@ -903,9 +903,9 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
for(j = 0; j < skin->numSurfaces; j++)
{
if (!strcmp(skin->surfaces[j]->name, surface->name))
if (!strcmp(skin->surfaces[j].name, surface->name))
{
shader = skin->surfaces[j]->shader;
shader = skin->surfaces[j].shader;
break;
}
}