Project

General

Profile

Revision 208

changed graph

View differences:

font.c
35 35
}
36 36
static int (glyph_draw_to_alpha_buffer)(const glyph_t *p, int16_t x, int16_t y, uint8_t *alp_buf, uint16_t W, uint16_t H){
37 37
    if(p == NULL) return NULL_PTR;
38
    int r;
39 38
    for(int16_t h = 0; h < p->h; ++h){
40 39
        for(int16_t w = 0; w < p->w; ++w){
41 40
            uint32_t c = *((uint32_t*)p->map + w + h*p->w);
42 41
            uint8_t a = GET_ALP(c);
43
            //c = c & 0xFF000000;
44
            //if(c != 0) printf("%d %d 0x%X\n", w, h, c);
45
            //else       printf("%d %d <========================\n");
46

  
47
            r = graph_set_pixel_alpha_buffer(x+w, y-p->h+h, a, alp_buf, W, H);
48

  
49

  
50
            //r = graph_set_pixel_alpha(x+w, y-p->h+h, GET_COLOR(c), GET_ALP(c));
51

  
52
            //printf("%d %d 0x%X\n", x, y, *(buf+(x+y*p->w)*sizeof(uint32_t)));
53
            if(r != SUCCESS && r != OUT_OF_RANGE) return r;
42
            
43
            int16_t x_ = x+w, y_ = y-p->h+h;
44
            unsigned pos = x_ +y_*W;
45
            alp_buf[pos] = a;
54 46
        }
55 47
    }
56 48
    return SUCCESS;

Also available in: Unified diff