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;
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 )
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;
/* copy xyz */
VectorCopy( dv->xyz, points[ j ] );
- VectorCopy( dv->xyz, backs[ j ] );
-
- /* find nearest axial to normal and push back points opposite */
- /* note: this doesn't work as well as simply using the plane of the triangle, below */
- for( k = 0; k < 3; k++ )
- {
- if( fabs( dv->normal[ k ] ) >= fabs( dv->normal[ (k + 1) % 3 ] ) &&
- fabs( dv->normal[ k ] ) >= fabs( dv->normal[ (k + 2) % 3 ] ) )
- {
- backs[ j ][ k ] += dv->normal[ k ] < 0.0f ? 64.0f : -64.0f;
- break;
- }
- }
}
VectorCopy( points[0], points[3] ); // for cyclic usage
}
/* 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 )
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 );