File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -37,23 +37,24 @@ namespace pimoroni {
37
37
}
38
38
}
39
39
bool PicoGraphics_PenRGB888::render_tile (const Tile *tile) {
40
+ // Unpack our pen colour
41
+ uint32_t sr = (color >> 16 ) & 0xff ;
42
+ uint32_t sg = (color >> 8 ) & 0xff ;
43
+ uint32_t sb = (color >> 0 ) & 0xff ;
44
+
40
45
for (int y = 0 ; y < tile->h ; y++) {
41
46
uint8_t *p_alpha = &tile->data [(y * tile->stride )];
42
47
uint32_t *p_dest = &((uint32_t *)frame_buffer)[tile->x + ((tile->y + y) * bounds.w )];
43
48
for (int x = 0 ; x < tile->w ; x++) {
44
- uint16_t dest = *p_dest;
49
+ uint32_t dest = *p_dest;
45
50
uint8_t alpha = *p_alpha;
46
51
47
52
// TODO: Alpha blending
48
53
if (alpha == 255 ) {
49
54
*p_dest = color;
50
55
}else if (alpha == 0 ) {
51
56
} else {
52
- // blend tha pixel
53
- uint32_t sr = (color >> 16 ) & 0xff ;
54
- uint32_t sg = (color >> 8 ) & 0xff ;
55
- uint32_t sb = (color >> 0 ) & 0xff ;
56
-
57
+ // blend the pixel
57
58
uint32_t dr = (dest >> 16 ) & 0xff ;
58
59
uint32_t dg = (dest >> 8 ) & 0xff ;
59
60
uint32_t db = (dest >> 0 ) & 0xff ;
You can’t perform that action at this time.
0 commit comments