Changeset 883 for libcaca/trunk/cucul/import.c
- Timestamp:
- Apr 25, 2006, 8:16:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/import.c
r882 r883 200 200 unsigned char _get_ansi_command(unsigned char const *buffer, int size); 201 201 int _parse_tuple(unsigned int *ret, unsigned char const *buffer, int size); 202 void _manage_modifiers(int i, int *fg, int *bg, int *save_fg, int *save_bg );202 void _manage_modifiers(int i, int *fg, int *bg, int *save_fg, int *save_bg, int *bold); 203 203 204 204 static cucul_canvas_t *import_ansi(void const *data, unsigned int size) … … 213 213 int save_x = 0, save_y = 0; 214 214 unsigned int j, add = 0; 215 int fg, bg, save_fg, save_bg ;215 int fg, bg, save_fg, save_bg, bold; 216 216 217 217 fg = save_fg = CUCUL_COLOR_LIGHTGRAY; 218 218 bg = save_bg = CUCUL_COLOR_BLACK; 219 bold = 0; 219 220 220 221 cv = cucul_create_canvas(width, height); … … 285 286 case 'm': 286 287 for(j = 0; j < count; j++) 287 _manage_modifiers(tuple[j], &fg, &bg, &save_fg, &save_bg); 288 _manage_modifiers(tuple[j], &fg, &bg, &save_fg, &save_bg, &bold); 289 if(bold && fg < 8) 290 fg += 8; 291 if(bold && bg < 8) 292 bg += 8; 288 293 cucul_set_color(cv, fg, bg); 289 294 break; … … 306 311 else 307 312 { 308 if((buffer[i] >= 0x20) || (buffer[i] <= 0x7E)) 309 { 310 _cucul_putchar32(cv, x, y,_cucul_cp437_to_utf32(buffer[i])); 311 312 // cucul_putchar(cv, x, y, buffer[i]); 313 } 314 else 315 cucul_putchar(cv, x, y, '?'); 313 _cucul_putchar32(cv, x, y,_cucul_cp437_to_utf32(buffer[i])); 316 314 x++; 317 315 } … … 391 389 392 390 393 void _manage_modifiers(int i, int *fg, int *bg, int *save_fg, int *save_bg )391 void _manage_modifiers(int i, int *fg, int *bg, int *save_fg, int *save_bg, int *bold) 394 392 { 395 393 static uint8_t const ansi2cucul[] = … … 422 420 *fg = CUCUL_COLOR_DEFAULT; 423 421 *bg = CUCUL_COLOR_DEFAULT; 422 *bold = 0; 424 423 break; 425 424 case 1: /* BOLD */ 426 if(*fg < 8) 427 *fg += 8; 428 if(*bg < 8) 429 *bg += 8; 425 *bold = 1; 430 426 break; 431 427 case 4: // Underline
Note: See TracChangeset
for help on using the changeset viewer.