Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void gPrepareBitmap(CBitmap* bmp)
- {
- VMINT cnvs = vm_graphic_create_canvas(bmp->width, bmp->height);
- VMINT layer = vm_graphic_create_layer_ex(0, 0, bmp->width, bmp->height, VM_COLOR_888_TO_565(255, 0, 255), VM_BUF, vm_graphic_get_canvas_buffer(cnvs));
- memcpy(vm_graphic_get_layer_buffer(layer), bmp->pixels, bmp->width * bmp->height * 2);
- vm_graphic_canvas_set_trans_color(cnvs, VM_COLOR_888_TO_565(255, 0, 255));
- bmp->_platData = (void*)cnvs;
- }
- void gDrawBitmap(CBitmap* bmp, int x, int y)
- {
- int i, j;
- if(!bmp->_platData)
- gPrepareBitmap(bmp);
- vm_graphic_blt(screenBuf, x, y, vm_graphic_get_canvas_buffer((VMINT)bmp->_platData), 0, 0, bmp->width, bmp->height, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement