Revision 207
maybe working
graph.c | ||
---|---|---|
275 | 275 |
memcpy(alp_buf + pos, &alpha, 1); |
276 | 276 |
return SUCCESS; |
277 | 277 |
} |
278 |
/* |
|
278 | 279 |
int (graph_set_pixel_alpha)(uint16_t x, uint16_t y, uint32_t color, uint8_t alpha){ |
279 | 280 |
if (x >= vbe_mem_info.XResolution || y >= vbe_mem_info.YResolution) { |
280 | 281 |
//printf("%s: invalid pixel.\n", __func__); |
... | ... | |
286 | 287 |
float a = 1.0-(alpha&0xFF)/(float)0xFF; |
287 | 288 |
uint8_t r = GET_RED(color)*a + GET_RED(color_)*(1.0-a); |
288 | 289 |
uint8_t g = GET_GRE(color)*a + GET_GRE(color_)*(1.0-a); |
289 |
uint8_t b = GET_BLU(color)*a + GET_BLU(color_)*(1.0-a); |
|
290 |
return graph_set_pixel(x,y,SET_RGB(r,g,b)); |
|
291 |
//return set_pixel(x,y,color); |
|
290 |
uint8_t b = GET_BLU(color)*a + GET_BLU(color_)*(1.0-a); (void)(r*g*b); |
|
291 |
//return graph_set_pixel(x,y,SET_RGB(r,g,b)); |
|
292 |
color = SET_RGB(r,g,b); |
|
293 |
//unsigned int pos = (x + y * W) * graph_get_bytes_pixel(); |
|
294 |
memcpy(video_buf + pos, &color, graph_get_bytes_pixel()); |
|
295 |
return SUCCESS; |
|
292 | 296 |
} |
293 |
|
|
297 |
*/ |
|
294 | 298 |
int (graph_clear_screen)(void){ |
295 | 299 |
//return graph_paint_screen(BLACK); |
296 | 300 |
memset(video_buf, 0, graph_get_vram_size()); |
Also available in: Unified diff