Procházet zdrojové kódy

* Fixed sprite functions (it compiles now) (Y'a des connards qui font ce qu'ils veulent, mais qui finissent pas)

tags/v0.99.beta14
Jean-Yves Lamoureux jylam před 19 roky
rodič
revize
a4de38b97e
2 změnil soubory, kde provedl 11 přidání a 11 odebrání
  1. +3
    -3
      test/demo.c
  2. +8
    -8
      test/spritedit.c

+ 3
- 3
test/demo.c Zobrazit soubor

@@ -55,11 +55,11 @@ int main(int argc, char **argv)
caca_set_delay(kk, 40000);

/* Initialize data */
sprite = cucul_load_sprite(qq, DATADIR "/caca.txt");
sprite = cucul_load_sprite(DATADIR "/caca.txt");
if(!sprite)
sprite = cucul_load_sprite(qq, "caca.txt");
sprite = cucul_load_sprite("caca.txt");
if(!sprite)
sprite = cucul_load_sprite(qq, "examples/caca.txt");
sprite = cucul_load_sprite("examples/caca.txt");

/* Disable cursor */
caca_set_mouse(kk, 0);


+ 8
- 8
test/spritedit.c Zobrazit soubor

@@ -44,7 +44,7 @@ int main(int argc, char **argv)
if(!kk)
return 1;

sprite = cucul_load_sprite(qq, argv[1]);
sprite = cucul_load_sprite(argv[1]);

if(!sprite)
{
@@ -75,7 +75,7 @@ int main(int argc, char **argv)
frame--;
break;
case '+':
if(frame < cucul_get_sprite_frames(qq, sprite) - 1)
if(frame < cucul_get_sprite_frames(sprite) - 1)
frame++;
break;
case 'p':
@@ -86,7 +86,7 @@ int main(int argc, char **argv)

if(play) {
if(!delay) {
if(frame < cucul_get_sprite_frames(qq, sprite) - 1) {
if(frame < cucul_get_sprite_frames(sprite) - 1) {
frame++;
}
else {
@@ -109,7 +109,7 @@ int main(int argc, char **argv)

sprintf(buf, "sprite `%s'", argv[1]);
cucul_putstr(qq, 3, 2, buf);
sprintf(buf, "frame %i/%i", frame, cucul_get_sprite_frames(qq, sprite) - 1);
sprintf(buf, "frame %i/%i", frame, cucul_get_sprite_frames(sprite) - 1);
cucul_putstr(qq, 3, 3, buf);

/* Crosshair */
@@ -118,10 +118,10 @@ int main(int argc, char **argv)
cucul_putchar(qq, 57, 10, '+');

/* Boxed sprite */
xa = -1 - cucul_get_sprite_dx(qq, sprite, frame);
ya = -1 - cucul_get_sprite_dy(qq, sprite, frame);
xb = xa + 1 + cucul_get_sprite_width(qq, sprite, frame);
yb = ya + 1 + cucul_get_sprite_height(qq, sprite, frame);
xa = -1 - cucul_get_sprite_dx(sprite, frame);
ya = -1 - cucul_get_sprite_dy(sprite, frame);
xb = xa + 1 + cucul_get_sprite_width(sprite, frame);
yb = ya + 1 + cucul_get_sprite_height(sprite, frame);
cucul_set_color(qq, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
cucul_fill_box(qq, 57 + xa, 10 + ya, 57 + xb, 10 + yb, " ");
cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);


Načítá se…
Zrušit
Uložit