src/shared/materials.h
/* this is used for material-lookups using the external materials.txt file
 * method used in Half-Life. In that environment we have to strip any
 * prefixes and limit our material-name to 12 chars for everything to be
 * identified correctly */
this is used for material-lookups using the external materials.txt file
method used in Half-Life. In that environment we have to strip any
prefixes and limit our material-name to 12 chars for everything to be
identified correctly
this is used for material - lookups using the external materials . txt file method used in Half - Life . In that environment we have to strip any prefixes and limit our material - name to 12 chars for everything to be identified correctly
string
Materials_FixName(string tex_name)
{
	dprint(sprintf("^3Materials_FixName^7: %s > ", tex_name));
	if (str2chr(tex_name, 0) == '-')
		tex_name = substring(tex_name, 2, -1);
	else if (str2chr(tex_name, 0) == '+')
		tex_name = substring(tex_name, 2, -1);
	if (str2chr(tex_name, 0) == '~')
		tex_name = substring(tex_name, 1, -1);
	else if (str2chr(tex_name, 0) == '{')
		tex_name = substring(tex_name, 1, -1);
	tex_name = substring(tex_name, 0, 12);
	dprint(sprintf("%s\n", tex_name));
	return tex_name;
}
string Materials_FixName ( string tex_name ) { dprint ( sprintf ( " " , tex_name ) ) ; if ( str2chr ( tex_name , 0 ) == ' ' ) tex_name = substring ( tex_name , 2 , -1 ) ; else if ( str2chr ( tex_name , 0 ) == ' ' ) tex_name = substring ( tex_name , 2 , -1 ) ; if ( str2chr ( tex_name , 0 ) == ' ' ) tex_name = substring ( tex_name , 1 , -1 ) ; else if ( str2chr ( tex_name , 0 ) == ' ' ) tex_name = substring ( tex_name , 1 , -1 ) ; tex_name = substring ( tex_name , 0 , 12 ) ; dprint ( sprintf ( " \n " , tex_name ) ) ; return tex_name ; }
this is used for material-lookups using the external materials.txt file
 method used in Half-Life.
this is used for material - lookups using the external materials . txt file method used in Half - Life .
/* strip the first 2 chars when they're frame/random indicators */ /* also not allowed */ /* limit to 12 chars! */