Changeset 303
- Timestamp:
- Jan 2, 2004, 4:34:16 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/graphics.c
r300 r303 872 872 unsigned int x, y, len; 873 873 874 /* FIXME: This is very, very slow. There are several things that can 875 * be done in order to speed up things: 876 * - cache characters once rendered 877 * - pre-render all characters 878 * - use our own rendering routine (screen depth dependent) */ 874 /* First draw the background colours. Splitting the process in two 875 * loops like this is actually slightly faster. */ 879 876 for(y = 0; y < _caca_height; y++) 880 877 { … … 884 881 885 882 len = 1; 886 while(x + len < _caca_width && attr[len] == attr[0]) 883 while(x + len < _caca_width 884 && (attr[len] >> 4) == (attr[0] >> 4)) 887 885 len++; 888 886 … … 891 889 x * x11_font_width, y * x11_font_height, 892 890 len * x11_font_width, x11_font_height); 891 } 892 } 893 894 /* Then print the foreground characters */ 895 for(y = 0; y < _caca_height; y++) 896 { 897 for(x = 0; x < _caca_width; x += len) 898 { 899 unsigned char *attr = x11_attr + x + y * _caca_width; 900 901 len = 1; 902 903 /* Skip spaces */ 904 if(x11_char[x + y * _caca_width] == ' ') 905 continue; 906 907 while(x + len < _caca_width 908 && (attr[len] & 0xf) == (attr[0] & 0xf)) 909 len++; 893 910 894 911 XSetForeground(x11_dpy, x11_gc, x11_colors[attr[0] & 0xf]);
Note: See TracChangeset
for help on using the changeset viewer.