Changeset 476
- Timestamp:
- 08/09/07 12:25:19 (1 year ago)
- Files:
-
- trunk/src/cave.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cave.c
r472 r476 522 522 523 523 /* 524 * This function modifies the attr/char pair for an wall grids 525 * to reflect the various lighting options available. 526 * 527 * For text, this means changing the colouring for dark grids or 528 * view_bright_lite, and for graphics it means modifying the char to 524 * This function modifies the attr/char pair for a wall (or other "interesting" 525 * grids to show them as more-or-less lit. Note that how walls are drawn 526 * isn't directly related to how they are lit - walls are always "lit". 527 * The lighting effects we use are as a visual cue to emphasise blindness 528 * and to show field-of-view (view_bright_lite). 529 * 530 * For text, we change the attr and for graphics we modify the char to 529 531 * use a different tile in the tileset. These modifications are different 530 532 * for different sets, depending on the tiles available, and their position 531 533 * in the set. 532 534 */ 533 static void special_ lighting_wall(byte *a, char *c, enum grid_light_level lighting, bool in_view, int feat)534 { 535 /* Grids currently in view are left alone .*/535 static void special_wall_display(byte *a, char *c, bool in_view, int feat) 536 { 537 /* Grids currently in view are left alone, rendered as "white" */ 536 538 if (in_view) return; 537 539 538 if (lighting == LIGHT_DARK) 540 /* When blind, we make walls and other "white" things dark */ 541 if (p_ptr->timed[TMD_BLIND]) 539 542 { 540 543 switch (use_graphics) … … 552 555 } 553 556 554 /* Handle "view_bright_lite" */557 /* Handle "view_bright_lite" by dimming walls not "in view" */ 555 558 else if (view_bright_lite) 556 559 { … … 636 639 /* Special lighting effects (walls only) */ 637 640 if (g->f_idx > FEAT_INVIS && view_granite_lite) 638 special_ lighting_wall(&a, &c, g->lighting, g->in_view, g->f_idx);641 special_wall_display(&a, &c, g->in_view, g->f_idx); 639 642 640 643 /* Save the terrain info for the transparency effects */ … … 797 800 * LIGHT_DARK for unlit grids, LIGHT_TORCH for those lit by the player's 798 801 * light source, and LIGHT_GLOW for inherently light grids (lit rooms, etc). 802 * Note that lighting is always LIGHT_GLOW for known "interesting" grids 803 * like walls. 799 804 * 800 805 * NOTES: … … 803 808 * 804 809 * Terrain is remembered separately from objects and monsters, so can be 805 * shown even when the player can't "see" it. This leads to the "interesting" 806 * effects when doors out of view change from closed to open and so on. 807 * 808 * Note that "boring" grids (floors, invisible traps, and any illegal grids) 809 * are different from "interesting" grids (all other terrain features), 810 * and the two are handled differently, with LIGHT_TORCH only applied to 811 * the boring grids. In fact, wall grids are handled strangely wrt lighting 812 * altogether because we have to be careful not to have "paper walls" where a 813 * wall shows as lit from the other side (i.e. a dark corridor next to a lit 814 * room). 810 * shown even when the player can't "see" it. This leads to things like 811 * doors out of the player's view still change from closed to open and so on. 815 812 * 816 813 * TODO: … … 878 875 g->lighting = LIGHT_DARK; 879 876 } 880 /* Interesting grids (non-floors) */881 877 else 882 878 { 883 /* Skip currently visible grids for lighting */884 if (!(info & (CAVE_SEEN)))885 {886 /* Handle "blind" */887 if (p_ptr->timed[TMD_BLIND])888 g->lighting = LIGHT_DARK;889 else890 g->lighting = LIGHT_GLOW;891 }892 879 } 893 880 }
