Browse Source
* Update to 2021 edition * Fix build errors for duplicate impls, type mismatch, etc. * don't compile texenv yet - need the macros * Update deps for recent changespull/18/head
Ian Chamberlain
3 years ago
10 changed files with 1569 additions and 313 deletions
@ -1,2 +1,5 @@ |
|||||||
target |
target |
||||||
Cargo.lock |
Cargo.lock |
||||||
|
|
||||||
|
rust-toolchain |
||||||
|
rust-toolchain.toml |
||||||
|
@ -0,0 +1,19 @@ |
|||||||
|
use std::env; |
||||||
|
|
||||||
|
fn main() { |
||||||
|
let dkp_path = env::var("DEVKITPRO").unwrap(); |
||||||
|
let debug_symbols = env::var("DEBUG").unwrap(); |
||||||
|
|
||||||
|
println!("cargo:rerun-if-changed=build.rs"); |
||||||
|
println!("cargo:rerun-if-env-changed=DEVKITPRO"); |
||||||
|
println!("cargo:rustc-link-search=native={}/libctru/lib", dkp_path); |
||||||
|
println!( |
||||||
|
"cargo:rustc-link-lib=static={}", |
||||||
|
match debug_symbols.as_str() { |
||||||
|
// Based on valid values described in
|
||||||
|
// https://doc.rust-lang.org/cargo/reference/profiles.html#debug
|
||||||
|
"0" | "false" => "citro3d", |
||||||
|
_ => "citro3dd", |
||||||
|
} |
||||||
|
); |
||||||
|
} |
@ -1,10 +1,9 @@ |
|||||||
#![allow(non_snake_case)] |
//! `<c3d/base.h>`
|
||||||
// c3d/base.h
|
|
||||||
|
|
||||||
use libc::c_int; |
|
||||||
use super::*; |
use super::*; |
||||||
|
use libc::c_int; |
||||||
|
|
||||||
pub unsafe fn C3D_FixedAttribSet(id: c_int, x: f32, y: f32, z: f32, w: f32) { |
pub unsafe fn C3D_FixedAttribSet(id: c_int, x: f32, y: f32, z: f32, w: f32) { |
||||||
let mut ptr = C3D_FixedAttribGetWritePtr(id); |
let ptr = C3D_FixedAttribGetWritePtr(id); |
||||||
*(*ptr).c.as_mut() = [x, y, z, w]; |
(*ptr).c.copy_from_slice(&[x, y, z, w]); |
||||||
} |
} |
||||||
|
File diff suppressed because one or more lines are too long
@ -1,33 +1,21 @@ |
|||||||
extern crate libc; |
#![no_std] |
||||||
extern crate core; |
#![allow(non_snake_case)] |
||||||
#[macro_use] extern crate ctru_sys as libctru; |
#![feature(untagged_unions)] // used for [`C3D_Mtx`]
|
||||||
|
|
||||||
#[allow(warnings)] |
|
||||||
mod bindgen; |
|
||||||
pub mod base; |
pub mod base; |
||||||
pub mod texenv; |
pub mod texenv; |
||||||
pub mod uniforms; |
pub mod uniforms; |
||||||
|
|
||||||
pub use bindgen::*; |
#[allow(warnings)] |
||||||
|
#[allow(warnings)] |
||||||
|
#[allow(non_upper_case_globals)] |
||||||
|
#[allow(non_camel_case_types)] |
||||||
|
#[allow(clippy::all)] |
||||||
|
mod bindings; |
||||||
|
|
||||||
pub use base::*; |
pub use base::*; |
||||||
pub use texenv::*; |
pub use bindings::*; |
||||||
pub use uniforms::*; |
pub use uniforms::*; |
||||||
|
|
||||||
#[link(name="citro3d")] |
#[cfg(todo = "gpu_tev_macros")] |
||||||
#[link(name="ctru")] |
pub use texenv::*; |
||||||
extern {} |
|
||||||
|
|
||||||
impl Copy for C3D_FVec {} |
|
||||||
impl Clone for C3D_FVec { |
|
||||||
fn clone(&self) -> Self { |
|
||||||
*self |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
impl From<libctru::GPU_DEPTHBUF> for C3D_DEPTHTYPE { |
|
||||||
fn from(fmt: libctru::GPU_DEPTHBUF) -> Self { |
|
||||||
Self { |
|
||||||
__e: fmt, |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
Loading…
Reference in new issue