From 11186bfec52cefd8876cab849cf8763d8ccae908 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 5 Jun 2011 20:36:09 +0200 Subject: [PATCH] misc_model: also support _skin name; also support frame field name --- tools/quake3/q3map2/light_trace.c | 6 +++++- tools/quake3/q3map2/model.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/quake3/q3map2/light_trace.c b/tools/quake3/q3map2/light_trace.c index 8e79244e..84e4ab0e 100644 --- a/tools/quake3/q3map2/light_trace.c +++ b/tools/quake3/q3map2/light_trace.c @@ -1220,7 +1220,11 @@ static void PopulateTraceNodes( void ) /* external model */ default: - frame = IntForKey( e, "_frame" ); + frame = 0; + if(strcmp("", ValueForKey( e, "_frame"))) + frame = IntForKey(e, "_frame"); + else if(strcmp("", ValueForKey( e, "frame"))) + frame = IntForKey(e, "frame"); model = LoadModel( value, frame ); if( model == NULL ) continue; diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index 86a87c42..2b3bb7ed 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -747,7 +747,11 @@ void AddTriangleModels( entity_t *e ) } /* get model frame */ - frame = IntForKey( e2, "_frame" ); + frame = 0; + if(strcmp("", ValueForKey( e2, "_frame"))) + frame = IntForKey(e2, "_frame"); + else if(strcmp("", ValueForKey( e2, "frame"))) + frame = IntForKey(e2, "frame"); /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */ if( e == entities ) @@ -888,7 +892,11 @@ void AddTriangleModels( entity_t *e ) if( shadeAngle > 0.0f ) Sys_Printf( "misc_model has shading angle of %.4f\n", shadeAngle ); - skin = IntForKey(e2, "skin"); + skin = 0; + if(strcmp("", ValueForKey( e2, "_skin"))) + skin = IntForKey(e2, "_skin"); + else if(strcmp("", ValueForKey( e2, "skin"))) + skin = IntForKey(e2, "skin"); /* insert the model */ InsertModel( model, skin, frame, transform, remap, celShader, mapEntityNum, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle ); -- 2.39.2