- Timestamp:
- Feb 3, 2008, 1:08:11 AM (16 years ago)
- 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:
- 99219ed
- Parents:
- 625802a (diff), af1920fd (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
rc55ad84 ree310eb 793 793 void owl_fmtext_init_colorpair_mgr(owl_colorpair_mgr *cpmgr) 794 794 { 795 / / This could be a bitarray if we wanted to save memory.795 /* This could be a bitarray if we wanted to save memory. */ 796 796 short i, j; 797 797 cpmgr->next = 8; 798 798 799 / / The test is <= because we allocate COLORS+1 entries.799 /* The test is <= because we allocate COLORS+1 entries. */ 800 800 cpmgr->pairs = owl_malloc((COLORS+1) * sizeof(short*)); 801 801 for(i = 0; i <= COLORS; i++) { … … 823 823 cpmgr->next = 8; 824 824 825 / / The test is <= because we allocated COLORS+1 entries.825 /* The test is <= because we allocated COLORS+1 entries. */ 826 826 for(i = 0; i <= COLORS; i++) { 827 827 for(j = 0; j <= COLORS; j++) { … … 844 844 short pair, default_bg; 845 845 846 /* Sanity (Bounds) Check */ 847 if (fg > COLORS || fg < OWL_COLOR_DEFAULT) fg = OWL_COLOR_DEFAULT; 848 if (bg > COLORS || bg < OWL_COLOR_DEFAULT) bg = OWL_COLOR_DEFAULT; 849 846 850 #ifdef HAVE_USE_DEFAULT_COLORS 847 851 if (fg == OWL_COLOR_DEFAULT) fg = -1; … … 853 857 #endif 854 858 855 / / looking for a pair we already set up for this draw.859 /* looking for a pair we already set up for this draw. */ 856 860 cpmgr = owl_global_get_colorpair_mgr(&g); 857 861 pair = cpmgr->pairs[fg+1][bg+1]; 858 862 if (!(pair != -1 && pair < cpmgr->next)) { 859 /* owl_global_set_needrefresh(&g);*/ 860 // If we didn't find a pair, search for a free one to assign. 863 /* If we didn't find a pair, search for a free one to assign. */ 861 864 pair = (cpmgr->next < COLOR_PAIRS) ? cpmgr->next : -1; 862 865 if (pair != -1) { 863 / / We found a free pair, initialize it.866 /* We found a free pair, initialize it. */ 864 867 init_pair(pair, fg, bg); 865 868 cpmgr->pairs[fg+1][bg+1] = pair; … … 867 870 } 868 871 else if (bg != OWL_COLOR_DEFAULT) { 869 / / We still don't have a pair, drop the background color. Too bad.872 /* We still don't have a pair, drop the background color. Too bad. */ 870 873 owl_function_debugmsg("colorpairs: color shortage - dropping background color."); 871 874 pair = owl_fmtext_get_colorpair(fg, OWL_COLOR_DEFAULT); 872 875 } 873 876 else { 874 / / We still don't have a pair, defaults all around.877 /* We still don't have a pair, defaults all around. */ 875 878 owl_function_debugmsg("colorpairs: color shortage - dropping foreground and background color."); 876 879 pair = 0;
Note: See TracChangeset
for help on using the changeset viewer.