diff options
Diffstat (limited to 'tile.c')
| -rw-r--r-- | tile.c | 16 |
1 files changed, 11 insertions, 5 deletions
| @@ -9,18 +9,24 @@ static double mwfact = MWFACT; | |||
| 9 | /* extern */ | 9 | /* extern */ |
| 10 | 10 | ||
| 11 | void | 11 | void |
| 12 | addtomwfact(const char *arg) { | 12 | setmwfact(const char *arg) { |
| 13 | double delta; | 13 | double delta, newfact; |
| 14 | 14 | ||
| 15 | if(!isarrange(tile)) | 15 | if(!isarrange(tile)) |
| 16 | return; | 16 | return; |
| 17 | |||
| 18 | /* arg handling, manipulate mwfact */ | 17 | /* arg handling, manipulate mwfact */ |
| 19 | if(arg == NULL) | 18 | if(arg == NULL) |
| 20 | mwfact = MWFACT; | 19 | mwfact = MWFACT; |
| 21 | else if(1 == sscanf(arg, "%lf", &delta)) { | 20 | else if(1 == sscanf(arg, "%lf", &delta)) { |
| 22 | if(delta + mwfact > 0.1 && delta + mwfact < 0.9) | 21 | if(arg[0] != '+' && arg[0] != '-') |
| 23 | mwfact += delta; | 22 | newfact = delta; |
| 23 | else | ||
| 24 | newfact = mwfact + delta; | ||
| 25 | if(newfact < 0.1) | ||
| 26 | newfact = 0.1; | ||
| 27 | else if(newfact > 0.9) | ||
| 28 | newfact = 0.9; | ||
| 29 | mwfact = newfact; | ||
| 24 | } | 30 | } |
| 25 | arrange(); | 31 | arrange(); |
| 26 | } | 32 | } |
