Ignore:
Timestamp:
Sep 9, 2006, 6:53:13 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Made features (such as dithering mode) and caca_sqrt work in the legacy 0.x glue code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca0.h

    r1013 r1015  
    3131extern void __caca0_end(void);
    3232extern unsigned int __caca0_get_event(unsigned int, int);
     33extern unsigned int __caca0_sqrt(unsigned int);
    3334extern int __caca0_get_feature(int);
    3435extern void __caca0_set_feature(int);
    3536extern char const *__caca0_get_feature_name(int);
    3637extern cucul_canvas_t *__caca0_load_sprite(char const *);
     38extern cucul_dither_t *__caca0_create_bitmap(unsigned int, unsigned int,
     39          unsigned int, unsigned int, unsigned long int, unsigned long int,
     40          unsigned long int, unsigned long int);
     41extern void __caca0_free_bitmap(cucul_dither_t *);
    3742
    3843/* These variables are needed to emulate old non-thread safe behaviour */
     
    8792};
    8893
     94/* This enum still exists in libcaca 1.x, thus cannot be redefined */
    8995#define CACA_EVENT_NONE          0x00000000
    9096#define CACA_EVENT_KEY_PRESS     0x01000000
     
    124130#define caca_get_mouse_y() caca_get_mouse_y(__caca0_dp)
    125131
    126 #define caca_set_color(x, y) cucul_set_color(__caca0_cv, x, y)
     132#define caca_set_color(x, y) \
     133    (__caca0_fg = (x), __caca0_bg = (y), cucul_set_color(__caca0_cv, x, y))
     134#define caca_get_fg_color() __caca0_fg
     135#define caca_get_bg_color() __caca0_bg
    127136#define caca_get_color_name cucul_get_color_name
    128137#define caca_putchar(x, y, c) cucul_putchar(__caca0_cv, x, y, c)
     
    167176
    168177#define caca_rand(a, b) cucul_rand(a, (b)+1)
     178#define caca_sqrt __caca0_sqrt
    169179
    170180#define caca_sprite cucul_canvas
    171181#define caca_load_sprite __caca0_load_sprite
    172 #define caca_get_sprite_frames(c) 0
     182#define caca_get_sprite_frames(c) 1
    173183#define caca_get_sprite_width(c, f) cucul_get_canvas_width(c)
    174184#define caca_get_sprite_height(c, f) cucul_get_canvas_height(c)
     
    179189
    180190#define caca_bitmap cucul_dither
    181 #define caca_create_bitmap cucul_create_dither
     191#define caca_create_bitmap __caca0_create_bitmap
    182192#define caca_set_bitmap_palette cucul_set_dither_palette
    183193#define caca_draw_bitmap(x, y, z, t, b, p) \
    184194    cucul_dither_bitmap(__caca0_cv, x, y, z, t, b, p)
    185 #define caca_free_bitmap cucul_free_dither
     195#define caca_free_bitmap __caca0_free_bitmap
    186196
    187197#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.