Browse Source

some other stuff

Getty Ritter 10 months ago
parent
commit
16765d5be2
3 changed files with 8 additions and 3 deletions
  1. 4 0
      Cargo.toml
  2. 3 3
      src/data.rs
  3. 1 0
      src/lib.rs

+ 4 - 0
Cargo.toml

@@ -19,3 +19,7 @@ clap = { version = "*", features = ["derive"] }
 [[bin]]
 [[bin]]
 name = "thyme-from-png"
 name = "thyme-from-png"
 path = "tools/from-png/main.rs"
 path = "tools/from-png/main.rs"
+
+[[bin]]
+name = "thyme-editor"
+path = "tools/editor/main.rs"

+ 3 - 3
src/data.rs

@@ -4,15 +4,15 @@ use crate::errors::IncompleteMappingError;
 use crate::image::{Image, Pixel};
 use crate::image::{Image, Pixel};
 use std::collections::{HashMap, HashSet};
 use std::collections::{HashMap, HashSet};
 
 
+#[derive(Deserialize, Debug)]
+pub struct Mapping(pub HashMap<Pixel, String>);
+
 #[derive(Deserialize, Debug)]
 #[derive(Deserialize, Debug)]
 struct ColorEntry {
 struct ColorEntry {
     color: Pixel,
     color: Pixel,
     symbol: String,
     symbol: String,
 }
 }
 
 
-#[derive(Deserialize, Debug)]
-pub struct Mapping(HashMap<Pixel, String>);
-
 impl Mapping {
 impl Mapping {
     pub fn load(
     pub fn load(
         path: impl AsRef<std::path::Path>,
         path: impl AsRef<std::path::Path>,

+ 1 - 0
src/lib.rs

@@ -1,4 +1,5 @@
 pub mod data;
 pub mod data;
 pub mod draw;
 pub mod draw;
 pub mod errors;
 pub mod errors;
+pub mod file;
 pub mod image;
 pub mod image;