Changeset 476

Show
Ignore:
Timestamp:
08/09/07 12:25:19 (1 year ago)
Author:
ajps
Message:

Remove the pretence that the display of walls has any meaningful relationship to how they're 'lit'.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cave.c

    r472 r476  
    522522 
    523523/* 
    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 
    529531 * use a different tile in the tileset.  These modifications are different 
    530532 * for different sets, depending on the tiles available, and their position  
    531533 * in the set. 
    532534 */ 
    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. */ 
     535static 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" */ 
    536538        if (in_view) return; 
    537539 
    538         if (lighting == LIGHT_DARK) 
     540        /* When blind, we make walls and other "white" things dark */ 
     541        if (p_ptr->timed[TMD_BLIND]) 
    539542        { 
    540543                switch (use_graphics) 
     
    552555        } 
    553556 
    554         /* Handle "view_bright_lite" */ 
     557        /* Handle "view_bright_lite" by dimming walls not "in view" */ 
    555558        else if (view_bright_lite) 
    556559        { 
     
    636639        /* Special lighting effects (walls only) */ 
    637640        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); 
    639642 
    640643        /* Save the terrain info for the transparency effects */ 
     
    797800 *    LIGHT_DARK for unlit grids, LIGHT_TORCH for those lit by the player's 
    798801 *    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. 
    799804 *        
    800805 * NOTES: 
     
    803808 * 
    804809 * 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. 
    815812 * 
    816813 * TODO: 
     
    878875                                g->lighting = LIGHT_DARK; 
    879876                } 
    880                 /* Interesting grids (non-floors) */ 
    881877                else 
    882878                { 
    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                                 else 
    890                                         g->lighting = LIGHT_GLOW; 
    891                         } 
    892879                } 
    893880        }