Ver código fonte

* Got rid of useless parameters in cucul_*_bitmap and cucul_*_sprite.

tags/v0.99.beta14
Sam Hocevar sam 18 anos atrás
pai
commit
dcaccc744c
11 arquivos alterados com 25 adições e 24 exclusões
  1. +3
    -3
      cucul/bitmap.c
  2. +7
    -6
      cucul/cucul.h
  3. +1
    -1
      cucul/sprite.c
  4. +1
    -1
      src/aafire.c
  5. +2
    -2
      src/cacaball.c
  6. +2
    -2
      src/cacamoir.c
  7. +2
    -2
      src/cacaplas.c
  8. +2
    -2
      src/cacaview.c
  9. +3
    -3
      test/demo.c
  10. +1
    -1
      test/export.c
  11. +1
    -1
      test/hsv.c

+ 3
- 3
cucul/bitmap.c Ver arquivo

@@ -264,7 +264,7 @@ struct cucul_bitmap *cucul_create_bitmap(cucul_t *qq,
* \param blue Array of 256 blue values.
* \param alpha Array of 256 alpha values.
*/
void cucul_set_bitmap_palette(cucul_t *qq, struct cucul_bitmap *bitmap,
void cucul_set_bitmap_palette(struct cucul_bitmap *bitmap,
unsigned int red[], unsigned int green[],
unsigned int blue[], unsigned int alpha[])
{
@@ -302,7 +302,7 @@ void cucul_set_bitmap_palette(cucul_t *qq, struct cucul_bitmap *bitmap,
* \param bitmap Bitmap object.
* \param gamma Gamma value.
*/
void cucul_set_bitmap_gamma(cucul_t *qq, struct cucul_bitmap *bitmap, float gamma)
void cucul_set_bitmap_gamma(struct cucul_bitmap *bitmap, float gamma)
{
int i;

@@ -322,7 +322,7 @@ void cucul_set_bitmap_gamma(cucul_t *qq, struct cucul_bitmap *bitmap, float gamm
*
* \param bitmap Bitmap object.
*/
void cucul_free_bitmap(cucul_t *qq, struct cucul_bitmap *bitmap)
void cucul_free_bitmap(struct cucul_bitmap *bitmap)
{
if(!bitmap)
return;


+ 7
- 6
cucul/cucul.h Ver arquivo

@@ -192,7 +192,8 @@ int cucul_get_sprite_width(cucul_t *, struct cucul_sprite const *, int);
int cucul_get_sprite_height(cucul_t *, struct cucul_sprite const *, int);
int cucul_get_sprite_dx(cucul_t *, struct cucul_sprite const *, int);
int cucul_get_sprite_dy(cucul_t *, struct cucul_sprite const *, int);
void cucul_draw_sprite(cucul_t *, int, int, struct cucul_sprite const *, int);void cucul_free_sprite(cucul_t *, struct cucul_sprite *);
void cucul_draw_sprite(cucul_t *, int, int, struct cucul_sprite const *, int);
void cucul_free_sprite(struct cucul_sprite *);
/* @} */

/** \defgroup bitmap Bitmap handling
@@ -206,12 +207,12 @@ struct cucul_bitmap *cucul_create_bitmap(cucul_t *, unsigned int, unsigned int,
unsigned int, unsigned int,
unsigned int, unsigned int,
unsigned int, unsigned int);
void cucul_set_bitmap_palette(cucul_t *, struct cucul_bitmap *,
unsigned int r[], unsigned int g[],
unsigned int b[], unsigned int a[]);
void cucul_set_bitmap_gamma(cucul_t *, struct cucul_bitmap *, float);
void cucul_set_bitmap_palette(struct cucul_bitmap *,
unsigned int r[], unsigned int g[],
unsigned int b[], unsigned int a[]);
void cucul_set_bitmap_gamma(struct cucul_bitmap *, float);
void cucul_draw_bitmap(cucul_t *, int, int, int, int, struct cucul_bitmap const *, void *);
void cucul_free_bitmap(cucul_t *, struct cucul_bitmap *);
void cucul_free_bitmap(struct cucul_bitmap *);
/* @} */

/** \defgroup exporter Exporters to various formats


+ 1
- 1
cucul/sprite.c Ver arquivo

@@ -301,7 +301,7 @@ void cucul_draw_sprite(cucul_t *qq, int x, int y, struct cucul_sprite const *spr
* \param sprite The sprite to be freed.
* \return void
*/
void cucul_free_sprite(cucul_t *qq, struct cucul_sprite *sprite)
void cucul_free_sprite(struct cucul_sprite *sprite)
{
int i;



+ 1
- 1
src/aafire.c Ver arquivo

@@ -141,7 +141,7 @@ initialize (void)

#ifdef LIBCACA
cucul_bitmap = cucul_create_bitmap(qq, 8, XSIZ, YSIZ - 2, XSIZ, 0, 0, 0, 0);
cucul_set_bitmap_palette(qq, 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));
memset(bitmap, 0, 4 * cucul_get_width(qq) * cucul_get_height(qq));
#else


+ 2
- 2
src/cacaball.c Ver arquivo

@@ -123,7 +123,7 @@ int main(int argc, char **argv)
}

/* Set the palette */
cucul_set_bitmap_palette(qq, cucul_bitmap, r, g, b, a);
cucul_set_bitmap_palette(cucul_bitmap, r, g, b, a);

/* Silly paths for our balls */
for(p = 0; p < METABALLS; p++)
@@ -157,7 +157,7 @@ paused:

/* End, bye folks */
end:
cucul_free_bitmap(qq, cucul_bitmap);
cucul_free_bitmap(cucul_bitmap);
caca_detach(kk);
cucul_end(qq);



+ 2
- 2
src/cacamoir.c Ver arquivo

@@ -88,7 +88,7 @@ int main (int argc, char **argv)
green[1] = 0.5 * (1 + cos(0.06 * frame + 5.0)) * 0xfff;
blue[1] = 0.5 * (1 + cos(0.05 * frame + 5.0)) * 0xfff;

cucul_set_bitmap_palette(qq, bitmap, red, green, blue, alpha);
cucul_set_bitmap_palette(bitmap, red, green, blue, alpha);

/* Draw circles */
x = cos(0.07 * frame + 5.0) * 128.0 + (XSIZ / 2);
@@ -109,7 +109,7 @@ paused:
}

end:
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);
caca_detach(kk);
cucul_end(qq);



+ 2
- 2
src/cacaplas.c Ver arquivo

@@ -99,7 +99,7 @@ int main (int argc, char **argv)
}

/* Set the palette */
cucul_set_bitmap_palette(qq, bitmap, red, green, blue, alpha);
cucul_set_bitmap_palette(bitmap, red, green, blue, alpha);

do_plasma(screen,
(1.0 + sin(((double)frame) * R[0])) / 2,
@@ -121,7 +121,7 @@ paused:
}

end:
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);
caca_detach(kk);
cucul_end(qq);



+ 2
- 2
src/cacaview.c Ver arquivo

@@ -487,7 +487,7 @@ static void unload_image(void)
pixels = NULL;
#endif
if(bitmap)
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);
bitmap = NULL;
}

