Use iota crate
							parent
							
								
									c4d6243d15
								
							
						
					
					
						commit
						3c37cd030b
					
				| 
						 | 
					@ -94,6 +94,11 @@ dependencies = [
 | 
				
			||||||
 "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 | 
					 "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]]
 | 
					[[package]]
 | 
				
			||||||
name = "khronos_api"
 | 
					name = "khronos_api"
 | 
				
			||||||
version = "3.1.0"
 | 
					version = "3.1.0"
 | 
				
			||||||
| 
						 | 
					@ -193,6 +198,7 @@ dependencies = [
 | 
				
			||||||
 "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
 | 
					 "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)",
 | 
					 "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)",
 | 
					 "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)",
 | 
					 "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)",
 | 
					 "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)",
 | 
					 "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 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 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 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 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 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"
 | 
					"checksum lexical-core 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2304bccb228c4b020f3a4835d247df0a02a7c4686098d4167762cfbbe4c5cb14"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,6 +13,8 @@ byteorder = "1.3.2"
 | 
				
			||||||
gl = "0.14.0"
 | 
					gl = "0.14.0"
 | 
				
			||||||
glam = "0.8.5"
 | 
					glam = "0.8.5"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					iota = "0.2.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# TODO: Drop nom depend. It's way overkill for iqm.
 | 
					# TODO: Drop nom depend. It's way overkill for iqm.
 | 
				
			||||||
nom = "5.1.0"
 | 
					nom = "5.1.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										57
									
								
								src/iqm.rs
								
								
								
								
							
							
						
						
									
										57
									
								
								src/iqm.rs
								
								
								
								
							| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
 | 
					use iota::iota;
 | 
				
			||||||
use nom::{
 | 
					use nom::{
 | 
				
			||||||
	IResult,
 | 
						IResult,
 | 
				
			||||||
	bytes::complete::{tag},
 | 
						bytes::complete::{tag},
 | 
				
			||||||
| 
						 | 
					@ -7,33 +8,35 @@ use nom::{
 | 
				
			||||||
use std::convert::TryInto;
 | 
					use std::convert::TryInto;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub mod consts {
 | 
					pub mod consts {
 | 
				
			||||||
	pub const VERSION: usize           =  0;
 | 
					iota! {
 | 
				
			||||||
	pub const FILESIZE: usize          =  1;
 | 
						pub const VERSION: usize = iota;
 | 
				
			||||||
	pub const FLAGS: usize             =  2;
 | 
								, FILESIZE
 | 
				
			||||||
	pub const NUM_TEXT: usize          =  3;
 | 
								, FLAGS
 | 
				
			||||||
	pub const OFS_TEXT: usize          =  4;
 | 
								, NUM_TEXT
 | 
				
			||||||
	pub const NUM_MESHES: usize        =  5;
 | 
								, OFS_TEXT
 | 
				
			||||||
	pub const OFS_MESHES: usize        =  6;
 | 
								, NUM_MESHES
 | 
				
			||||||
	pub const NUM_VERTEXARRAYS: usize  =  7;
 | 
								, OFS_MESHES
 | 
				
			||||||
	pub const NUM_VERTEXES: usize      =  8;
 | 
								, NUM_VERTEXARRAYS
 | 
				
			||||||
	pub const OFS_VERTEXARRAYS: usize  =  9;
 | 
								, NUM_VERTEXES
 | 
				
			||||||
	pub const NUM_TRIANGLES: usize     = 10;
 | 
								, OFS_VERTEXARRAYS
 | 
				
			||||||
	pub const OFS_TRIANGLES: usize     = 11;
 | 
								, NUM_TRIANGLES
 | 
				
			||||||
	pub const OFS_ADJACENCY: usize     = 12;
 | 
								, OFS_TRIANGLES
 | 
				
			||||||
	pub const NUM_JOINTS: usize        = 13;
 | 
								, OFS_ADJACENCY
 | 
				
			||||||
	pub const OFS_JOINTS: usize        = 14;
 | 
								, NUM_JOINTS
 | 
				
			||||||
	pub const NUM_POSES: usize         = 15;
 | 
								, OFS_JOINTS
 | 
				
			||||||
	pub const OFS_POSES: usize         = 16;
 | 
								, NUM_POSES
 | 
				
			||||||
	pub const NUM_ANIMS: usize         = 17;
 | 
								, OFS_POSES
 | 
				
			||||||
	pub const OFS_ANIMS: usize         = 18;
 | 
								, NUM_ANIMS
 | 
				
			||||||
	pub const NUM_FRAMES: usize        = 19;
 | 
								, OFS_ANIMS
 | 
				
			||||||
	pub const NUM_FRAMECHANNELS: usize = 20;
 | 
								, NUM_FRAMES
 | 
				
			||||||
	pub const OFS_FRAMES: usize        = 21;
 | 
								, NUM_FRAMECHANNELS
 | 
				
			||||||
	pub const OFS_BOUNDS: usize        = 22;
 | 
								, OFS_FRAMES
 | 
				
			||||||
	pub const NUM_COMMENT: usize       = 23;
 | 
								, OFS_BOUNDS
 | 
				
			||||||
	pub const OFS_COMMENT: usize       = 24;
 | 
								, NUM_COMMENT
 | 
				
			||||||
	pub const NUM_EXTENSIONS: usize    = 25;
 | 
								, OFS_COMMENT
 | 
				
			||||||
	pub const OFS_EXTENSIONS: usize    = 26;
 | 
								, NUM_EXTENSIONS
 | 
				
			||||||
 | 
								, OFS_EXTENSIONS
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub mod types {
 | 
					pub mod types {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,6 @@
 | 
				
			||||||
 | 
					#[macro_use]
 | 
				
			||||||
 | 
					extern crate iota;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub mod file;
 | 
					pub mod file;
 | 
				
			||||||
pub mod glezz;
 | 
					pub mod glezz;
 | 
				
			||||||
pub mod iqm;
 | 
					pub mod iqm;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue