Changeset 2821 for libcaca/trunk/caca/caca0.c
- Timestamp:
- Sep 27, 2008, 3:12:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca0.c
r2299 r2821 28 28 29 29 /* These variables are needed to emulate old non-thread safe behaviour */ 30 c ucul_canvas_t *__caca0_cv = NULL;30 caca_canvas_t *__caca0_cv = NULL; 31 31 caca_display_t *__caca0_dp = NULL; 32 unsigned char __caca0_fg = C UCUL_LIGHTGRAY;33 unsigned char __caca0_bg = C UCUL_BLACK;32 unsigned char __caca0_fg = CACA_LIGHTGRAY; 33 unsigned char __caca0_bg = CACA_BLACK; 34 34 char __caca0_utf8[2] = " "; 35 35 … … 42 42 void __caca0_set_feature(int); 43 43 char const *__caca0_get_feature_name(int); 44 c ucul_canvas_t *__caca0_load_sprite(char const *);45 c ucul_dither_t *__caca0_create_bitmap(unsigned int, unsigned int,44 caca_canvas_t *__caca0_load_sprite(char const *); 45 caca_dither_t *__caca0_create_bitmap(unsigned int, unsigned int, 46 46 unsigned int, unsigned int, unsigned long int, unsigned long int, 47 47 unsigned long int, unsigned long int); 48 void __caca0_free_bitmap(c ucul_dither_t *);48 void __caca0_free_bitmap(caca_dither_t *); 49 49 extern char const *__caca0_get_color_name(unsigned char); 50 50 … … 52 52 int __caca0_init(void) 53 53 { 54 __caca0_cv = c ucul_create_canvas(0, 0);54 __caca0_cv = caca_create_canvas(0, 0); 55 55 if(!__caca0_cv) 56 56 return -1; … … 58 58 if(!__caca0_dp) 59 59 { 60 c ucul_free_canvas(__caca0_cv);60 caca_free_canvas(__caca0_cv); 61 61 __caca0_cv = NULL; 62 62 return -1; 63 63 } 64 __caca0_fg = C UCUL_LIGHTGRAY;65 __caca0_bg = C UCUL_BLACK;64 __caca0_fg = CACA_LIGHTGRAY; 65 __caca0_bg = CACA_BLACK; 66 66 return 0; 67 67 } … … 71 71 caca_free_display(__caca0_dp); 72 72 __caca0_dp = NULL; 73 c ucul_free_canvas(__caca0_cv);73 caca_free_canvas(__caca0_cv); 74 74 __caca0_cv = NULL; 75 75 } … … 145 145 }; 146 146 147 static c ucul_dither_t **bitmaps = NULL;147 static caca_dither_t **bitmaps = NULL; 148 148 static unsigned int nbitmaps = 0; 149 149 … … 173 173 background = feature; 174 174 for(i = 0; i < nbitmaps; i++) 175 c ucul_set_dither_color(bitmaps[i], features[feature]);175 caca_set_dither_color(bitmaps[i], features[feature]); 176 176 break; 177 177 … … 180 180 antialiasing = feature; 181 181 for(i = 0; i < nbitmaps; i++) 182 c ucul_set_dither_antialias(bitmaps[i], features[feature]);182 caca_set_dither_antialias(bitmaps[i], features[feature]); 183 183 break; 184 184 … … 187 187 dithering = feature; 188 188 for(i = 0; i < nbitmaps; i++) 189 c ucul_set_dither_algorithm(bitmaps[i], features[feature]);189 caca_set_dither_algorithm(bitmaps[i], features[feature]); 190 190 break; 191 191 } … … 212 212 } 213 213 214 c ucul_canvas_t *__caca0_load_sprite(char const *file)215 { 216 c ucul_canvas_t *cv;217 218 cv = c ucul_create_canvas(0, 0);;219 if(c ucul_import_file(cv, file, "") < 0)220 { 221 c ucul_free_canvas(cv);214 caca_canvas_t *__caca0_load_sprite(char const *file) 215 { 216 caca_canvas_t *cv; 217 218 cv = caca_create_canvas(0, 0);; 219 if(caca_import_file(cv, file, "") < 0) 220 { 221 caca_free_canvas(cv); 222 222 return NULL; 223 223 } … … 226 226 } 227 227 228 c ucul_dither_t *__caca0_create_bitmap(unsigned int bpp, unsigned int w,228 caca_dither_t *__caca0_create_bitmap(unsigned int bpp, unsigned int w, 229 229 unsigned int h, unsigned int pitch, 230 230 unsigned long int r, unsigned long int g, 231 231 unsigned long int b, unsigned long int a) 232 232 { 233 c ucul_dither_t *d;234 235 d = c ucul_create_dither(bpp, w, h, pitch, r, g, b, a);233 caca_dither_t *d; 234 235 d = caca_create_dither(bpp, w, h, pitch, r, g, b, a); 236 236 if(!d) 237 237 return NULL; 238 238 239 c ucul_set_dither_color(d, features[background]);240 c ucul_set_dither_antialias(d, features[antialiasing]);241 c ucul_set_dither_algorithm(d, features[dithering]);239 caca_set_dither_color(d, features[background]); 240 caca_set_dither_antialias(d, features[antialiasing]); 241 caca_set_dither_algorithm(d, features[dithering]); 242 242 243 243 /* Store bitmap in our list */ 244 244 nbitmaps++; 245 bitmaps = realloc(bitmaps, nbitmaps * (sizeof(c ucul_dither_t *)));245 bitmaps = realloc(bitmaps, nbitmaps * (sizeof(caca_dither_t *))); 246 246 bitmaps[nbitmaps - 1] = d; 247 247 … … 249 249 } 250 250 251 void __caca0_free_bitmap(c ucul_dither_t *d)251 void __caca0_free_bitmap(caca_dither_t *d) 252 252 { 253 253 unsigned int i, found = 0; 254 254 255 c ucul_free_dither(d);255 caca_free_dither(d); 256 256 257 257 /* Remove bitmap from our list */
Note: See TracChangeset
for help on using the changeset viewer.