fix a possible bug that can cause ds->shaderInfo to be NULL

This commit is contained in:
Rudolf Polzer
2011-06-05 18:43:31 +02:00
parent 028fc5286c
commit bbce294abb

View File

@@ -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;