@@ -258,11 +258,10 @@ static float gammapow(float x, float y) | |||||
* \param amask Bitmask for alpha values. | * \param amask Bitmask for alpha values. | ||||
* \return Bitmap object, or NULL upon error. | * \return Bitmap object, or NULL upon error. | ||||
*/ | */ | ||||
struct cucul_bitmap *cucul_create_bitmap(cucul_t *qq, | |||||
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 cucul_bitmap *cucul_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 cucul_bitmap *bitmap; | struct cucul_bitmap *bitmap; | ||||
int i; | int i; | ||||
@@ -202,10 +202,10 @@ void cucul_free_sprite(struct cucul_sprite *); | |||||
* | * | ||||
* @{ */ | * @{ */ | ||||
struct cucul_bitmap; | struct cucul_bitmap; | ||||
struct cucul_bitmap *cucul_create_bitmap(cucul_t *, unsigned int, unsigned int, | |||||
unsigned int, unsigned int, | |||||
unsigned int, unsigned int, | |||||
unsigned int, unsigned int); | |||||
struct cucul_bitmap *cucul_create_bitmap(unsigned int, unsigned int, | |||||
unsigned int, unsigned int, | |||||
unsigned int, unsigned int, | |||||
unsigned int, unsigned int); | |||||
void cucul_set_bitmap_palette(struct cucul_bitmap *, | void cucul_set_bitmap_palette(struct cucul_bitmap *, | ||||
unsigned int r[], unsigned int g[], | unsigned int r[], unsigned int g[], | ||||
unsigned int b[], unsigned int a[]); | unsigned int b[], unsigned int a[]); | ||||
@@ -140,7 +140,7 @@ initialize (void) | |||||
#endif | #endif | ||||
#ifdef LIBCACA | #ifdef LIBCACA | ||||
cucul_bitmap = cucul_create_bitmap(qq, 8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0); | |||||
cucul_bitmap = cucul_create_bitmap(8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0); | |||||
cucul_set_bitmap_palette(cucul_bitmap, r, g, b, a); | cucul_set_bitmap_palette(cucul_bitmap, r, g, b, a); | ||||
bitmap = malloc(4 * cucul_get_width(qq) * cucul_get_height(qq) * sizeof(char)); | bitmap = malloc(4 * cucul_get_width(qq) * cucul_get_height(qq) * sizeof(char)); | ||||
memset(bitmap, 0, 4 * cucul_get_width(qq) * cucul_get_height(qq)); | memset(bitmap, 0, 4 * cucul_get_width(qq) * cucul_get_height(qq)); | ||||
@@ -69,7 +69,7 @@ int main(int argc, char **argv) | |||||
/* Create a libcucul bitmap smaller than our pixel buffer, so that we | /* Create a libcucul bitmap smaller than our pixel buffer, so that we | ||||
* display only the interesting part of it */ | * display only the interesting part of it */ | ||||
cucul_bitmap = cucul_create_bitmap(qq, 8, XSIZ - METASIZE, YSIZ - METASIZE, | |||||
cucul_bitmap = cucul_create_bitmap(8, XSIZ - METASIZE, YSIZ - METASIZE, | |||||
XSIZ, 0, 0, 0, 0); | XSIZ, 0, 0, 0, 0); | ||||
/* Generate ball sprite */ | /* Generate ball sprite */ | ||||
@@ -63,7 +63,7 @@ int main (int argc, char **argv) | |||||
draw_disc(i, (i / DISCTHICKNESS) % 2); | draw_disc(i, (i / DISCTHICKNESS) % 2); | ||||
/* Create a libcucul bitmap */ | /* Create a libcucul bitmap */ | ||||
bitmap = cucul_create_bitmap(qq, 8, XSIZ, YSIZ, XSIZ, 0, 0, 0, 0); | |||||
bitmap = cucul_create_bitmap(8, XSIZ, YSIZ, XSIZ, 0, 0, 0, 0); | |||||
/* Main loop */ | /* Main loop */ | ||||
for(;;) | for(;;) | ||||
@@ -75,7 +75,7 @@ int main (int argc, char **argv) | |||||
} | } | ||||
/* Create a libcucul bitmap */ | /* Create a libcucul bitmap */ | ||||
bitmap = cucul_create_bitmap(qq, 8, XSIZ, YSIZ, XSIZ, 0, 0, 0, 0); | |||||
bitmap = cucul_create_bitmap(8, XSIZ, YSIZ, XSIZ, 0, 0, 0, 0); | |||||
/* Main loop */ | /* Main loop */ | ||||
for(;;) | for(;;) | ||||
@@ -545,7 +545,7 @@ static void load_image(char const *name) | |||||
depth = 4; | depth = 4; | ||||
/* Create the libcucul bitmap */ | /* Create the libcucul bitmap */ | ||||
bitmap = cucul_create_bitmap(qq, bpp, w, h, depth * w, | |||||
bitmap = cucul_create_bitmap(bpp, w, h, depth * w, | |||||
rmask, gmask, bmask, amask); | rmask, gmask, bmask, amask); | ||||
if(!bitmap) | if(!bitmap) | ||||
{ | { | ||||
@@ -712,8 +712,8 @@ static void load_image(char const *name) | |||||
fclose(fp); | fclose(fp); | ||||
/* Create the libcaca bitmap */ | |||||
bitmap = cucul_create_bitmap(qq, bpp, w, h, depth * w, | |||||
/* Create the libcucul bitmap */ | |||||
bitmap = cucul_create_bitmap(bpp, w, h, depth * w, | |||||
rmask, gmask, bmask, amask); | rmask, gmask, bmask, amask); | ||||
if(!bitmap) | if(!bitmap) | ||||
{ | { | ||||
@@ -536,7 +536,7 @@ static void demo_render(void) | |||||
for(z = 0; z < 240; z++) | for(z = 0; z < 240; z++) | ||||
draw_circle(buffer, xo, yo, z, 0x000000ff, 200); | draw_circle(buffer, xo, yo, z, 0x000000ff, 200); | ||||
bitmap = cucul_create_bitmap(qq, 32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); | |||||
bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); | |||||
cucul_draw_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, bitmap, (char *)buffer); | cucul_draw_bitmap(qq, 0, 0, cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, bitmap, (char *)buffer); | ||||
cucul_free_bitmap(bitmap); | cucul_free_bitmap(bitmap); | ||||
} | } | ||||
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) | |||||
} | } | ||||
} | } | ||||
bitmap = cucul_create_bitmap(qq, 32, 256, 256, 4 * 256, | |||||
bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, | |||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | ||||
cucul_draw_bitmap(qq, 0, 0, | cucul_draw_bitmap(qq, 0, 0, | ||||
cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, | cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, | ||||
@@ -45,9 +45,9 @@ int main(void) | |||||
buffer[x + 768] = (x << 16) | (0x00 << 8) | (0xff << 0); | buffer[x + 768] = (x << 16) | (0x00 << 8) | (0xff << 0); | ||||
} | } | ||||
left = cucul_create_bitmap(qq, 32, 256, 4, 4 * 256, | |||||
left = cucul_create_bitmap(32, 256, 4, 4 * 256, | |||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | ||||
right = cucul_create_bitmap(qq, 32, 256, 4, 4 * 256, | |||||
right = cucul_create_bitmap(32, 256, 4, 4 * 256, | |||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | ||||
caca_set_delay(kk, 20000); | caca_set_delay(kk, 20000); | ||||
@@ -43,7 +43,7 @@ int main(void) | |||||
buffer[y * 256 + x] = ((y * x / 256) << 16) | ((y * x / 256) << 8) | (x<< 0); | buffer[y * 256 + x] = ((y * x / 256) << 16) | ((y * x / 256) << 8) | (x<< 0); | ||||
} | } | ||||
bitmap = cucul_create_bitmap(qq, 32, 256, 256, 4 * 256, | |||||
bitmap = cucul_create_bitmap(32, 256, 256, 4 * 256, | |||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | ||||
cucul_draw_bitmap(qq, 0, 0, | cucul_draw_bitmap(qq, 0, 0, | ||||
cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, | cucul_get_width(qq) - 1, cucul_get_height(qq) - 1, | ||||