Revision 168
stuff changed
sprite.c | ||
---|---|---|
4 | 4 |
|
5 | 5 |
#include "graph.h" |
6 | 6 |
#include "utils.h" |
7 |
#include "fast_math.h" |
|
7 | 8 |
#include <math.h> |
8 | 9 |
|
9 | 10 |
struct sprite{ |
10 | 11 |
int16_t x, y; |
11 | 12 |
uint16_t w, h; |
12 | 13 |
int16_t u0, v0; |
13 |
double theta;
|
|
14 |
float theta;
|
|
14 | 15 |
uint8_t *map; |
15 | 16 |
}; |
16 | 17 |
|
... | ... | |
53 | 54 |
void (sprite_src2pic)(const sprite_t *p, int16_t x, int16_t y, int16_t *u, int16_t *v){ |
54 | 55 |
int16_t dx = x - p->x; |
55 | 56 |
int16_t dy = y - p->y; |
56 |
double s = sin(p->theta); |
|
57 |
double c = cos(p->theta); |
|
57 |
double s = fm_sin(p->theta);
|
|
58 |
double c = fm_cos(p->theta);
|
|
58 | 59 |
*u = dx*c - dy*s + p->u0; |
59 | 60 |
*v = dx*s + dy*c + p->v0; |
60 | 61 |
} |
Also available in: Unified diff