version 1.8 | | version 1.9 |
---|
| | |
/* | | /* |
* static char *rcsid_style_c = | | * static char *rcsid_style_c = |
* "$Id: style.c,v 1.8 2000/12/04 00:40:05 cvs Exp $"; | | * "$Id: style.c,v 1.9 2000/12/11 08:34:05 peterm Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
| | |
if(! (S_ISDIR(file_stat.st_mode))) { | | if(! (S_ISDIR(file_stat.st_mode))) { |
| | if( (style_map=has_been_loaded(style_file_path)) == NULL) |
style_map = load_original_map(style_file_path,0); | | style_map = load_original_map(style_file_path,0); |
} | | } |
if(style_map == NULL) /* maybe we were given a directory! */ | | if(style_map == NULL) /* maybe we were given a directory! */ |
| | |
if(difficulty==-1) { /* pick a random style from this dir. */ | | if(difficulty==-1) { /* pick a random style from this dir. */ |
strcat(style_file_path,"/"); | | strcat(style_file_path,"/"); |
strcat(style_file_path,namelist[RANDOM()%n]->d_name); | | strcat(style_file_path,namelist[RANDOM()%n]->d_name); |
| | if( (style_map=has_been_loaded(style_file_path)) == NULL) |
style_map = load_original_map(style_file_path,0); | | style_map = load_original_map(style_file_path,0); |
} | | } |
else { /* find the map closest in difficulty */ | | else { /* find the map closest in difficulty */ |
| | |
difficulty. */ | | difficulty. */ |
strcat(style_file_path,"/"); | | strcat(style_file_path,"/"); |
strcat(style_file_path,namelist[min_index]->d_name); | | strcat(style_file_path,namelist[min_index]->d_name); |
| | if( (style_map=has_been_loaded(style_file_path)) == NULL) |
style_map = load_original_map(style_file_path,0); | | style_map = load_original_map(style_file_path,0); |
| | |
| | |
} | | } |
| | |
} | | } |