소스 검색

* src/caca.c:

+ Moved global variables to src/graphics.c.
  * src/bitmap.c:
    + Sanitised prototypes.
tags/v0.99.beta14
Sam Hocevar sam 21 년 전
부모
커밋
fa7365ef67
6개의 변경된 파일29개의 추가작업 그리고 31개의 파일을 삭제
  1. +1
    -1
      src/Makefile.am
  2. +6
    -5
      src/bitmap.c
  3. +0
    -8
      src/caca.c
  4. +5
    -2
      src/caca.h
  5. +0
    -12
      src/caca_internals.h
  6. +17
    -3
      src/graphics.c

+ 1
- 1
src/Makefile.am 파일 보기

@@ -24,5 +24,5 @@ if NEED_PIC
libcaca_pic_a = libcaca_pic.a
endif
libcaca_pic_a_SOURCES = $(libcaca_a_SOURCES)
libcaca_pic_a_CPPFLAGS = -fPIC
libcaca_pic_a_CPPFLAGS = -fPIC -DPIC


+ 6
- 5
src/bitmap.c 파일 보기

@@ -160,13 +160,14 @@ static void mask2shift(unsigned int mask, int *right, int *left)
*left = 12 - lshift;
}

struct caca_bitmap *caca_create_bitmap(int bpp, int w, int h, int pitch,
int rmask, int gmask, int bmask,
int amask)
struct caca_bitmap *caca_create_bitmap(unsigned int bpp, unsigned int w,
unsigned int h, unsigned int pitch,
unsigned int rmask, unsigned int gmask,
unsigned int bmask, unsigned int amask)
{
struct caca_bitmap *bitmap;

/* Currently only this format is supported. Will improve later. */
/* Minor sanity test */
if(!w || !h || !pitch || bpp > 32 || bpp < 8)
return NULL;

@@ -331,7 +332,7 @@ static void rgb2hsv_default(int r, int g, int b, int *hue, int *sat, int *val)
}

void caca_draw_bitmap(int x1, int y1, int x2, int y2,
const struct caca_bitmap *bitmap, char *pixels)
const struct caca_bitmap *bitmap, void *pixels)
{
#if !NEW_RENDERER
static const int white_colors[] =


+ 0
- 8
src/caca.c 파일 보기

@@ -50,16 +50,8 @@

static void caca_init_terminal(void);

char *_caca_empty_line;
char *_caca_scratch_line;

#if defined(USE_NCURSES)
static mmask_t oldmask;
int _caca_attr[16*16];
#endif

#if defined(USE_CONIO)
char *_caca_screen;
#endif

int caca_init(void)


+ 5
- 2
src/caca.h 파일 보기

@@ -212,10 +212,13 @@ void caca_free_sprite(struct caca_sprite *);
* Bitmap handling
*/
struct caca_bitmap;
struct caca_bitmap *caca_create_bitmap(int, int, int, int, int, int, int, int);
struct caca_bitmap *caca_create_bitmap(unsigned int, unsigned int,
unsigned int, unsigned int,
unsigned int, unsigned int,
unsigned int, unsigned int);
void caca_set_bitmap_palette(struct caca_bitmap *, unsigned int[],
unsigned int[], unsigned int[], unsigned int[]);
void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, char *);
void caca_draw_bitmap(int, int, int, int, const struct caca_bitmap *, void *);
void caca_free_bitmap(struct caca_bitmap *);

#ifdef __cplusplus


+ 0
- 12
src/caca_internals.h 파일 보기

@@ -32,19 +32,7 @@

extern int _caca_init_graphics(void);

#if defined(USE_NCURSES)
extern int _caca_attr[];
#endif

#if defined(USE_CONIO)
extern struct text_info _ti;
extern char *_caca_screen;
#endif

extern unsigned int _caca_width;
extern unsigned int _caca_height;

extern char *_caca_empty_line;
extern char *_caca_scratch_line;

#endif /* __CACA_INTERNALS_H__ */

+ 17
- 3
src/graphics.c 파일 보기

@@ -57,12 +57,26 @@
#include "caca.h"
#include "caca_internals.h"

#ifdef USE_CONIO
/*
* Global variables
*/
unsigned int _caca_width;
unsigned int _caca_height;

/*
* Local variables
*/
#if defined(USE_NCURSES)
static int _caca_attr[16*16];
#endif

#if defined(USE_CONIO)
static struct text_info ti;
static char *_caca_screen;
#endif

unsigned int _caca_width;
unsigned int _caca_height;
static char *_caca_empty_line;
static char *_caca_scratch_line;

static unsigned int _caca_delay;
static unsigned int _caca_rendertime;


불러오는 중...
취소
저장