Changeset 247


Ignore:
Timestamp:
Dec 11, 2003, 5:56:35 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • src/caca.c: + Moved global variables to src/graphics.c.
  • src/bitmap.c: + Sanitised prototypes.
Location:
libcaca/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/Makefile.am

    r214 r247  
    2525endif
    2626libcaca_pic_a_SOURCES = $(libcaca_a_SOURCES)
    27 libcaca_pic_a_CPPFLAGS = -fPIC
     27libcaca_pic_a_CPPFLAGS = -fPIC -DPIC
    2828
  • libcaca/trunk/src/bitmap.c

    r246 r247  
    161161}
    162162
    163 struct caca_bitmap *caca_create_bitmap(int bpp, int w, int h, int pitch,
    164                                        int rmask, int gmask, int bmask,
    165                                        int amask)
     163struct caca_bitmap *caca_create_bitmap(unsigned int bpp, unsigned int w,
     164                                       unsigned int h, unsigned int pitch,
     165                                       unsigned int rmask, unsigned int gmask,
     166                                       unsigned int bmask, unsigned int amask)
    166167{
    167168    struct caca_bitmap *bitmap;
    168169
    169     /* Currently only this format is supported. Will improve later. */
     170    /* Minor sanity test */
    170171    if(!w || !h || !pitch || bpp > 32 || bpp < 8)
    171172        return NULL;
     
    332333
    333334void caca_draw_bitmap(int x1, int y1, int x2, int y2,
    334                       const struct caca_bitmap *bitmap, char *pixels)
     335                      const struct caca_bitmap *bitmap, void *pixels)
    335336{
    336337#if !NEW_RENDERER
  • libcaca/trunk/src/caca.c

    r246 r247  
    5151static void caca_init_terminal(void);
    5252
    53 char *_caca_empty_line;
    54 char *_caca_scratch_line;
    55 
    5653#if defined(USE_NCURSES)
    5754static mmask_t oldmask;
    58 int _caca_attr[16*16];
    59 #endif
    60 
    61 #if defined(USE_CONIO)
    62 char *_caca_screen;
    6355#endif
    6456
  • libcaca/trunk/src/caca.h

    r246 r247  
    213213 */
    214214struct caca_bitmap;
    215 struct caca_bitmap *caca_create_bitmap(int, int, int, int, int, int, int, int);
     215struct caca_bitmap *caca_create_bitmap(unsigned int, unsigned int,
     216                                       unsigned int, unsigned int,
     217                                       unsigned int, unsigned int,
     218                                       unsigned int, unsigned int);
    216219void caca_set_bitmap_palette(struct caca_bitmap *, unsigned int[],
    217220                             unsigned int[], unsigned int[], unsigned int[]);
    218 void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, char *);
     221void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *);
    219222void caca_free_bitmap(struct caca_bitmap *);
    220223
  • libcaca/trunk/src/caca_internals.h

    r246 r247  
    3333extern int _caca_init_graphics(void);
    3434
    35 #if defined(USE_NCURSES)
    36 extern int _caca_attr[];
    37 #endif
    38 
    39 #if defined(USE_CONIO)
    40 extern struct text_info _ti;
    41 extern char *_caca_screen;
    42 #endif
    43 
    4435extern unsigned int _caca_width;
    4536extern unsigned int _caca_height;
    4637
    47 extern char *_caca_empty_line;
    48 extern char *_caca_scratch_line;
    49 
    5038#endif /* __CACA_INTERNALS_H__ */
  • libcaca/trunk/src/graphics.c

    r246 r247  
    5858#include "caca_internals.h"
    5959
    60 #ifdef USE_CONIO
    61 static struct text_info ti;
    62 #endif
    63 
     60/*
     61 * Global variables
     62 */
    6463unsigned int _caca_width;
    6564unsigned int _caca_height;
     65
     66/*
     67 * Local variables
     68 */
     69#if defined(USE_NCURSES)
     70static int _caca_attr[16*16];
     71#endif
     72
     73#if defined(USE_CONIO)
     74static struct text_info ti;
     75static char *_caca_screen;
     76#endif
     77
     78static char *_caca_empty_line;
     79static char *_caca_scratch_line;
    6680
    6781static unsigned int _caca_delay;
Note: See TracChangeset for help on using the changeset viewer.