Ignore:
Timestamp:
Sep 17, 2006, 2:48:30 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • More cleanup in cacademo.c.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/cacademo.c

    r1041 r1042  
    3232enum action { PREPARE, INIT, UPDATE, RENDER, FREE };
    3333
    34 void transition(cucul_canvas_t *mask, int tmode, float time);
     34void transition(cucul_canvas_t *, int, int);
    3535void plasma(enum action, cucul_canvas_t *);
    3636void metaballs(enum action, cucul_canvas_t *);
     
    169169            cucul_set_color(mask, CUCUL_COLOR_WHITE, CUCUL_COLOR_WHITE);
    170170            transition(mask, tmode,
    171                           (float)(frame - next_transition) / TRANSITION_FRAMES * 3.0f / 4.0f);
     171                       100 * (frame - next_transition) / TRANSITION_FRAMES);
    172172            cucul_blit(frontcv, 0, 0, backcv, mask);
    173173        }
     
    193193
    194194/* Transitions */
    195 void transition(cucul_canvas_t *mask, int tmode, float time)
     195void transition(cucul_canvas_t *mask, int tmode, int completed)
    196196{
    197197    static float const star[] =
     
    210210    static float star_rot[sizeof(star)/sizeof(*star)];
    211211
    212     float mulx = time * cucul_get_canvas_width(mask);
    213     float muly = time * cucul_get_canvas_height(mask);
     212    float mulx = 0.0075f * completed * cucul_get_canvas_width(mask);
     213    float muly = 0.0075f * completed * cucul_get_canvas_height(mask);
    214214    int w2 = cucul_get_canvas_width(mask) / 2;
    215215    int h2 = cucul_get_canvas_height(mask) / 2;
    216     float angle = (time*360)*3.14/180, x,y;
     216    float angle = (0.0075f * completed * 360) * 3.14 / 180, x, y;
    217217    unsigned int i;
    218218
Note: See TracChangeset for help on using the changeset viewer.