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 @@
@@ -1,2 +1,5 @@
|
||||
target |
||||
Cargo.lock |
||||
|
||||
rust-toolchain |
||||
rust-toolchain.toml |
||||
|
@ -0,0 +1,19 @@
@@ -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 @@
@@ -1,10 +1,9 @@
|
||||
#![allow(non_snake_case)] |
||||
// c3d/base.h
|
||||
//! `<c3d/base.h>`
|
||||
|
||||
use libc::c_int; |
||||
use super::*; |
||||
use libc::c_int; |
||||
|
||||
pub unsafe fn C3D_FixedAttribSet(id: c_int, x: f32, y: f32, z: f32, w: f32) { |
||||
let mut ptr = C3D_FixedAttribGetWritePtr(id); |
||||
*(*ptr).c.as_mut() = [x, y, z, w]; |
||||
let ptr = C3D_FixedAttribGetWritePtr(id); |
||||
(*ptr).c.copy_from_slice(&[x, y, z, w]); |
||||
} |
||||
|
File diff suppressed because one or more lines are too long
@ -1,33 +1,21 @@
@@ -1,33 +1,21 @@
|
||||
extern crate libc; |
||||
extern crate core; |
||||
#[macro_use] extern crate ctru_sys as libctru; |
||||
#![no_std] |
||||
#![allow(non_snake_case)] |
||||
#![feature(untagged_unions)] // used for [`C3D_Mtx`]
|
||||
|
||||
#[allow(warnings)] |
||||
mod bindgen; |
||||
pub mod base; |
||||
pub mod texenv; |
||||
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 texenv::*; |
||||
pub use bindings::*; |
||||
pub use uniforms::*; |
||||
|
||||
#[link(name="citro3d")] |
||||
#[link(name="ctru")] |
||||
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, |
||||
} |
||||
} |
||||
} |
||||
#[cfg(todo = "gpu_tev_macros")] |
||||
pub use texenv::*; |
||||
|
Loading…
Reference in new issue