mirror of
https://github.com/Theaninova/mhlib.git
synced 2025-12-12 20:46:20 +00:00
Add install flow
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
[package]
|
||||
name = "renderwarelib"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
binrw = "0.11.2"
|
||||
|
||||
9
rust/renderwarelib/src/chunks/clump.rs
Normal file
9
rust/renderwarelib/src/chunks/clump.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use binrw::binread;
|
||||
|
||||
#[binread]
|
||||
#[derive(Debug)]
|
||||
pub struct RpClump {
|
||||
pub num_atomics: i32,
|
||||
pub num_lights: i32,
|
||||
pub num_cameras: i32,
|
||||
}
|
||||
40
rust/renderwarelib/src/chunks/mod.rs
Normal file
40
rust/renderwarelib/src/chunks/mod.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
use binrw::{binread, NullString};
|
||||
|
||||
pub mod clump;
|
||||
|
||||
#[binread]
|
||||
#[br(little)]
|
||||
#[derive(Debug)]
|
||||
pub struct RwStream {
|
||||
pub kind: u32,
|
||||
pub size: u32,
|
||||
pub library_id_stamp: u32,
|
||||
}
|
||||
|
||||
#[binread]
|
||||
#[br(little)]
|
||||
#[derive(Debug)]
|
||||
pub enum RwSection {
|
||||
#[br(magic(0x1u32))]
|
||||
Struct {},
|
||||
#[br(magic(0x2u32))]
|
||||
String(#[br(align_after = 4)] NullString),
|
||||
// TODO: extension
|
||||
// TODO: camera
|
||||
// TODO: texture
|
||||
// TODO: material
|
||||
// TODO: material list
|
||||
// TODO: atomic section
|
||||
// TODO: plane section
|
||||
// TODO: world
|
||||
// TODO: spline
|
||||
// TODO: matrix
|
||||
// TODO: frame list
|
||||
// TODO: geometry
|
||||
#[br(magic(0x10u32))]
|
||||
Clump {
|
||||
num_atomics: u32,
|
||||
num_lights: u32,
|
||||
num_cameras: u32,
|
||||
},
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
pub mod chunks;
|
||||
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
11
rust/renderwarelib/src/main.rs
Normal file
11
rust/renderwarelib/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use binrw::BinRead;
|
||||
use renderwarelib::chunks::RwSection;
|
||||
use std::fs::File;
|
||||
|
||||
pub fn main() {
|
||||
let mut file = File::open("/run/media/theaninova/Heart Drive/Games/Moorhuhn Kart 2/data/data/mk2/level01/objects/collision_border.dff")
|
||||
.unwrap();
|
||||
let data = RwSection::read(&mut file).unwrap();
|
||||
|
||||
println!("{:?}", data)
|
||||
}
|
||||
Reference in New Issue
Block a user