Changeset 1026


Ignore:
Timestamp:
Sep 16, 2006, 2:57:41 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Ahaha old pig, you could have factored the 1.0 + as well, and you forgot to cast the int to double in the sin() call. (:@ gruik!
File:
1 edited

Legend:

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

    r1025 r1026  
    223223    int p, frame = 0, pause = 0;
    224224    double frameOffset[360 + 80];
    225     double frameOffset40[360];
    226     double frameOffset80[360];
    227225
    228226    cv = cucul_create_canvas(0, 0);
     
    256254    }
    257255
    258     for(frame = 0; frame < 360; frame++) {
    259         frameOffset[frame] = sin(frame * M_PI / 60);
    260         frameOffset40[frame] = sin((frame + 40) * M_PI / 60);
    261         frameOffset80[frame] = sin((frame + 80) * M_PI / 60);
    262     }
     256    for(frame = 0; frame < 360 + 80; frame++)
     257        frameOffset[frame] = 1.0 + sin((double)(frame * M_PI / 60));
    263258
    264259    /* Go ! */
     
    286281        {
    287282            int t1, t2, t3;
    288             double c1 = 1.0 + (double)frameOffset[frame];
    289             double c2 = 1.0 + (double)frameOffset40[frame];
    290             double c3 = 1.0 + (double)frameOffset80[frame];
     283            double c1 = frameOffset[frame];
     284            double c2 = frameOffset[frame+40];
     285            double c3 = frameOffset[frame+80];
    291286
    292287            t1 = p < 0x40 ? 0 : p < 0xc0 ? (p - 0x40) * 0x20 : 0xfff;
Note: See TracChangeset for help on using the changeset viewer.