Project

General

Profile

Revision 208

changed graph

View differences:

sprite.c
104 104
        ymin = max(ymin-2, 0); ymax = min(ymax+2, graph_get_YRes());
105 105
    }
106 106
    const uint8_t *map = basic_sprite_get_map(p->bsp);
107
    int16_t u, v;
108
    for(int16_t y = ymin; y < ymax; ++y){
109
        for(int16_t x = xmin; x < xmax; ++x){
107
    const uint16_t bytes_pixel = graph_get_bytes_pixel();
108
    for(int16_t u, v, y = ymin; y < ymax; ++y){
109
        unsigned pos = (xmin + y*graph_get_XRes())*bytes_pixel;
110
        for(int16_t x = xmin; x < xmax; ++x, pos += bytes_pixel){
110 111
            sprite_src2pic(p, x, y, &u, &v);
111 112
            if(0 <= u && u < w && 0 <= v && v < h){
112 113
                uint32_t c = *(uint32_t*)(map + (v*w + u)*4);
113 114
                if(GET_ALP(c) < 0x7F)
114
                    graph_set_pixel(x, y, GET_COLOR(c));
115
                    graph_set_pixel_pos(pos, c);
115 116
            }
116 117
        }
117 118
    }

Also available in: Unified diff