1
0
Fork 0
forked from wry/wry

autocommit 2022-03-23 15:56:15 CET

This commit is contained in:
Julian Orth 2022-03-23 15:56:15 +01:00
parent 63be47a9fb
commit 5e9e8c3a94
9 changed files with 479 additions and 290 deletions

View file

@ -1,17 +1,17 @@
#![allow(dead_code)]
pub const fn format(bpp: u32, ty: u32, a: u32, r: u32, g: u32, b: u32) -> u32 {
(bpp << 24) | (ty << 16) | (a << 12) | (r << 8) | (g << 4) | b
pub const fn format(bpp: u32, ty: u32, a: u32, r: u32, g: u32, b: u32) -> i32 {
((bpp << 24) | (ty << 16) | (a << 12) | (r << 8) | (g << 4) | b) as i32
}
pub const fn format_byte(bpp: u32, ty: u32, a: u32, r: u32, g: u32, b: u32) -> u32 {
((bpp >> 3) << 24)
pub const fn format_byte(bpp: u32, ty: u32, a: u32, r: u32, g: u32, b: u32) -> i32 {
(((bpp >> 3) << 24)
| (3 << 22)
| (ty << 16)
| ((a >> 3) << 12)
| ((r >> 3) << 8)
| ((g >> 3) << 4)
| (b >> 3)
| (b >> 3)) as i32
}
pub const fn format_reshift(val: u32, ofs: u32, num: u32) -> u32 {