Browse Source

* Updated libcaca and cacaview after the API changes.

tags/v0.99.beta14
Sam Hocevar sam 17 years ago
parent
commit
3624787754
2 changed files with 21 additions and 19 deletions
  1. +2
    -2
      caca/caca0.c
  2. +19
    -17
      src/cacaview.c

+ 2
- 2
caca/caca0.c View File

@@ -187,7 +187,7 @@ void __caca0_set_feature(int feature)
case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35:
dithering = feature; dithering = feature;
for(i = 0; i < nbitmaps; i++) for(i = 0; i < nbitmaps; i++)
cucul_set_dither_mode(bitmaps[i], features[feature]);
cucul_set_dither_algorithm(bitmaps[i], features[feature]);
break; break;
} }
} }
@@ -239,7 +239,7 @@ cucul_dither_t *__caca0_create_bitmap(unsigned int bpp, unsigned int w,


cucul_set_dither_color(d, features[background]); cucul_set_dither_color(d, features[background]);
cucul_set_dither_antialias(d, features[antialiasing]); cucul_set_dither_antialias(d, features[antialiasing]);
cucul_set_dither_mode(d, features[dithering]);
cucul_set_dither_algorithm(d, features[dithering]);


/* Store bitmap in our list */ /* Store bitmap in our list */
nbitmaps++; nbitmaps++;


+ 19
- 17
src/cacaview.c View File

@@ -64,8 +64,8 @@ int zoom = 0, g = 0, fullscreen = 0, mode, ww, wh;


int main(int argc, char **argv) int main(int argc, char **argv)
{ {
char const * const * dithers = cucul_get_dither_mode_list(NULL);
int dither_mode = 0;
char const * const * algos = cucul_get_dither_algorithm_list(NULL);
int dither_algorithm = 0;


int quit = 0, update = 1, help = 0, status = 0; int quit = 0, update = 1, help = 0, status = 0;
int reload = 0; int reload = 0;
@@ -206,19 +206,21 @@ int main(int argc, char **argv)
break; break;
#endif #endif
case 'd': case 'd':
dither_mode++;
if(dithers[dither_mode * 2] == NULL)
dither_mode = 0;
cucul_set_dither_mode(im->dither, dithers[dither_mode * 2]);
dither_algorithm++;
if(algos[dither_algorithm * 2] == NULL)
dither_algorithm = 0;
cucul_set_dither_algorithm(im->dither,
algos[dither_algorithm * 2]);
new_status = STATUS_DITHERING; new_status = STATUS_DITHERING;
update = 1; update = 1;
break; break;
case 'D': case 'D':
dither_mode--;
if(dither_mode < 0)
while(dithers[dither_mode * 2 + 2] != NULL)
dither_mode++;
cucul_set_dither_mode(im->dither, dithers[dither_mode * 2]);
dither_algorithm--;
if(dither_algorithm < 0)
while(algos[dither_algorithm * 2 + 2] != NULL)
dither_algorithm++;
cucul_set_dither_algorithm(im->dither,
algos[dither_algorithm * 2]);
new_status = STATUS_DITHERING; new_status = STATUS_DITHERING;
update = 1; update = 1;
break; break;
@@ -385,24 +387,24 @@ int main(int argc, char **argv)
{ {
print_status(); print_status();


#if 0 /* FIXME */
cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK); cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK);
switch(status) switch(status)
{ {
case STATUS_DITHERING:
cucul_printf(cv, 0, wh - 1, "Dithering: %s",
cucul_get_dither_algorithm(im->dither));
break;
#if 0 /* FIXME */
case STATUS_ANTIALIASING: case STATUS_ANTIALIASING:
cucul_printf(cv, 0, wh - 1, "Antialiasing: %s", cucul_printf(cv, 0, wh - 1, "Antialiasing: %s",
cucul_get_feature_name(cucul_get_feature(cv, CUCUL_ANTIALIASING))); cucul_get_feature_name(cucul_get_feature(cv, CUCUL_ANTIALIASING)));
break; break;
case STATUS_DITHERING:
cucul_printf(cv, 0, wh - 1, "Dithering: %s",
cucul_get_feature_name(cucul_get_feature(cv, CUCUL_DITHERING)));
break;
case STATUS_BACKGROUND: case STATUS_BACKGROUND:
cucul_printf(cv, 0, wh - 1, "Background: %s", cucul_printf(cv, 0, wh - 1, "Background: %s",
cucul_get_feature_name(cucul_get_feature(cv, CUCUL_BACKGROUND))); cucul_get_feature_name(cucul_get_feature(cv, CUCUL_BACKGROUND)));
break; break;
}
#endif #endif
}
} }


if(help) if(help)


Loading…
Cancel
Save