Ian Chamberlain
3 years ago
6 changed files with 71 additions and 16 deletions
@ -1,9 +1,9 @@
@@ -1,9 +1,9 @@
|
||||
//! `<c3d/base.h>`
|
||||
//! Definitions from `<c3d/base.h>`
|
||||
|
||||
use super::*; |
||||
use libc::c_int; |
||||
use crate::C3D_FixedAttribGetWritePtr; |
||||
|
||||
pub unsafe fn C3D_FixedAttribSet(id: c_int, x: f32, y: f32, z: f32, w: f32) { |
||||
#[inline] |
||||
pub unsafe fn C3D_FixedAttribSet(id: libc::c_int, x: f32, y: f32, z: f32, w: f32) { |
||||
let ptr = C3D_FixedAttribGetWritePtr(id); |
||||
(*ptr).c.copy_from_slice(&[x, y, z, w]); |
||||
} |
||||
|
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
//! Helper functions based on `<3ds/gpu/gx.h>`.
|
||||
|
||||
use crate::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE}; |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_FLIP_VERT(flip: bool) -> u32 { |
||||
flip as u32 |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_OUT_TILED(tiled: bool) -> u32 { |
||||
(tiled as u32) << 1 |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_RAW_COPY(raw_copy: bool) -> u32 { |
||||
(raw_copy as u32) << 3 |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_IN_FORMAT(format: GX_TRANSFER_FORMAT) -> u32 { |
||||
format << 8 |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_OUT_FORMAT(format: GX_TRANSFER_FORMAT) -> u32 { |
||||
format << 12 |
||||
} |
||||
|
||||
#[inline] |
||||
pub fn GX_TRANSFER_SCALING(scale: GX_TRANSFER_SCALE) -> u32 { |
||||
scale << 24 |
||||
} |
Loading…
Reference in new issue