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 committed 2017-07-04 14:06:09 -05:00
1 parent 4dffc52c1d
commit 904bbc1a8f
10 files changed
+54 -32

No files matched your search

+2 -2
View File
@@ -365,8 +365,8 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
shader = tr.defaultShader;
for ( j = 0 ; j < skin->numSurfaces ; j++ ) {
// the names have both been lowercased
if ( !strcmp( skin->surfaces[j]->name, surface->name ) ) {
shader = skin->surfaces[j]->shader;
if ( !strcmp( skin->surfaces[j].name, surface->name ) ) {
shader = skin->surfaces[j].shader;
break;
}
}