+ if ( !GetToken( qtrue ) ) {
+ break;
+ }
+ if ( !strcmp( token, "}" ) ) {
+ break;
+ }
+ if ( !wantShader ) continue;
+
+ /* digest any images */
+ if ( !stricmp( token, "map" ) ||
+ !stricmp( token, "clampMap" ) ) {
+
+ /* get an image */
+ GetToken( qfalse );
+ if ( token[ 0 ] != '*' && token[ 0 ] != '$' ) {
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ }
+ }
+ else if ( !stricmp( token, "animMap" ) ||
+ !stricmp( token, "clampAnimMap" ) ) {
+ GetToken( qfalse );// skip num
+ while ( TokenAvailable() ){
+ GetToken( qfalse );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ }
+ }
+ else if ( !stricmp( token, "videoMap" ) ){
+ GetToken( qfalse );
+ FixDOSName( token );
+ if ( strchr( token, "/" ) == NULL ){
+ sprintf( temp, "video/%s", token );
+ strcpy( token, temp );
+ }
+ for ( j = 0; j < pk3VideosN; j++ ){
+ if ( !stricmp( pk3Videos[j], token ) ){
+ goto away;
+ }
+ }
+ for ( j = 0; j < EXpk3VideosN; j++ ){
+ if ( !stricmp( EXpk3Videos[j], token ) ){
+ goto away;
+ }
+ }
+ strcpy ( pk3Videos[pk3VideosN], token );
+ pk3VideosN++;
+ away:
+ j = 0;
+ }
+ }
+ }
+ /* skip to the next shader */
+ else if ( !wantShader ) continue;
+
+ /* -----------------------------------------------------------------
+ surfaceparm * directives
+ ----------------------------------------------------------------- */
+
+ /* match surfaceparm */
+ else if ( !stricmp( token, "surfaceparm" ) ) {
+ GetToken( qfalse );
+ if ( !stricmp( token, "nodraw" ) ) {
+ wantShader = qfalse;
+ }
+ }
+
+ /* skyparms <outer image> <cloud height> <inner image> */
+ else if ( !stricmp( token, "skyParms" ) ) {
+ /* get image base */
+ GetToken( qfalse );
+
+ /* ignore bogus paths */
+ if ( stricmp( token, "-" ) && stricmp( token, "full" ) ) {
+ strcpy ( temp, token );
+ sprintf( token, "%s_up", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ sprintf( token, "%s_dn", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ sprintf( token, "%s_lf", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ sprintf( token, "%s_rt", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ sprintf( token, "%s_bk", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ sprintf( token, "%s_ft", temp );
+ tex2list( pk3Textures, &pk3TexturesN, EXpk3Textures, &EXpk3TexturesN );
+ }
+ /* skip rest of line */
+ GetToken( qfalse );
+ GetToken( qfalse );
+ }
+ }
+ //exclude shader
+ if ( wantShader ){
+ for ( j = 0; j < EXpk3ShadersN; j++ ){
+ if ( !stricmp( EXpk3Shaders[j], shadername ) ){
+ wantShader = qfalse;
+ break;
+ }
+ }
+ /* shouldnt make shaders for shipped with the game textures aswell */
+ if ( wantShader ){
+ for ( j = 0; j < EXpk3TexturesN; j++ ){
+ if ( !stricmp( EXpk3Textures[j], shadername ) ){
+ wantShader = qfalse;
+ break;
+ }