master
ne0ndrag0n 2021-02-12 19:54:58 -05:00
parent 5efa561b20
commit bd8c217adc
4 changed files with 67 additions and 2 deletions

View File

@ -7,3 +7,5 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
image = "^0.23"
colour = "^0.5"

View File

@ -1,3 +1,62 @@
fn main() { extern crate image;
println!("Hello, world!"); #[macro_use]
extern crate colour;
use std::env::{ Args, args };
use std::process::exit;
mod reskit;
use reskit::tileset;
struct ArgumentOption {
pub key: String,
pub value: String
}
fn print_help() {
println!( "Usage:" );
println!( "reskit [plugin] options" );
println!( "" );
println!( "Available Plugins:" );
println!( " tileset - Convert 15-colour PNG to Sega Genesis VDP format" );
println!( " Output as .bin containing palette, then tiles");
println!( "" );
println!( "Options:" );
println!( "--input Specify input file for plugin" );
println!( "--output Specify output file/path for plugin" );
}
fn get_option( arguments: &mut Args ) -> Option< ArgumentOption > {
Some( ArgumentOption{ key: arguments.next()?, value: arguments.next()? } )
}
fn load_module( module: String, arguments: Args ) -> i32 {
// Discriminate module
match module.as_str() {
"reskit" => {
42
},
_ => {
red!( "fatal: " ); println!( "invalid module: {}", module );
2
}
}
}
fn main() {
cyan!( "reskit" ); println!( " - Sega Genesis Resource Kit (v0.0.1a)" );
println!( "(c) 2021 Ashley N. (ne0ndrag0n)" );
let mut args = args();
args.next(); // Burn arg1
let mode = match args.next() {
Some( mode ) => mode,
None => {
print_help();
exit( 1 );
}
};
exit( load_module( mode, args ) );
} }

1
src/reskit/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod tileset;

3
src/reskit/tileset.rs Normal file
View File

@ -0,0 +1,3 @@
pub fn load_tileset() -> i32 {
3
}