Changeset 231
- Timestamp:
- Nov 29, 2003, 3:41:37 PM (17 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/NOTES
r230 r231 118 118 o S-Lang: 119 119 120 256 character pairs are definable, but only 128 can be used. This is 121 because slsmg.c's This_Color variable uses its 8th bit to indicate an 122 alternate character set. Replacing a few 0x7F with 0xFF in sldisply.c 123 works around the problem but gets rid of the alternate charset. 124 120 125 o MS-DOS: all bright colours, bright backgrounds, and bright combinations 121 126 work using <conio.h>. No need to kludge anything. -
libcaca/trunk/configure.ac
r227 r231 18 18 AC_EGREP_CPP(foo,foo) 19 19 20 AC_ARG_ENABLE(ncurses, 21 [ --enable-ncurses ncurses graphics support (default enabled)]) 20 22 AC_ARG_ENABLE(slang, 21 [ --enable-slang slang graphics support (default enabled)]) 22 AC_ARG_ENABLE(ncurses, 23 [ --enable-ncurses ncurses graphics support (default disabled)]) 23 [ --enable-slang slang graphics support (default disabled)]) 24 24 AC_ARG_ENABLE(conio, 25 25 [ --enable-conio DOS conio.h graphics support (default disabled)]) … … 41 41 AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h) 42 42 USE_CONIO=: 43 elif test "${enable_ncurses}" = "yes"; then 43 elif test "${enable_slang}" = "yes"; then 44 AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) 45 AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) 46 AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang) 47 USE_SLANG=: 48 elif test "${enable_ncurses}" != "no"; then 44 49 AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers])) 45 50 AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library])) 46 51 AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses) 47 52 USE_NCURSES=: 48 elif test "${enable_slang}" != "no"; then49 AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))50 AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))51 AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)52 USE_SLANG=:53 53 else 54 54 AC_MSG_ERROR([could not find any terminal graphics interface]) -
libcaca/trunk/src/caca.c
r227 r231 97 97 SLtt_set_mouse_mode(1, 0); 98 98 SLsmg_refresh(); 99 100 /* Disable scrolling so that hashmap scrolling optimization code 101 * does not cause ugly refreshes due to slow terminals */ 102 SLtt_Term_Cannot_Scroll = 1; 99 103 100 104 #elif defined(USE_NCURSES) -
libcaca/trunk/src/graphics.c
r227 r231 40 40 #endif 41 41 42 #ifdef HAVE_INTTYPES_H 43 # include <inttypes.h> 44 #endif 45 42 46 #include <stdio.h> /* BUFSIZ */ 43 47 #include <string.h> … … 65 69 _caca_bgcolor = bgcolor; 66 70 #if defined(USE_SLANG) 67 SLsmg_set_color( fgcolor + 16 * bgcolor);71 SLsmg_set_color((bgcolor + 16 * fgcolor) /*% 128*/); 68 72 #elif defined(USE_NCURSES) 69 73 attrset(_caca_attr[fgcolor + 16 * bgcolor]); … … 135 139 #if defined(USE_SLANG) 136 140 SLsmg_gotorc(y, x); 137 SLsmg_write_string( s);141 SLsmg_write_string((char *)(intptr_t)s); 138 142 #elif defined(USE_NCURSES) 139 143 move(y, x); … … 199 203 static char *slang_colors[16] = 200 204 { 205 /* Standard colours */ 201 206 "black", 202 207 "blue", … … 207 212 "brown", 208 213 "lightgray", 214 /* Bright colours */ 209 215 "gray", 210 216 "brightblue", … … 219 225 int fg, bg; 220 226 221 for( bg = 0; bg < 16; bg++)222 for( fg = 0; fg < 16; fg++)227 for(fg = 0; fg < 16; fg++) 228 for(bg = 0; bg < 16; bg++) 223 229 { 224 int i = fg + 16 * bg;230 int i = bg + 16 * fg; 225 231 SLtt_set_color(i, NULL, slang_colors[fg], slang_colors[bg]); 226 232 } 227 233 234 /* Disable alt charset support so that we get all 256 colour pairs */ 235 SLtt_Has_Alt_Charset = 0; 236 228 237 #elif defined(USE_NCURSES) 229 238 static int curses_colors[] = 230 239 { 240 /* Standard curses colours */ 231 241 COLOR_BLACK, 232 242 COLOR_BLUE, … … 253 263 start_color(); 254 264 265 /* If COLORS == 16, it means the terminal supports full bright colours 266 * using setab and setaf (will use \e[90m \e[91m etc. for colours >= 8), 267 * we can build 16*16 colour pairs. 268 * If COLORS == 8, it means the terminal does not know about bright 269 * colours and we need to get them through A_BOLD and A_BLINK (\e[1m 270 * and \e[5m). We can only build 8*8 colour pairs. */ 255 271 max = COLORS >= 16 ? 16 : 8; 256 272 … … 272 288 _caca_attr[fg + 16 * (bg + 8)] = A_BLINK | COLOR_PAIR(col); 273 289 /* Bright fg on bright bg */ 274 _caca_attr[fg + 8 + 16 * (bg + 8)] = A_BLINK | A_BOLD | COLOR_PAIR(col); 290 _caca_attr[fg + 8 + 16 * (bg + 8)] = A_BLINK | A_BOLD 291 | COLOR_PAIR(col); 275 292 } 276 293 }
Note: See TracChangeset
for help on using the changeset viewer.