Revision 321
correcting some problems
graph.c | ||
---|---|---|
287 | 287 |
uint16_t w, h; |
288 | 288 |
int16_t u0, v0; |
289 | 289 |
}; |
290 |
basic_sprite_t* (basic_sprite_ctor)(const char **xpm, int16_t u0, int16_t v0){ |
|
290 |
basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0){
|
|
291 | 291 |
basic_sprite_t *ret = malloc(sizeof(basic_sprite_t)); |
292 | 292 |
if(ret == NULL) return NULL; |
293 | 293 |
enum xpm_image_type type = XPM_8_8_8_8; |
... | ... | |
358 | 358 |
const basic_sprite_t *bsp; |
359 | 359 |
int16_t x, y; //position in screen |
360 | 360 |
int16_t su0, sv0; |
361 |
float theta, s, c;
|
|
362 |
float scale;
|
|
361 |
double theta, s, c;
|
|
362 |
double scale;
|
|
363 | 363 |
uint8_t *sbuf; |
364 | 364 |
}; |
365 | 365 |
sprite_t* (sprite_ctor)(const basic_sprite_t *bsp){ |
... | ... | |
410 | 410 |
*u = x - p->x + p->su0; |
411 | 411 |
*v = y - p->y + p->sv0; |
412 | 412 |
}else{ |
413 |
float dx = x - p->x;
|
|
414 |
float dy = y - p->y;
|
|
413 |
double dx = x - p->x;
|
|
414 |
double dy = y - p->y;
|
|
415 | 415 |
int16_t du = dx*p->c - dy*p->s - 0.5f; |
416 | 416 |
int16_t dv = dx*p->s + dy*p->c - 0.5f; |
417 | 417 |
*u = du + p->su0; |
Also available in: Unified diff