Project

General

Profile

Revision 165

renamed graph stuff

View differences:

sprite.c
60 60
void (sprite_draw)(const sprite_t *p){
61 61
    const int16_t diag = sqrt(p->w*p->w + p->h*p->h)+2;
62 62
    int16_t u, v;
63
    for(int16_t y = max(0,p->y-diag); y < min(p->y+diag,get_YRes()); ++y){
64
        for(int16_t x = max(0,p->x-diag); x < min(p->x+diag,get_XRes()); ++x){
63
    for(int16_t y = max(0,p->y-diag); y < min(p->y+diag,graph_get_YRes()); ++y){
64
        for(int16_t x = max(0,p->x-diag); x < min(p->x+diag,graph_get_XRes()); ++x){
65 65
            sprite_src2pic(p, x, y, &u, &v);
66 66
            if(0 <= u && u < p->w && 0 <= v && v < p->h){
67 67
                uint8_t *m = p->map + (v*p->w + u)*4;
68 68
                uint32_t color = SET_RGB(*(m+2), *(m+1), *(m));
69
                set_pixel_alpha(p->x + x, p->y + y, color, *(m+3));
69
                graph_set_pixel_alpha(p->x + x, p->y + y, color, *(m+3));
70 70
            }
71 71
        }
72 72
    }

Also available in: Unified diff