Revision 174
refactored graph
proj.c | ||
---|---|---|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
#ifdef DIOGO |
66 |
printf("%d\n", 1000000-(int)(1000000*fm_sin(0.5*M_PI))); |
|
67 |
printf("%d\n", (int)(1000000*fm_cos(0.5*M_PI))); |
|
68 |
|
|
66 |
//printf("%d\n", 1000000-(int)(1000000*fm_sin(0.5*M_PI)));
|
|
67 |
//printf("%d\n", (int)(1000000*fm_cos(0.5*M_PI)));
|
|
68 |
/* |
|
69 | 69 |
clock_t t = clock(); |
70 | 70 |
sprite_t *shooter1 = get_shooter(); sprite_set_pos(shooter1, 100, 100); |
71 | 71 |
for(double angle = 0; angle <= 6.283185; angle += 0.006283185){ |
72 | 72 |
sprite_set_angle(shooter1, angle); |
73 |
//graph_paint_screen(0x777777); |
|
74 | 73 |
graph_clear_screen(); |
75 | 74 |
sprite_draw(shooter1); |
76 | 75 |
graph_draw(); |
77 | 76 |
} |
78 |
t = clock() - t; //printf("%d\n", CLOCKS_PER_SEC); |
|
79 |
//double dt = ((double)t)/(double)CLOCKS_PER_SEC; |
|
77 |
t = clock() - t; |
|
80 | 78 |
printf("Time taken: %d/%d \n", t, CLOCKS_PER_SEC); |
81 | 79 |
sprite_dtor(shooter1); |
80 |
*/ |
|
82 | 81 |
#endif |
83 | 82 |
|
84 | 83 |
#ifdef TELMO |
85 |
sprite_t *crosshair = get_crosshair(); |
|
86 |
graph_clear_screen(); |
|
87 |
sprite_draw(crosshair); |
|
88 |
graph_draw(); |
|
84 |
sprite_t *crosshair = get_crosshair();
|
|
85 |
graph_clear_screen();
|
|
86 |
sprite_draw(crosshair);
|
|
87 |
graph_draw();
|
|
89 | 88 |
#endif |
90 | 89 |
|
91 | 90 |
/// loop stuff |
... | ... | |
132 | 131 |
} else { /* received standart message, not a notification */ |
133 | 132 |
/* no standart message expected: do nothing */ |
134 | 133 |
} |
135 |
|
|
136 |
switch (get_hor_movement()) { |
|
137 |
case LEFT: |
|
138 |
printf("GOING LEFT.\n"); |
|
139 |
break; |
|
140 |
case RIGHT: |
|
141 |
printf("GOING RIGHT.\n"); |
|
142 |
break; |
|
143 |
} |
|
144 |
switch (get_ver_movement()) { |
|
145 |
case UP: |
|
146 |
printf("GOING UP.\n"); |
|
147 |
break; |
|
148 |
case DOWN: |
|
149 |
printf("GOING DOWN.\n"); |
|
150 |
break; |
|
151 |
} |
|
134 |
#ifdef TELMO |
|
135 |
switch (get_hor_movement()) { |
|
136 |
case LEFT: |
|
137 |
printf("GOING LEFT.\n"); |
|
138 |
break; |
|
139 |
case RIGHT: |
|
140 |
printf("GOING RIGHT.\n"); |
|
141 |
break; |
|
142 |
} |
|
143 |
switch (get_ver_movement()) { |
|
144 |
case UP: |
|
145 |
printf("GOING UP.\n"); |
|
146 |
break; |
|
147 |
case DOWN: |
|
148 |
printf("GOING DOWN.\n"); |
|
149 |
break; |
|
150 |
} |
|
151 |
#endif |
|
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
// Unsubscribe interrupts |
Also available in: Unified diff