| 528 | } |
| 529 | |
| 530 | void |
| 531 | apply_customizations( |
| 532 | enum graphics_sets which_set, |
| 533 | enum do_customizations docustomize) |
| 534 | { |
| 535 | glyph_map *gmap; |
| 536 | struct customization_detail *details; |
| 537 | struct symset_customization *sc; |
| 538 | boolean at_least_one = FALSE, |
| 539 | do_colors = ((docustomize & do_custom_colors) != 0), |
| 540 | do_symbols = ((docustomize & do_custom_symbols) != 0); |
| 541 | int custs; |
| 542 | |
| 543 | for (custs = 0; custs < (int) custom_count; ++custs) { |
| 544 | sc = &gs.sym_customizations[which_set][custs]; |
| 545 | if (sc->count && sc->details) { |
| 546 | at_least_one = TRUE; |
| 547 | /* These glyph customizations get applied to the glyphmap array, |
| 548 | not to symset entries */ |
| 549 | details = sc->details; |
| 550 | while (details) { |
| 551 | #ifdef ENHANCED_SYMBOLS |
| 552 | if (iflags.customsymbols && do_symbols) { |
| 553 | if (sc->custtype == custom_ureps) { |
| 554 | gmap = &glyphmap[details->content.urep.glyphidx]; |
| 555 | if (gs.symset[which_set].handling == H_UTF8) |
| 556 | (void) set_map_u(gmap, |
| 557 | details->content.urep.u.utf32ch, |
| 558 | details->content.urep.u.utf8str); |
| 559 | } |
| 560 | } |
| 561 | #endif |
| 562 | if (iflags.customcolors && do_colors) { |
| 563 | if (sc->custtype == custom_nhcolor) { |
| 564 | gmap = &glyphmap[details->content.ccolor.glyphidx]; |
| 565 | (void) set_map_customcolor(gmap, |
| 566 | details->content.ccolor.nhcolor); |
| 567 | } |
| 568 | } |
| 569 | details = details->next; |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | iflags.pending_customizations = at_least_one; |
| 574 | } |
| 575 | |
| 576 | /* Shuffle the customizations to match shuffled object descriptions, |
| 577 | * so a red potion isn't displayed with a blue customization, and so on. |
no test coverage detected