Changeset 8fa9562 for owl.c


Ignore:
Timestamp:
Jan 20, 2007, 9:49:55 PM (17 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
575877f
Parents:
212764e
Message:
Added background color support to owl.

If we run out of color pairs during a painting of the screen, further
background colors will be silently dropped. I'm hoping this doesn't
happen often. The used pair list is reset with each draw, so only
what's actually on screen matters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r212764e r8fa9562  
    177177  /* define simple color pairs */
    178178  if (has_colors() && COLOR_PAIRS>=8) {
    179     init_pair(OWL_COLOR_BLACK,   COLOR_BLACK,   -1);
    180     init_pair(OWL_COLOR_RED,     COLOR_RED,     -1);
    181     init_pair(OWL_COLOR_GREEN,   COLOR_GREEN,   -1);
    182     init_pair(OWL_COLOR_YELLOW,  COLOR_YELLOW,  -1);
    183     init_pair(OWL_COLOR_BLUE,    COLOR_BLUE,    -1);
    184     init_pair(OWL_COLOR_MAGENTA, COLOR_MAGENTA, -1);
    185     init_pair(OWL_COLOR_CYAN,    COLOR_CYAN,    -1);
    186     init_pair(OWL_COLOR_WHITE,   COLOR_WHITE,   -1);
     179    int bg = COLOR_BLACK;
     180#ifdef HAVE_USE_DEFAULT_COLORS
     181    bg = -1;
     182#endif
     183    init_pair(OWL_COLOR_BLACK,   COLOR_BLACK,   bg);
     184    init_pair(OWL_COLOR_RED,     COLOR_RED,     bg);
     185    init_pair(OWL_COLOR_GREEN,   COLOR_GREEN,   bg);
     186    init_pair(OWL_COLOR_YELLOW,  COLOR_YELLOW,  bg);
     187    init_pair(OWL_COLOR_BLUE,    COLOR_BLUE,    bg);
     188    init_pair(OWL_COLOR_MAGENTA, COLOR_MAGENTA, bg);
     189    init_pair(OWL_COLOR_CYAN,    COLOR_CYAN,    bg);
     190    init_pair(OWL_COLOR_WHITE,   COLOR_WHITE,   bg);
    187191  }
    188192
Note: See TracChangeset for help on using the changeset viewer.