From bbce294abbd240183a5c44edc02c0c2d32408389 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 5 Jun 2011 18:43:31 +0200 Subject: [PATCH] fix a possible bug that can cause ds->shaderInfo to be NULL --- tools/quake3/q3map2/model.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index a56134c8..c4d34d71 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -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; -- 2.39.2