Revision 168
stuff changed
proj.c | ||
---|---|---|
22 | 22 |
#include "interrupts_func.h" |
23 | 23 |
#include "proj_func.h" |
24 | 24 |
|
25 |
#include "fast_math.h" |
|
26 |
#include <math.h> |
|
27 |
|
|
25 | 28 |
#ifdef DIOGO |
26 | 29 |
#include "shooter.h" |
27 | 30 |
#include "pistol.xpm" |
... | ... | |
50 | 53 |
} |
51 | 54 |
|
52 | 55 |
#ifdef DIOGO |
53 |
graph_paint_screen(0x777777); |
|
56 |
printf("%d\n", 1000000-(int)(1000000*fm_sin(0.5*M_PI))); |
|
57 |
printf("%d\n", (int)(1000000*fm_cos(0.5*M_PI))); |
|
58 |
|
|
59 |
clock_t t = clock(); |
|
54 | 60 |
sprite_t *shooter1 = get_shooter(); sprite_set_pos(shooter1, 100, 100); |
55 |
for(double angle = 0; angle < 6.29; angle += 0.01){
|
|
61 |
for(double angle = 0; angle <= 6.283185; angle += 0.006283185){
|
|
56 | 62 |
sprite_set_angle(shooter1, angle); |
57 |
//paint_screen(0x777777); |
|
63 |
//graph_paint_screen(0x777777); |
|
64 |
graph_clear_screen(); |
|
58 | 65 |
sprite_draw(shooter1); |
59 |
tickdelay(micros_to_ticks(10000));
|
|
66 |
graph_draw();
|
|
60 | 67 |
} |
68 |
t = clock() - t; //printf("%d\n", CLOCKS_PER_SEC); |
|
69 |
//double dt = ((double)t)/(double)CLOCKS_PER_SEC; |
|
70 |
printf("Time taken: %d/%d \n", t, CLOCKS_PER_SEC); |
|
61 | 71 |
sprite_dtor(shooter1); |
62 |
graph_draw(); |
|
63 | 72 |
#endif |
64 | 73 |
|
65 | 74 |
/// loop stuff |
... | ... | |
75 | 84 |
|
76 | 85 |
/// cycle |
77 | 86 |
int good = 1; |
87 |
|
|
88 |
#ifdef DIOGO |
|
89 |
good = 0; |
|
90 |
#endif |
|
91 |
|
|
78 | 92 |
while (good) { |
79 | 93 |
/* Get a request message. */ |
80 | 94 |
if ((r = driver_receive(ANY, &msg, &ipc_status)) != 0) { |
Also available in: Unified diff