true 16-bit color... glorious
This commit is contained in:
parent
3dccce8a81
commit
b1e8525c3e
30 changed files with 678 additions and 652 deletions
|
|
@ -1,16 +1,16 @@
|
|||
#include "pxl8_blit.h"
|
||||
|
||||
void pxl8_blit_hicolor(u32* fb, u32 fb_width, const u32* sprite, u32 atlas_width,
|
||||
void pxl8_blit_hicolor(u16* fb, u32 fb_width, const u16* sprite, u32 atlas_width,
|
||||
i32 x, i32 y, u32 w, u32 h) {
|
||||
u32* dest_base = fb + y * fb_width + x;
|
||||
const u32* src_base = sprite;
|
||||
u16* dest_base = fb + y * fb_width + x;
|
||||
const u16* src_base = sprite;
|
||||
|
||||
for (u32 row = 0; row < h; row++) {
|
||||
u32* dest_row = dest_base + row * fb_width;
|
||||
const u32* src_row = src_base + row * atlas_width;
|
||||
u16* dest_row = dest_base + row * fb_width;
|
||||
const u16* src_row = src_base + row * atlas_width;
|
||||
|
||||
for (u32 col = 0; col < w; col++) {
|
||||
if (src_row[col] & 0xFF000000) {
|
||||
if (src_row[col] != 0) {
|
||||
dest_row[col] = src_row[col];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue