From 840fe7f33c00eb6d4fbfec4f607496bfd0c1894b Mon Sep 17 00:00:00 2001 From: Jaby Date: Fri, 23 Sep 2022 22:35:55 +0200 Subject: [PATCH] Run clut code --- src/Tools/Tests/Test.mk | 4 ++-- src/Tools/jaby_engine_fconv/Cargo.toml | 1 + .../jaby_engine_fconv/src/images/reduced_tim/mod.rs | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Tools/Tests/Test.mk b/src/Tools/Tests/Test.mk index 40d16eee..becb8b7a 100644 --- a/src/Tools/Tests/Test.mk +++ b/src/Tools/Tests/Test.mk @@ -5,6 +5,6 @@ test_cpp_out: always @echo "Planschbecken" | ./../cpp_out/target/x86_64-unknown-linux-musl/release/cpp_out --name Dino -o "Test_Planschbecken.hpp" test_jaby_engine_fconv: always - @./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG.PNG simple-tim full16 - +# @./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG.PNG simple-tim full16 + @./../jaby_engine_fconv/target/x86_64-unknown-linux-musl/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG_pal.PNG simple-tim clut8 always: ; \ No newline at end of file diff --git a/src/Tools/jaby_engine_fconv/Cargo.toml b/src/Tools/jaby_engine_fconv/Cargo.toml index 068865d5..12a3cf27 100644 --- a/src/Tools/jaby_engine_fconv/Cargo.toml +++ b/src/Tools/jaby_engine_fconv/Cargo.toml @@ -9,4 +9,5 @@ edition = "2021" clap = {version = "*", features = ["derive"]} image = "*" paste = "*" +png = "*" tool_helper = {path = "../tool_helper"} \ No newline at end of file diff --git a/src/Tools/jaby_engine_fconv/src/images/reduced_tim/mod.rs b/src/Tools/jaby_engine_fconv/src/images/reduced_tim/mod.rs index 3de7a171..ac481b64 100644 --- a/src/Tools/jaby_engine_fconv/src/images/reduced_tim/mod.rs +++ b/src/Tools/jaby_engine_fconv/src/images/reduced_tim/mod.rs @@ -9,7 +9,7 @@ mod types; mod color_full16; #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] -pub enum ColorDepth { +pub enum ColorType{ Clut4, Clut8, Full16, @@ -18,7 +18,7 @@ pub enum ColorDepth { #[derive(Args)] pub struct Arguments { #[clap(arg_enum, value_parser)] - color_depth: ColorDepth + color_depth: ColorType } @@ -49,9 +49,13 @@ fn convert_full16(input: Input, output: Output) -> Result<(), Error> { } } +fn convert_palette_based(_: Input, _: Output, _: ColorType) -> Result<(), Error> { + Err(Error::from_text("Not implemented yet".to_owned())) +} + pub fn convert(args: Arguments, input: Input, output: Output) -> Result<(), Error> { match args.color_depth { - ColorDepth::Full16 => convert_full16(input, output), - _ => Err(Error::not_implemented("Converting anything else then full16")), + ColorType::Full16 => convert_full16(input, output), + _ => convert_palette_based(input, output, args.color_depth), } } \ No newline at end of file