Use iota crate

main
_ 2020-02-17 02:31:52 +00:00
parent c4d6243d15
commit 3c37cd030b
4 changed files with 42 additions and 27 deletions

7
Cargo.lock generated
View File

@ -94,6 +94,11 @@ dependencies = [
"adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "iota"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "khronos_api"
version = "3.1.0"
@ -193,6 +198,7 @@ dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gl 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glam 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)",
"iota 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 5.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)",
"sdl2 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -410,6 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum gl_generator 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
"checksum glam 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bb24d4e1b92ceed0450bbf803ac894b597c5b8d0e16f175f7ef28c42024d8cbd"
"checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"
"checksum iota 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c6015bb2d300661a0014e29025374a32a68e8ef7e4effe547baa00eef38b8e3"
"checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum lexical-core 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2304bccb228c4b020f3a4835d247df0a02a7c4686098d4167762cfbbe4c5cb14"

View File

@ -13,6 +13,8 @@ byteorder = "1.3.2"
gl = "0.14.0"
glam = "0.8.5"
iota = "0.2.1"
# TODO: Drop nom depend. It's way overkill for iqm.
nom = "5.1.0"

View File

@ -1,3 +1,4 @@
use iota::iota;
use nom::{
IResult,
bytes::complete::{tag},
@ -7,33 +8,35 @@ use nom::{
use std::convert::TryInto;
pub mod consts {
pub const VERSION: usize = 0;
pub const FILESIZE: usize = 1;
pub const FLAGS: usize = 2;
pub const NUM_TEXT: usize = 3;
pub const OFS_TEXT: usize = 4;
pub const NUM_MESHES: usize = 5;
pub const OFS_MESHES: usize = 6;
pub const NUM_VERTEXARRAYS: usize = 7;
pub const NUM_VERTEXES: usize = 8;
pub const OFS_VERTEXARRAYS: usize = 9;
pub const NUM_TRIANGLES: usize = 10;
pub const OFS_TRIANGLES: usize = 11;
pub const OFS_ADJACENCY: usize = 12;
pub const NUM_JOINTS: usize = 13;
pub const OFS_JOINTS: usize = 14;
pub const NUM_POSES: usize = 15;
pub const OFS_POSES: usize = 16;
pub const NUM_ANIMS: usize = 17;
pub const OFS_ANIMS: usize = 18;
pub const NUM_FRAMES: usize = 19;
pub const NUM_FRAMECHANNELS: usize = 20;
pub const OFS_FRAMES: usize = 21;
pub const OFS_BOUNDS: usize = 22;
pub const NUM_COMMENT: usize = 23;
pub const OFS_COMMENT: usize = 24;
pub const NUM_EXTENSIONS: usize = 25;
pub const OFS_EXTENSIONS: usize = 26;
iota! {
pub const VERSION: usize = iota;
, FILESIZE
, FLAGS
, NUM_TEXT
, OFS_TEXT
, NUM_MESHES
, OFS_MESHES
, NUM_VERTEXARRAYS
, NUM_VERTEXES
, OFS_VERTEXARRAYS
, NUM_TRIANGLES
, OFS_TRIANGLES
, OFS_ADJACENCY
, NUM_JOINTS
, OFS_JOINTS
, NUM_POSES
, OFS_POSES
, NUM_ANIMS
, OFS_ANIMS
, NUM_FRAMES
, NUM_FRAMECHANNELS
, OFS_FRAMES
, OFS_BOUNDS
, NUM_COMMENT
, OFS_COMMENT
, NUM_EXTENSIONS
, OFS_EXTENSIONS
}
}
pub mod types {

View File

@ -1,3 +1,6 @@
#[macro_use]
extern crate iota;
pub mod file;
pub mod glezz;
pub mod iqm;