X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fmodel.c;h=2b3bb7ed5f0059d5c1cc18862c65e47517b36f08;hb=11186bfec52cefd8876cab849cf8763d8ccae908;hp=a56134c82777066c33851d4a8e33f60e6ad6c22a;hpb=391d71d9ba8634ba775a2b094d191d9a191dc08e;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index a56134c8..2b3bb7ed 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -208,7 +208,7 @@ adds a picomodel into the bsp void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap_t *remap, shaderInfo_t *celShader, int eNum, int castShadows, int recvShadows, int spawnFlags, float lightmapScale, int lightmapSampleSize, float shadeAngle ) { - int i, j, k, s, numSurfaces; + int i, j, s, numSurfaces; m4x4_t identity, nTransform; picoModel_t *model; picoShader_t *shader; @@ -333,12 +333,6 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap if( PicoGetSurfaceType( surface ) != PICO_TRIANGLES ) continue; - /* allocate a surface (ydnar: gs mods) */ - ds = AllocDrawSurface( SURFACE_TRIANGLES ); - ds->entityNum = eNum; - ds->castShadows = castShadows; - ds->recvShadows = recvShadows; - /* get shader name */ shader = PicoGetSurfaceShader( surface ); if( shader == NULL ) @@ -401,6 +395,12 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap else si = ShaderInfoForShader( picoShaderName ); + /* allocate a surface (ydnar: gs mods) */ + ds = AllocDrawSurface( SURFACE_TRIANGLES ); + ds->entityNum = eNum; + ds->castShadows = castShadows; + ds->recvShadows = recvShadows; + /* set shader */ ds->shaderInfo = si; @@ -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 );