- Timestamp:
- Feb 3, 2008, 1:01:07 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:
- 247cbc9, 61abb18
- Parents:
- 1b737a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r1b737a1 raf1920fd 689 689 void owl_fmtext_init_colorpair_mgr(owl_colorpair_mgr *cpmgr) 690 690 { 691 / / This could be a bitarray if we wanted to save memory.691 /* This could be a bitarray if we wanted to save memory. */ 692 692 short i, j; 693 693 cpmgr->next = 8; 694 694 695 / / The test is <= because we allocate COLORS+1 entries.695 /* The test is <= because we allocate COLORS+1 entries. */ 696 696 cpmgr->pairs = owl_malloc((COLORS+1) * sizeof(short*)); 697 697 for(i = 0; i <= COLORS; i++) { … … 719 719 cpmgr->next = 8; 720 720 721 / / The test is <= because we allocated COLORS+1 entries.721 /* The test is <= because we allocated COLORS+1 entries. */ 722 722 for(i = 0; i <= COLORS; i++) { 723 723 for(j = 0; j <= COLORS; j++) { … … 753 753 #endif 754 754 755 / / looking for a pair we already set up for this draw.755 /* looking for a pair we already set up for this draw. */ 756 756 cpmgr = owl_global_get_colorpair_mgr(&g); 757 757 pair = cpmgr->pairs[fg+1][bg+1]; 758 758 if (!(pair != -1 && pair < cpmgr->next)) { 759 /* owl_global_set_needrefresh(&g);*/ 760 // If we didn't find a pair, search for a free one to assign. 759 /* If we didn't find a pair, search for a free one to assign. */ 761 760 pair = (cpmgr->next < COLOR_PAIRS) ? cpmgr->next : -1; 762 761 if (pair != -1) { 763 / / We found a free pair, initialize it.762 /* We found a free pair, initialize it. */ 764 763 init_pair(pair, fg, bg); 765 764 cpmgr->pairs[fg+1][bg+1] = pair; … … 767 766 } 768 767 else if (bg != OWL_COLOR_DEFAULT) { 769 / / We still don't have a pair, drop the background color. Too bad.768 /* We still don't have a pair, drop the background color. Too bad. */ 770 769 owl_function_debugmsg("colorpairs: color shortage - dropping background color."); 771 770 pair = owl_fmtext_get_colorpair(fg, OWL_COLOR_DEFAULT); 772 771 } 773 772 else { 774 / / We still don't have a pair, defaults all around.773 /* We still don't have a pair, defaults all around. */ 775 774 owl_function_debugmsg("colorpairs: color shortage - dropping foreground and background color."); 776 775 pair = 0;
Note: See TracChangeset
for help on using the changeset viewer.