Mercurial > hg > early-roguelike
comparison xrogue/options.c @ 266:08489644940b
Merge the UltraRogue branch.
author | John "Elwin" Edwards |
---|---|
date | Sun, 19 Feb 2017 19:56:43 -0500 |
parents | e940e6c00751 |
children | e52a8a7ad4c5 |
comparison
equal
deleted
inserted
replaced
265:7fcb2f9f57e6 | 266:08489644940b |
---|---|
372 len = (char *)sp - str; | 372 len = (char *)sp - str; |
373 /* | 373 /* |
374 * Look it up and deal with it | 374 * Look it up and deal with it |
375 */ | 375 */ |
376 for (op = optlist; op < &optlist[NUM_OPTS]; op++) | 376 for (op = optlist; op < &optlist[NUM_OPTS]; op++) |
377 { | |
377 if (EQSTR(str, op->o_name, len)) | 378 if (EQSTR(str, op->o_name, len)) |
378 { | 379 { |
379 if (op->o_putfunc == put_bool) /* if option is a boolean */ | 380 if (op->o_putfunc == put_bool) /* if option is a boolean */ |
380 *(bool *)op->o_opt = TRUE; | 381 *(bool *)op->o_opt = TRUE; |
381 else /* string option */ | 382 else /* string option */ |
433 && EQSTR(str, "no", 2) && EQSTR(str + 2, op->o_name, len - 2)) | 434 && EQSTR(str, "no", 2) && EQSTR(str + 2, op->o_name, len - 2)) |
434 { | 435 { |
435 *(bool *)op->o_opt = FALSE; | 436 *(bool *)op->o_opt = FALSE; |
436 break; | 437 break; |
437 } | 438 } |
439 } | |
438 | 440 |
439 /* | 441 /* |
440 * skip to start of next option name | 442 * skip to start of next option name |
441 */ | 443 */ |
442 while (*sp && !isalpha(*sp)) | 444 while (*sp && !isalpha(*sp)) |