Revision 335
more docs
graph.c | ||
---|---|---|
333 | 333 |
void (sprite_set_pos) (sprite_t *p, int16_t x , int16_t y ){ p->x = x; p->y = y; } |
334 | 334 |
void (sprite_set_angle) (sprite_t *p, double angle ){ p->theta = angle; p->c = fm_cos(p->theta); p->s = fm_sin(p->theta); } |
335 | 335 |
void (sprite_set_scale) (sprite_t *p, double scale ){ |
336 |
if(deq(p->scale, scale)) return;
|
|
336 |
if(eq_d(p->scale, scale)) return;
|
|
337 | 337 |
p->scale = scale; |
338 | 338 |
|
339 | 339 |
p->su0 = (int16_t)(p->bsp->u0*p->scale); |
... | ... | |
385 | 385 |
sprite_sbuf2src(p, 0 , 0 , &x, &y); |
386 | 386 |
xmin = x; xmax = x; ymin = y; ymax = y; |
387 | 387 |
sprite_sbuf2src(p, (int16_t)sw, 0 , &x, &y); |
388 |
xmin = min16(x, xmin); xmax = max16(x, xmax); ymin = min16(y, ymin); ymax = max16(y, ymax);
|
|
388 |
xmin = min_16(x, xmin); xmax = max_16(x, xmax); ymin = min_16(y, ymin); ymax = max_16(y, ymax);
|
|
389 | 389 |
sprite_sbuf2src(p, 0 , (int16_t)sh, &x, &y); |
390 |
xmin = min16(x, xmin); xmax = max16(x, xmax); ymin = min16(y, ymin); ymax = max16(y, ymax);
|
|
390 |
xmin = min_16(x, xmin); xmax = max_16(x, xmax); ymin = min_16(y, ymin); ymax = max_16(y, ymax);
|
|
391 | 391 |
sprite_sbuf2src(p, (int16_t)sw, (int16_t)sh, &x, &y); |
392 |
xmin = min16(x, xmin); xmax = max16(x, xmax); ymin = min16(y, ymin); ymax = max16(y, ymax);
|
|
393 |
xmin = max16(xmin-2, 0); xmax = min16(xmax+2, (int16_t)graph_get_XRes());
|
|
394 |
ymin = max16(ymin-2, 0); ymax = min16(ymax+2, (int16_t)graph_get_YRes());
|
|
392 |
xmin = min_16(x, xmin); xmax = max_16(x, xmax); ymin = min_16(y, ymin); ymax = max_16(y, ymax);
|
|
393 |
xmin = max_16(xmin-2, 0); xmax = min_16(xmax+2, (int16_t)graph_get_XRes());
|
|
394 |
ymin = max_16(ymin-2, 0); ymax = min_16(ymax+2, (int16_t)graph_get_YRes());
|
|
395 | 395 |
} |
396 | 396 |
const uint16_t bytes_pixel = 3/*graph_get_bytes_pixel()*/; |
397 | 397 |
for(int16_t u, v, y = ymin; y < ymax; ++y){ |
Also available in: Unified diff