\r
#define DEFAULT_DYNTEXTURE r_texture_grey128\r
\r
-static dyntexture_t * _CL_FindDynTexture( const char *name ) {\r
+static dyntexture_t * cl_finddyntexture( const char *name ) {\r
unsigned i;\r
dyntexture_t *dyntexture = NULL;\r
- // some sanity checks - and make sure its actually a dynamic texture path\r
- if( !name || strncmp( name, DYNAMIC_TEXTURE_PATH_PREFIX, sizeof( DYNAMIC_TEXTURE_PATH_PREFIX ) - 1 ) != 0 ) {\r
+\r
+ // sanity checks - make sure its actually a dynamic texture path\r
+ if( !name || !*name || strncmp( name, CLDYNTEXTUREPREFIX, sizeof( CLDYNTEXTUREPREFIX ) - 1 ) != 0 ) {\r
+ // TODO: print a warning or something\r
+ if( developer.integer > 0 ) {\r
+ Con_Printf( "cl_finddyntexture: Bad dynamic texture name '%s'\n", name );\r
+ }\r
return NULL;\r
}\r
\r
}\r
\r
rtexture_t * CL_GetDynTexture( const char *name ) {\r
- dyntexture_t *dyntexture = _CL_FindDynTexture( name );\r
+ dyntexture_t *dyntexture = cl_finddyntexture( name );\r
if( dyntexture ) {\r
return dyntexture->texture;\r
} else {\r
cachepic_t *cachepic;\r
skinframe_t *skinframe;\r
\r
- dyntexture = _CL_FindDynTexture( name );\r
+ dyntexture = cl_finddyntexture( name );\r
// TODO: assert dyntexture != NULL!\r
if( dyntexture->texture != texture ) {\r
+ dyntexture->texture = texture;\r
+\r
cachepic = Draw_CachePic( name, false );\r
- skinframe = R_SkinFrame_Find( name, 0, 0, 0, 0, false );\r
- // this is kind of hacky\r
// TODO: assert cachepic and skinframe should be valid pointers...\r
-\r
// TODO: assert cachepic->tex = dyntexture->texture\r
cachepic->tex = texture;\r
// update cachepic's size, too\r
cachepic->width = R_TextureWidth( texture );\r
cachepic->height = R_TextureHeight( texture );\r
- // TODO: assert skinframe->base = dyntexture->texture\r
- skinframe->base = texture;\r
- // simply reset the compare* attributes of skinframe\r
- skinframe->comparecrc = 0;\r
- skinframe->comparewidth = skinframe->compareheight = 0;\r
\r
- dyntexture->texture = texture;\r
+ // update skinframes\r
+ skinframe = NULL;\r
+ while( (skinframe = R_SkinFrame_FindNextByName( skinframe, name )) != NULL ) {\r
+ skinframe->base = texture;\r
+ // simply reset the compare* attributes of skinframe\r
+ skinframe->comparecrc = 0;\r
+ skinframe->comparewidth = skinframe->compareheight = 0;\r
+ // this is kind of hacky\r
+ }\r
}\r
}\r
\r