@@ -690,7 +690,7 @@ static void load_image(char const *name)
}

if(bpp == 8)
cucul_set_bitmap_palette(qq, bitmap, red, green, blue, alpha);
cucul_set_bitmap_palette(bitmap, red, green, blue, alpha);
#endif
}



+ 3
- 3
test/demo.c Ver arquivo

@@ -173,7 +173,7 @@ int main(int argc, char **argv)
}

/* Clean up */
cucul_free_sprite(qq, sprite);
cucul_free_sprite(sprite);
caca_detach(kk);
cucul_end(qq);

@@ -495,7 +495,7 @@ static void demo_render(void)
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, buffer);
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);
}
#endif

@@ -538,7 +538,7 @@ static void demo_render(void)

bitmap = cucul_create_bitmap(qq, 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_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);
}

static void draw_circle(int *buffer, int x, int y, int r, int mask, int val)


+ 1
- 1
test/export.c Ver arquivo

@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
cucul_draw_bitmap(qq, 0, 0,
cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,
bitmap, pixels);
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);

cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
cucul_draw_thin_box(qq, 0, 0, WIDTH - 1, HEIGHT - 1);


+ 1
- 1
test/hsv.c Ver arquivo

@@ -48,7 +48,7 @@ int main(void)
cucul_draw_bitmap(qq, 0, 0,
cucul_get_width(qq) - 1, cucul_get_height(qq) - 1,
bitmap, buffer);
cucul_free_bitmap(qq, bitmap);
cucul_free_bitmap(bitmap);

caca_display(kk);



Carregando…
Cancelar
Salvar