Changeset 1098 for libcaca/trunk/cucul/import.c
- Timestamp:
- Sep 23, 2006, 9:07:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/import.c
r962 r1098 34 34 struct ansi_grcm 35 35 { 36 uint8_t fg, bg; 36 uint8_t fg, bg; /* ANSI-context fg/bg */ 37 uint8_t efg, ebg; /* Effective (libcucul) fg/bg */ 37 38 uint8_t bold, negative, concealed; 38 39 }; … … 381 382 case 'K': /* EL - Erase In Line */ 382 383 if(width < 80) 384 cucul_set_color(cv, CUCUL_COLOR_DEFAULT, 385 CUCUL_COLOR_TRANSPARENT); 383 386 cucul_set_canvas_size(cv, width = 80, height); 384 387 for(j = x; j < 80; j++) … … 400 403 * is big enough. */ 401 404 if((unsigned int)x >= width) 405 { 406 cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT); 402 407 cucul_set_canvas_size(cv, width = x + 1, height); 408 } 403 409 404 410 if((unsigned int)y >= height) 411 { 412 cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT); 405 413 cucul_set_canvas_size(cv, width, height = y + 1); 414 } 406 415 407 416 /* Now paste our character */ 417 cucul_set_color(cv, grcm.efg, grcm.ebg); 408 418 cucul_putchar(cv, x, y, cucul_cp437_to_utf32(buffer[i])); 409 419 x++; … … 427 437 428 438 unsigned int j; 429 uint8_t myfg, mybg;430 439 431 440 for(j = 0; j < argc; j++) … … 480 489 if(g->concealed) 481 490 { 482 myfg = mybg = CUCUL_COLOR_TRANSPARENT;491 g->efg = g->ebg = CUCUL_COLOR_TRANSPARENT; 483 492 } 484 493 else 485 494 { 486 myfg = g->negative ? g->bg : g->fg;487 mybg = g->negative ? g->fg : g->bg;495 g->efg = g->negative ? g->bg : g->fg; 496 g->ebg = g->negative ? g->fg : g->bg; 488 497 489 498 if(g->bold) 490 499 { 491 if(myfg < 8) 492 myfg += 8; 493 else if(myfg == CUCUL_COLOR_DEFAULT) 494 myfg = CUCUL_COLOR_WHITE; 495 } 496 } 497 498 cucul_set_color(cv, myfg, mybg); 500 if(g->efg < 8) 501 g->efg += 8; 502 else if(g->efg == CUCUL_COLOR_DEFAULT) 503 g->efg = CUCUL_COLOR_WHITE; 504 } 505 } 499 506 } 500 507
Note: See TracChangeset
for help on using the changeset viewer.