92 Commits

Author SHA1 Message Date
9a5918f3f7 Experimental clangd support for PoolBox 2025-08-12 22:15:08 +02:00
18ebf33e2c Add clangd support to 'Support' 2025-08-12 21:57:16 +02:00
d8065f6266 Add clangd support 2025-08-12 21:50:46 +02:00
f25548085f Update name of tim_project 2025-04-16 21:48:54 +02:00
85d787151a Delete dummy file 2025-04-16 21:46:40 +02:00
d69b144ebe Include another image for the tim_project file 2025-04-16 21:46:13 +02:00
a686df5bf6 Integrated auto generated Dönerfisch 2025-04-16 21:18:52 +02:00
3500a288bc Support image size for files 2025-04-16 21:18:37 +02:00
e51908ae09 Support creating hpp file 2025-04-16 20:42:51 +02:00
4ea7575057 Basic project suport 2025-04-14 20:47:56 +02:00
e3ed4a3b43 Update existing project for the new settings 2025-04-13 16:55:13 +02:00
3f507fd19e Setup usage example 2025-04-08 21:22:39 +02:00
f8ec08008a Support settings and encode 2025-04-08 19:19:32 +00:00
4942012da1 Added storage for settings 2025-04-08 19:19:32 +00:00
9501954587 Slowly introducing file settings 2025-04-08 19:19:32 +00:00
751533dcf6 Move primitives around 2025-04-08 19:19:32 +00:00
5a1997873d Make palette optional 2025-04-08 19:19:32 +00:00
5cd29460fb Prepare GUI for additonal settings 2025-04-08 19:19:32 +00:00
7a2052575d Prepare file settings box 2025-04-08 19:19:32 +00:00
a475a0c82d Bump dependency versions 2025-04-05 22:38:14 +02:00
32da34cad6 Fix various focus issues 2025-04-05 22:34:30 +02:00
af633a4fdf Fix scoll issue 2025-04-05 22:22:33 +02:00
b0b8c43700 Bump version to 1.0.0 2025-04-02 22:11:37 +02:00
ed4671698a Add label to indicate focusing ability 2025-04-02 22:10:36 +02:00
b487ca2591 Focus on left click 2025-04-02 22:08:06 +02:00
a33aa6bb4e Add width/height for images by catty request 2025-04-02 21:46:46 +02:00
85b5aa0070 Support naming of VRAM 2025-04-02 21:34:32 +02:00
b3a666b5ea Increase zoom level to 800% 2025-04-02 21:23:56 +02:00
a8ca3bf859 Create public function for loading files 2025-04-02 21:14:19 +02:00
ec6c20185e Support loading relative pathes 2025-04-02 21:04:42 +02:00
a6d8ecab16 Improve error message when failing to load image 2025-04-02 20:52:28 +02:00
a89699334e Create relative pathes for saving projects 2025-04-02 20:47:50 +02:00
5f93549a05 Fix usage of checked property 2025-04-02 20:06:35 +02:00
2e6aa8dbe9 Improve text message for appending elements 2025-04-01 17:20:05 +02:00
a9801e9fe2 Support appending and overriding existing elements from project 2025-04-01 17:19:28 +02:00
47b5de2d6a Clear existing elements 2025-04-01 16:28:27 +02:00
bab01bbd86 Load VRAM images from project file 2025-04-01 16:03:35 +02:00
a260c1ffb7 Allow position information for newly added VRAM items 2025-04-01 15:24:41 +02:00
5cc88e0b87 Deserialize project 2025-03-20 21:37:19 +01:00
5f4ade47bd Support selecting project to open 2025-03-20 21:26:32 +01:00
2345b3da57 Save encoding information 2025-03-20 21:16:41 +01:00
e0a266317e Support saving palette information 2025-03-20 20:57:10 +01:00
aae57e47e4 Implement writing image and half the platte information 2025-03-19 22:01:32 +01:00
d1d590d32a Save tim_project files 2025-03-19 21:32:18 +01:00
18e6800e0f Implement browsing project save location 2025-03-19 21:17:26 +01:00
d42fe2776c Serialize project to json 2025-03-19 20:47:21 +01:00
7a197d9b71 Create a simple Job 2025-03-19 20:21:45 +01:00
b394330405 zip jobs 2025-03-18 22:31:59 +01:00
602fb3a5c2 Obtain all required vectors; Quick draft for project 2025-03-18 21:54:25 +01:00
6a1b87cdb1 Update name of VRAM images to reflect data 2025-03-18 21:48:36 +01:00
5ccf593963 Merge pull request 'topic/bg/project-gui' (#21) from topic/bg/project-gui into main
Reviewed-on: #21
Reviewed-by: cody <william@werl.me>
2025-03-18 19:58:12 +00:00
2b6fb4c090 Connect project gui components 2025-03-15 17:45:00 +01:00
aaeeaf97c5 Merge gui_elements into gui 2025-03-15 17:10:54 +01:00
a4fe26f112 Clean up references 2025-03-15 17:00:35 +01:00
c114745a8e Rework callbacks 2025-03-15 16:19:47 +01:00
e3a85fc2d9 Merge branch 'main' into topic/bg/project-gui 2025-03-13 20:57:19 +01:00
2d0c63f871 Merge pull request 'Code clean up from live-stream' (#20) from topic/jb/more-improvements into main
Reviewed-on: #20
Reviewed-by: cody <william@werl.me>
2025-03-13 19:56:21 +00:00
eb29237f24 Create connections 2025-03-13 20:29:48 +01:00
ab5c7efce8 Create GUI for project tab 2025-03-13 19:58:51 +01:00
fce64e7cf0 Removed extra line 2025-03-12 21:45:40 +01:00
02470d6bb7 Small clean-up 2025-03-12 21:44:43 +01:00
aeed26357d Collect all dependecies into an application 2025-03-12 21:29:29 +01:00
af2526d829 Rename logic to TIMManager 2025-03-12 20:22:46 +01:00
58c105ac03 Merge pull request 'Various GUI improvements' (#19) from topic/jb/gui-improvements into main
Reviewed-on: #19
Reviewed-by: cody <william@werl.me>
2025-03-12 18:42:19 +00:00
c5386eccd5 Proper handling of non existing project page 2025-03-11 20:49:37 +01:00
2317bd9b29 Set program version depending on own version 2025-03-11 20:46:37 +01:00
a0368c1e51 Improve scrolling slightly 2025-03-11 20:35:11 +01:00
3549c1a709 Display full image in main window preview 2025-03-08 17:11:00 +01:00
33e7b23ab2 Various improvements; Logic is now being reported about added and removed elements to be in sync with GUI 2025-03-08 17:04:26 +01:00
5952b97b6c Merge pull request 'topic/jb/tim_tool/risize_image' (#18) from topic/jb/tim_tool/risize_image into main
Reviewed-on: #18
Reviewed-by: cody <william@werl.me>
2025-03-08 14:32:56 +00:00
ebe77aec15 Merge pull request 'Add lock files to git' (#17) from topic/jb/tim_tool/add_toml into main
Reviewed-on: #17
Reviewed-by: cody <william@werl.me>
2025-03-08 14:32:45 +00:00
16825943c4 Add lock files to git 2025-03-06 22:23:36 +01:00
62289bc07e Display encoding on main screen 2025-03-06 22:21:56 +01:00
72b97ad7d3 Fix default selection 2025-03-06 22:02:30 +01:00
8ead2a205d Support scaling image depended on encoding 2025-03-06 21:56:52 +01:00
454fa43492 Add combobox for encoding type 2025-03-06 20:52:23 +01:00
6375183624 Display size of image 2025-03-06 19:58:13 +01:00
58b2f62d2f Merge pull request 'Support loading and displaying of image palette' (#16) from topic/jb/tim_tool/PaletteSupport into main
Reviewed-on: #16
Reviewed-by: cody <william@werl.me>
2025-03-06 18:11:51 +00:00
4d62d79cbd Support changing palette size 2025-03-04 21:38:08 +01:00
3cdfe4a677 Update palette size info 2025-03-04 20:53:35 +01:00
e948887faa Add GUI for palette width/height 2025-03-04 20:40:50 +01:00
1f8fc5100c Support pre-view of palette 2025-03-03 21:31:02 +01:00
618b642c3f Prepare for palette display 2025-03-03 20:46:30 +01:00
70cf70c4b5 Pixelate scale of selection window 2025-03-03 20:34:15 +01:00
57f22a6d6c Addd scale slider 2025-03-03 20:28:46 +01:00
a62728db7b Crappy scale slider implementation 2025-03-02 00:45:23 +01:00
39dace6f6b Fix layout scaling issue 2025-03-02 00:09:11 +01:00
e25cc7ba38 Make test scale work? 2025-02-23 07:38:11 +01:00
a797bff7a1 Simple scale concept 2025-02-17 17:46:59 +01:00
ebf640520e Support movement by key 2025-02-17 17:05:24 +01:00
b4c6cb70b6 Make image pos editable 2025-02-17 16:53:35 +01:00
fb1ecf17c5 Load palette 2025-02-17 11:29:47 +01:00
59 changed files with 19659 additions and 696 deletions

3
.clangd Normal file
View File

@@ -0,0 +1,3 @@
CompileFlags:
Remove: [-fmodules-ts, -mno-shared, -mno-llsc, -march=r2000, -mtune=r2000, implied_comparison_category_type_not_found]
Compiler: mipsel-linux-gnu-g++

2
.gitignore vendored
View File

@@ -9,6 +9,8 @@
**/config **/config
.lfsconfig .lfsconfig
.cache
compile_commands.json
*.d *.d
*.a *.a

View File

@@ -5,3 +5,4 @@
*.o *.o
*.lba *.lba
**/bin **/bin
**/auto_gen

View File

@@ -11,7 +11,7 @@
{ {
"label": "build", "label": "build",
"type": "shell", "type": "shell",
"command": "${env:JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh ${workspaceFolder}:. make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config}", "command": "${env:JABY_ENGINE_PATH}/scripts/podman_jaby_engine.sh ${workspaceFolder}:. bear -- make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config}",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true

View File

@@ -1,4 +1,5 @@
#pragma once #pragma once
#include "auto_gen/vram_layout.hpp"
#include <PSX/File/cd_file_types.hpp> #include <PSX/File/cd_file_types.hpp>
namespace Assets { namespace Assets {
@@ -11,11 +12,6 @@ namespace Assets {
}; };
static constexpr auto PacoTIM = SimpleTIM::create(896, 0, 960, 510); static constexpr auto PacoTIM = SimpleTIM::create(896, 0, 960, 510);
static constexpr auto DoenerFishInfo = ImageInfo{
.tim = SimpleTIM::create(896 + 30, 0, 960 + 16, 510),
.size = GPU::SizeI16::create(128, 64)
};
namespace JabyLoader { namespace JabyLoader {
static constexpr auto TIMLoaction = SimpleTIM::create(PacoTIM.get_texture_x(), PacoTIM.get_texture_y() + 128, 960 + 48, 510); static constexpr auto TIMLoaction = SimpleTIM::create(PacoTIM.get_texture_x(), PacoTIM.get_texture_y() + 128, 960 + 48, 510);
static constexpr auto JabyFrame = GPU::AreaI16::create(0, 0, 32, 44); static constexpr auto JabyFrame = GPU::AreaI16::create(0, 0, 32, 44);

View File

@@ -1,3 +1,4 @@
#include "../../../include/auto_gen/vram_layout.hpp"
#include "../../../include/shared.hpp" #include "../../../include/shared.hpp"
#include "include/controller_state.hpp" #include "include/controller_state.hpp"
#include <PSX/Periphery/periphery.hpp> #include <PSX/Periphery/periphery.hpp>

View File

@@ -1,4 +1,4 @@
#include "include/controller_test_assets.hpp" #include "../../../include/auto_gen/vram_layout.hpp"
#include <PSX/File/Processor/cd_file_processor.hpp> #include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/AutoLBA/auto_lba_declaration.hpp> #include <PSX/AutoLBA/auto_lba_declaration.hpp>
@@ -13,6 +13,6 @@ namespace ControllerTest {
__declare_lba_header(LBA); __declare_lba_header(LBA);
CDFile Assets[1] = { CDFile Assets[1] = {
CDFileBuilder::simple_tim(LBA::CONT, ControllerButtonTIM), CDFileBuilder::simple_tim(LBA::CONT, Controller_png::tim),
}; };
} }

View File

@@ -1,5 +1,5 @@
#pragma once #pragma once
#include "controller_test_assets.hpp" #include "../../../../include/auto_gen/vram_layout.hpp"
#include <FontWriter/font_writer.hpp> #include <FontWriter/font_writer.hpp>
#include <PSX/GPU/make_gpu_primitives.hpp> #include <PSX/GPU/make_gpu_primitives.hpp>
#include <PSX/Periphery/controller.hpp> #include <PSX/Periphery/controller.hpp>
@@ -18,43 +18,43 @@ namespace ControllerTest {
ControllerState state; ControllerState state;
for(auto& tex_page : state.tex_page) { for(auto& tex_page : state.tex_page) {
tex_page = Make::TexPage(ControllerButtonTIM.get_texture_position(), GPU::TextureColorMode::clut4).linked(); tex_page = Make::TexPage(Controller_png::tim.get_texture_position(), GPU::TextureColorMode::clut4).linked();
} }
for(auto& buttons : state.buttons) { for(auto& buttons : state.buttons) {
// Triangle // Triangle
buttons[0] = Make::SPRT_16(Make::Vertex(71, 0).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(0, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[0] = Make::SPRT_16(Make::Vertex(71, 0).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(0, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Circle // Circle
buttons[1] = Make::SPRT_16(Make::Vertex(82, 12).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(1, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[1] = Make::SPRT_16(Make::Vertex(82, 12).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(1, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Cross // Cross
buttons[2] = Make::SPRT_16(Make::Vertex(71, 23).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(2, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[2] = Make::SPRT_16(Make::Vertex(71, 23).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(2, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Square // Square
buttons[3] = Make::SPRT_16(Make::Vertex(60, 11).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(3, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[3] = Make::SPRT_16(Make::Vertex(60, 11).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(3, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Play // Play
buttons[4] = Make::SPRT_16(Make::Vertex(51, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(4, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[4] = Make::SPRT_16(Make::Vertex(51, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(4, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Block // Block
buttons[5] = Make::SPRT_16(Make::Vertex(24, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(5, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[5] = Make::SPRT_16(Make::Vertex(24, 21).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(5, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// L1 // L1
buttons[6] = Make::SPRT_16(Make::Vertex(7, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[6] = Make::SPRT_16(Make::Vertex(7, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// L2 // L2
buttons[7] = Make::SPRT_16(Make::Vertex(7, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[7] = Make::SPRT_16(Make::Vertex(7, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// R1 // R1
buttons[8] = Make::SPRT_16(Make::Vertex(71, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[8] = Make::SPRT_16(Make::Vertex(71, 39).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(7, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// R2 // R2
buttons[9] = Make::SPRT_16(Make::Vertex(71, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[9] = Make::SPRT_16(Make::Vertex(71, 49).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(8, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// L3 // L3
buttons[10] = Make::SPRT_16(Make::Vertex(24, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[10] = Make::SPRT_16(Make::Vertex(24, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// R3 // R3
buttons[11] = Make::SPRT_16(Make::Vertex(52, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[11] = Make::SPRT_16(Make::Vertex(52, 34).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(9, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
// Connection Symbol // Connection Symbol
buttons[12] = Make::SPRT_16(Make::Vertex(37, 9).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(10, Make::SizeI16(16, 16)), Make::PageClut(ControllerButtonTIM.get_clut_position()))).linked(); buttons[12] = Make::SPRT_16(Make::Vertex(37, 9).move(offset.x, offset.y), Make::OffsetPageWithClut(GPU::PageOffset::from_tile_id16(10, Make::SizeI16(16, 16)), Make::PageClut(Controller_png::tim.get_clut_position()))).linked();
} }
for(auto& arrows : state.arrows) { for(auto& arrows : state.arrows) {
arrows[0] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect( Make::AreaI16(Make::PositionI16( 7, 5).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); arrows[0] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect( Make::AreaI16(Make::PositionI16( 7, 5).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked();
arrows[1] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect270(Make::AreaI16(Make::PositionI16(14, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); arrows[1] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect270(Make::AreaI16(Make::PositionI16(14, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked();
arrows[2] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect180(Make::AreaI16(Make::PositionI16( 7, 17).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); arrows[2] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect180(Make::AreaI16(Make::PositionI16( 7, 17).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked();
arrows[3] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect90( Make::AreaI16(Make::PositionI16( 0, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(ControllerButtonTIM.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(ControllerButtonTIM.get_clut_position())).linked(); arrows[3] = Make::POLY_FT4(__jabyengine_polyFT4_vertex_rect90( Make::AreaI16(Make::PositionI16( 0, 11).move(offset.x, offset.y), Make::SizeI16(16, 16)), Make::PositionI16(6*16, 0)), Make::TPage(Controller_png::tim.get_texture_position(), GPU::SemiTransparency::B_Half_add_F_Half, GPU::TextureColorMode::clut4), Make::PageClut(Controller_png::tim.get_clut_position())).linked();
} }
return state; return state;

View File

@@ -1,8 +0,0 @@
#pragma once
#include <PSX/File/cd_file_types.hpp>
namespace ControllerTest {
using namespace JabyEngine;
static constexpr auto ControllerButtonTIM = SimpleTIM::create(384, 0, 384, 511);
}

View File

@@ -86,10 +86,10 @@ namespace GTETest {
} }
static auto doener_fish = GTE_Sprite::create(Make::POLY_FT4( static auto doener_fish = GTE_Sprite::create(Make::POLY_FT4(
Make::AreaI16(Make::PositionI16(0, 0), Assets::Main::DoenerFishInfo.size), Make::AreaI16(Make::PositionI16(0, 0), doener_fish_png::size),
Assets::Main::DoenerFishInfo.tim.get_page_offset_clut4(), doener_fish_png::tim.get_page_offset_clut4(),
Make::TPage(Assets::Main::DoenerFishInfo.tim.get_texture_position(), GPU::SemiTransparency::B_add_F, GPU::TextureColorMode::clut4), Make::TPage(doener_fish_png::tim.get_texture_position(), GPU::SemiTransparency::B_add_F, GPU::TextureColorMode::clut4),
Make::PageClut(Assets::Main::DoenerFishInfo.tim.get_clut_position()), Make::PageClut(doener_fish_png::tim.get_clut_position()),
GPU::Color24::Grey() GPU::Color24::Grey()
).linked()); ).linked());

View File

@@ -6,8 +6,8 @@ namespace GTETest {
using namespace JabyEngine; using namespace JabyEngine;
static constexpr auto JabySTARTim = SimpleTIM::create( static constexpr auto JabySTARTim = SimpleTIM::create(
// v Doenerfisch rotates so we need some space // v Dönerfisch rotates so we need some space
Assets::Main::DoenerFishInfo.tim.get_texture_x(), Assets::Main::DoenerFishInfo.tim.get_texture_y() + Assets::Main::DoenerFishInfo.size.height + 2, doener_fish_png::tim.get_texture_x(), doener_fish_png::tim.get_texture_y() + doener_fish_png::size.height + 2,
Assets::Main::DoenerFishInfo.tim.get_clut_x() + 16, Assets::Main::DoenerFishInfo.tim.get_clut_y() doener_fish_png::tim.get_clut_x() + 16, doener_fish_png::tim.get_clut_y()
); );
} }

View File

@@ -108,8 +108,9 @@ static const Menu::SimpleMenu::Entry MenuEntries[] = {
}; };
static const auto doener_fish = Make::SPRT( static const auto doener_fish = Make::SPRT(
Make::AreaI16(Make::PositionI16(8, GPU::Display::Height - Assets::Main::DoenerFishInfo.size.height), Assets::Main::DoenerFishInfo.size), // v this needs to be nicer! Has to be Make::AreaI16(Make::PositionI16(8, GPU::Display::Height - doener_fish_png::size.height), doener_fish_png::size),
Make::OffsetPageWithClut(Assets::Main::DoenerFishInfo.tim.get_page_offset_clut4(), Make::PageClut(Assets::Main::DoenerFishInfo.tim.get_clut_position())), // v this needs to be nicer! Has to be
Make::OffsetPageWithClut(doener_fish_png::tim.get_page_offset_clut4(), Make::PageClut(doener_fish_png::tim.get_clut_position())),
GPU::Color24::Grey() GPU::Color24::Grey()
); );

View File

@@ -68,7 +68,7 @@ namespace Assets {
static const CDFile Files[] = { static const CDFile Files[] = {
CDFileBuilder::simple_tim(LBA::PACO, PacoTIM), CDFileBuilder::simple_tim(LBA::PACO, PacoTIM),
CDFileBuilder::simple_tim(LBA::DFISH, DoenerFishInfo.tim), CDFileBuilder::simple_tim(LBA::DFISH, doener_fish_png::tim),
CDFileBuilder::simple_tim(LBA::JABY_LOAD, JabyLoader::TIMLoaction), CDFileBuilder::simple_tim(LBA::JABY_LOAD, JabyLoader::TIMLoaction),
CDFileBuilder::sony_vag(LBA::APPLE_SFX, VAG::create(0, 1.0_vol)), CDFileBuilder::sony_vag(LBA::APPLE_SFX, VAG::create(0, 1.0_vol)),
CDFileBuilder::sony_vag(LBA::BLUBB_SFX, VAG::create(1, 1.0_vol)), CDFileBuilder::sony_vag(LBA::BLUBB_SFX, VAG::create(1, 1.0_vol)),

View File

@@ -2,6 +2,7 @@ include $(JABY_ENGINE_DIR)/mkfile/common/ExportPath.mk
include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk
OUTPUT_DIR = bin OUTPUT_DIR = bin
AUTO_GEN_DIR = ../application/include/auto_gen
CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans
# Ressources to convert # Ressources to convert
@@ -22,12 +23,6 @@ IconTexture_FLAGS = simple-tim clut4 --semi-trans --color-trans
INPUT += $(OUTPUT_DIR)/Paco.img INPUT += $(OUTPUT_DIR)/Paco.img
Paco_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS) Paco_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
INPUT += $(OUTPUT_DIR)/Controller.img
Controller_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
INPUT += $(OUTPUT_DIR)/doener_fish.img
doener_fish_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
INPUT += $(OUTPUT_DIR)/JabyStar.img INPUT += $(OUTPUT_DIR)/JabyStar.img
JabyStar_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS) JabyStar_FLAGS = $(CLUT_4_COLOR_TRANS_FLAGS)
@@ -60,7 +55,12 @@ $(OUTPUT_DIR)/%.tim: %.png
@mkdir -p $(OUTPUT_DIR) @mkdir -p $(OUTPUT_DIR)
psxfileconv --lz4 $< -o $@ $($*_TIM_FLAGS) psxfileconv --lz4 $< -o $@ $($*_TIM_FLAGS)
all: $(INPUT) $(AUTO_GEN_DIR)/vram_layout.hpp: tim_example.tim_project Controller.png doener_fish.png
@mkdir -p $(AUTO_GEN_DIR)
psxfileconv tim_example.tim_project -o $(OUTPUT_DIR)/dummy.img project --hpp $(AUTO_GEN_DIR)/vram_layout.hpp
all: $(INPUT) $(AUTO_GEN_DIR)/vram_layout.hpp
clean: clean:
rm -fr $(OUTPUT_DIR) rm -fr $(OUTPUT_DIR)
rm -fr $(AUTO_GEN_DIR)

View File

@@ -0,0 +1 @@
{"jobs":[{"name":"doener_fish.png","file_path":"doener_fish.png","image_pos":{"x":926,"y":0},"palette_rect":{"pos":{"x":976,"y":510},"size":{"width":16,"height":1}},"settings":{"compress":true,"transparency":"FirstColor","encoding":"FourBit"}},{"name":"Controller.png","file_path":"Controller.png","image_pos":{"x":384,"y":0},"palette_rect":{"pos":{"x":384,"y":511},"size":{"width":16,"height":1}},"settings":{"compress":true,"transparency":"FirstColor","encoding":"FourBit"}}]}

View File

@@ -224,7 +224,7 @@ namespace JabyEngine {
return Size::create(static_cast<T>(size.width), static_cast<T>(size.height)); return Size::create(static_cast<T>(size.width), static_cast<T>(size.height));
} }
auto operator<=>(const Size<T>&) const = default; bool operator<=>(const Size<T>&) const = default;
}; };
using SizeI8 = Size<int8_t>; using SizeI8 = Size<int8_t>;
using SizeU8 = Size<uint8_t>; using SizeU8 = Size<uint8_t>;

View File

@@ -19,13 +19,13 @@
{ {
"label": "make", "label": "make",
"type": "shell", "type": "shell",
"command": "../../scripts/podman_jaby_engine.sh ../../:src/Library make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}", "command": "../../scripts/podman_jaby_engine.sh ../../:src/Library bear --output ${workspaceFolder}/../../compile_commands.json -- make ${input:target} BUILD_PROFILE=${input:build cfg} PSX_TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:config options}",
"group": "build" "group": "build"
}, },
{ {
"label": "make_all", "label": "make_all",
"type": "shell", "type": "shell",
"command": "../../scripts/podman_jaby_engine.sh ../../:src/Library make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}", "command": "../../scripts/podman_jaby_engine.sh ../../:src/Library bear --output ${workspaceFolder}/../../compile_commands.json -- make -f MakeAll.mk ${input:target prefix}_${input:target} BUILD_PROFILE=${input:build cfg} CUSTOM_CONFIG=${input:config options}",
"group": "build" "group": "build"
} }
], ],
@@ -75,29 +75,5 @@
}, },
"settings": { "settings": {
"cmake.configureOnOpen": false, "cmake.configureOnOpen": false,
"C_Cpp.default.includePath": [
"include",
"../../include"
],
"C_Cpp.default.compilerPath": "",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.intelliSenseMode": "linux-gcc-x86",
"C_Cpp.default.compilerArgs": [
],
"C_Cpp.default.defines": [
"JABYENGINE_PAL",
"__DEBUG_SPU_MMU__",
"__friends=public"
],
"files.exclude": {
"**/*.o": true,
"**/*.dep": true
},
"files.associations": {
"stdio.h": "c",
"TUTO0.C": "cpp",
"MAIN.C": "cpp"
}
} }
} }

View File

@@ -1,7 +1,6 @@
**/target **/target
Input/** Input/**
Output/** Output/**
*.lock
**/Tests/Test_*.* **/Tests/Test_*.*
**/Planschbecken.bin **/Planschbecken.bin

324
src/Tools/cdtypes/Cargo.lock generated Normal file
View File

@@ -0,0 +1,324 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

564
src/Tools/cpp_out/Cargo.lock generated Normal file
View File

@@ -0,0 +1,564 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpp_out"
version = "1.0.2"
dependencies = [
"clap",
"tool_helper",
]
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]
[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hound"
version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "lz4"
version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4"
dependencies = [
"lz4-sys",
]
[[package]]
name = "lz4-sys"
version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tool_helper"
version = "1.0.0"
dependencies = [
"byteorder",
"cdtypes",
"colored",
"envmnt",
"hound",
"lz4",
"paste",
"wslpath",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

615
src/Tools/mkoverlay/Cargo.lock generated Normal file
View File

@@ -0,0 +1,615 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]
[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hound"
version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "itoa"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "lz4"
version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4"
dependencies = [
"lz4-sys",
]
[[package]]
name = "lz4-sys"
version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "mkoverlay"
version = "1.6.0"
dependencies = [
"clap",
"serde_json",
"tool_helper",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "ryu"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
[[package]]
name = "serde"
version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
dependencies = [
"itoa",
"memchr",
"ryu",
"serde",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tool_helper"
version = "1.0.0"
dependencies = [
"byteorder",
"cdtypes",
"colored",
"envmnt",
"hound",
"lz4",
"paste",
"wslpath",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

619
src/Tools/psxcdgen_ex/Cargo.lock generated Normal file
View File

@@ -0,0 +1,619 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys",
]
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "derive_more"
version = "0.99.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"rustc_version",
"syn",
]
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]
[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hound"
version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "lz4"
version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4"
dependencies = [
"lz4-sys",
]
[[package]]
name = "lz4-sys"
version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "no-comment"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ff23a789e582e05fed839d8576254d86596b9cc896783a508f658c8c55ac2ce"
dependencies = [
"derive_more",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "psxcdgen_ex"
version = "1.1.1"
dependencies = [
"cdtypes",
"clap",
"colored",
"hound",
"no-comment",
"paste",
"roxmltree",
"tool_helper",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "roxmltree"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f"
[[package]]
name = "rustc_version"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
dependencies = [
"semver",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "semver"
version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tool_helper"
version = "1.0.0"
dependencies = [
"byteorder",
"cdtypes",
"colored",
"envmnt",
"hound",
"lz4",
"paste",
"wslpath",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

331
src/Tools/psxcdread/Cargo.lock generated Normal file
View File

@@ -0,0 +1,331 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "psxcdread"
version = "0.7.0"
dependencies = [
"cdtypes",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

6838
src/Tools/psxfileconv/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -28,11 +28,15 @@ symphonia-vorbis = ["symphonia", "symphonia/vorbis"]
[dependencies] [dependencies]
bitflags = "2.8.0" bitflags = "2.8.0"
cdtypes = {path = "../cdtypes"} cdtypes = {path = "../cdtypes"}
cpp_out = {path = "../cpp_out"}
clap = {version = "4.5.27", features = ["derive"]} clap = {version = "4.5.27", features = ["derive"]}
image = "0.24.9" image = "0.24.9"
hound = "3.5.1" hound = "3.5.1"
paste = "1.0.15" paste = "1.0.15"
png = "0.17.16" png = "0.17.16"
rubato = "0.16.1" rubato = "0.16.1"
serde = {version = "1.0.219", features = ["derive"]}
serde_json = "1.0"
symphonia = {version = "0.5.4", optional = true, default-features = false} symphonia = {version = "0.5.4", optional = true, default-features = false}
tim_tool = {path = "../tim_tool"}
tool_helper = {path = "../tool_helper"} tool_helper = {path = "../tool_helper"}

View File

@@ -36,7 +36,8 @@ fn modify_palette(mut image: IndexedImage, clut_align: ClutAlignment, semi_trans
image image
} }
fn encode<T: PSXImageConverter>(header_conv: &mut dyn HeaderEncoder, image: T, tex_pos: Point, clut_pos: Point, color_depth: ColorType, clut_align: ClutAlignment, output: &mut dyn Write) -> Result<(), Error> { fn encode<T: PSXImageConverter>(header_conv: &mut dyn HeaderEncoder, image: T, tex_pos: Point, clut_pos: Point, color_depth: ColorType, clut_align: ClutAlignment, output: &mut dyn Write) -> Result<(u16, u16), Error> {
let image_size = (image.width(), image.height());
let (width, height) = { let (width, height) = {
fn return_error(clut_type: u32, div: u32, width: u16, height: u16) -> Result<(u16, u16), Error> { fn return_error(clut_type: u32, div: u32, width: u16, height: u16) -> Result<(u16, u16), Error> {
return Err(Error::from_callback(|| {format!("CLUT {} images require a width divideable by {} (found width: {}/{}={}, height: {})", clut_type, div, width, div, (width as f32/div as f32), height)})); return Err(Error::from_callback(|| {format!("CLUT {} images require a width divideable by {} (found width: {}/{}={}, height: {})", clut_type, div, width, div, (width as f32/div as f32), height)}));
@@ -115,10 +116,10 @@ fn encode<T: PSXImageConverter>(header_conv: &mut dyn HeaderEncoder, image: T, t
tool_helper::raw::write_raw(output, &color)?; tool_helper::raw::write_raw(output, &color)?;
} }
Ok(()) Ok(image_size)
} }
fn convert_full16(header_conv: &mut dyn HeaderEncoder, input: Input, output: &mut dyn Write, tex_pos: Point) -> Result<(), Error> { fn convert_full16(header_conv: &mut dyn HeaderEncoder, input: Input, output: &mut dyn Write, tex_pos: Point) -> Result<(u16, u16), Error> {
match ImageReader::new(Cursor::new(tool_helper::input_to_vec(input)?)).with_guessed_format()?.decode() { match ImageReader::new(Cursor::new(tool_helper::input_to_vec(input)?)).with_guessed_format()?.decode() {
Ok(image) => { Ok(image) => {
match image { match image {
@@ -132,7 +133,7 @@ fn convert_full16(header_conv: &mut dyn HeaderEncoder, input: Input, output: &mu
} }
} }
fn convert_palette_based(header_conv: &mut dyn HeaderEncoder, input: Input, output: &mut dyn Write, tex_pos: Point, clut_pos: Point, color_type: ColorType, clut_align: ClutAlignment, semi_transparent: bool, transparent_palette: bool) -> Result<(), Error> { fn convert_palette_based(header_conv: &mut dyn HeaderEncoder, input: Input, output: &mut dyn Write, tex_pos: Point, clut_pos: Point, color_type: ColorType, clut_align: ClutAlignment, semi_transparent: bool, transparent_palette: bool) -> Result<(u16, u16), Error> {
match png::Decoder::new(input).read_info() { match png::Decoder::new(input).read_info() {
Ok(reader) => { Ok(reader) => {
let output_type = { let output_type = {

View File

@@ -7,7 +7,7 @@ use tool_helper::{Error, Input};
pub type Arguments = super::args::Arguments; pub type Arguments = super::args::Arguments;
pub fn convert(args: Arguments, input: Input, output: &mut dyn Write) -> Result<(), Error> { pub fn convert(args: Arguments, input: Input, output: &mut dyn Write) -> Result<(u16, u16), Error> {
let mut header_conv = Header::default(); let mut header_conv = Header::default();
match args.color_depth { match args.color_depth {
ColorType::Full16 => super::convert_full16(&mut header_conv, input, output, Point::default()), ColorType::Full16 => super::convert_full16(&mut header_conv, input, output, Point::default()),

View File

@@ -9,16 +9,16 @@ use tool_helper::{Error, Input};
#[derive(Args)] #[derive(Args)]
pub struct Arguments { pub struct Arguments {
#[clap(flatten)] #[clap(flatten)]
global: super::args::Arguments, pub(crate) global: super::args::Arguments,
#[clap(long, value_parser, default_value_t, value_name = Point::POINT_VALUE_NAME)] #[clap(long, value_parser, default_value_t, value_name = Point::POINT_VALUE_NAME)]
clut_pos: Point, pub(crate) clut_pos: Point,
#[clap(long, value_parser, default_value_t, value_name = Point::POINT_VALUE_NAME)] #[clap(long, value_parser, default_value_t, value_name = Point::POINT_VALUE_NAME)]
tex_pos: Point, pub(crate) tex_pos: Point,
} }
pub fn convert(args: Arguments, input: Input, output: &mut dyn Write) -> Result<(), Error> { pub fn convert(args: Arguments, input: Input, output: &mut dyn Write) -> Result<(u16, u16), Error> {
let global_args = args.global; let global_args = args.global;
let mut header_conv = Header::default(); let mut header_conv = Header::default();

View File

@@ -1,3 +1,88 @@
pub mod audio; pub mod audio;
pub mod images; pub mod images;
pub mod nothing; pub mod nothing;
pub mod project;
use crate::audio::*;
use crate::images::*;
use clap::Subcommand;
use std::path::PathBuf;
use tool_helper::Error;
#[derive(Subcommand)]
pub enum SubCommands {
Nothing,
SimpleTIM(reduced_tim::Arguments),
TIM(tim::Arguments),
VAG(vag::Arguments),
XA(xa::Arguments),
Project(project::Arguments),
}
pub fn run_subcommand(compress_lz4: bool, input_path: Option<PathBuf>, output_path: Option<PathBuf>, sub_command: SubCommands) -> Result<Option<(u16, u16)>, Error> {
let mut input = tool_helper::open_input(&input_path)?;
let mut buffer = Vec::<u8>::new();
let mut output_file = tool_helper::open_output(&output_path)?;
let dst_buffer = {
if compress_lz4 {
&mut buffer as &mut dyn std::io::Write
}
else {
&mut output_file as &mut dyn std::io::Write
}
};
let cmd_result: Result<Option<(u16, u16)>, Error> = {
match sub_command {
SubCommands::Nothing => {
nothing::copy(&mut input, dst_buffer)?;
Ok(None)
},
SubCommands::SimpleTIM(args) => {
Ok(Some(reduced_tim::convert(args, input, dst_buffer)?))
},
SubCommands::TIM(args) => {
Ok(Some(tim::convert(args, input, dst_buffer)?))
},
SubCommands::VAG(args) => {
audio::vag::convert(args, &output_path, input, dst_buffer)?;
Ok(None)
}
SubCommands::XA(args) => {
audio::xa::convert(args, input, dst_buffer)?;
Ok(None)
}
SubCommands::Project(args) => {
project::run_project(input, args, input_path, &output_path)?;
if let Some(file_path) = &output_path {
let _result = std::fs::remove_file(file_path);
}
Ok(None)
},
}
};
match cmd_result {
Ok(cmd_result) => {
// We encoded the file to a temporary buffer and now need to write it
if compress_lz4 {
let buffer = tool_helper::compress::psx_default::lz4(&buffer)?;
output_file.write(&buffer)?;
}
Ok(cmd_result)
}
Err(cmd_error) => {
if let Some(file_path) = output_path {
let _result = std::fs::remove_file(file_path);
}
else {
tool_helper::print_warning("Open stream detected! Incomplete file can not be deleted".to_owned());
}
Err(cmd_error)
}
}
}

View File

@@ -1,11 +1,11 @@
use clap::{Parser, Subcommand}; use clap::Parser;
use psxfileconv::{audio::{self, *}, images::*, nothing};
use std::path::PathBuf; use std::path::PathBuf;
use tool_helper::{exit_with_error, Error}; use psxfileconv::{SubCommands, run_subcommand};
use tool_helper::exit_with_error;
#[derive(Parser)] #[derive(Parser)]
#[clap(about = "Converts files to various JabyEngine related file formats", long_about = None)] #[clap(about = "Converts files to various JabyEngine related file formats", long_about = None)]
struct CommandLine { pub struct CommandLine {
#[clap(long="lz4", default_value_t=false)] #[clap(long="lz4", default_value_t=false)]
compress_lz4: bool, compress_lz4: bool,
@@ -19,64 +19,10 @@ struct CommandLine {
sub_command: SubCommands, sub_command: SubCommands,
} }
#[derive(Subcommand)]
enum SubCommands {
Nothing,
SimpleTIM(reduced_tim::Arguments),
TIM(tim::Arguments),
VAG(vag::Arguments),
XA(xa::Arguments),
}
fn run_main(cmd: CommandLine) -> Result<(), Error> {
let mut input = tool_helper::open_input(&cmd.input_file)?;
let mut buffer = Vec::<u8>::new();
let mut output_file = tool_helper::open_output(&cmd.output_file)?;
let dst_buffer = {
if cmd.compress_lz4 {
&mut buffer as &mut dyn std::io::Write
}
else {
&mut output_file as &mut dyn std::io::Write
}
};
let cmd_result: Result<(), Error> = {
match cmd.sub_command {
SubCommands::Nothing => nothing::copy(&mut input, dst_buffer),
SubCommands::SimpleTIM(args) => reduced_tim::convert(args, input, dst_buffer),
SubCommands::TIM(args) => tim::convert(args, input, dst_buffer),
SubCommands::VAG(args) => audio::vag::convert(args, &cmd.output_file, input, dst_buffer),
SubCommands::XA(args) => audio::xa::convert(args, input, dst_buffer),
}
};
if let Err(cmd_error) = cmd_result {
if let Some(file_path) = cmd.output_file {
let _result = std::fs::remove_file(file_path);
}
else {
tool_helper::print_warning("Open stream detected! Incomplete file can not be deleted".to_owned());
}
return Err(cmd_error);
}
// We encoded the file to a temporary buffer and now need to write it
if cmd.compress_lz4 {
let buffer = tool_helper::compress::psx_default::lz4(&buffer)?;
output_file.write(&buffer)?;
}
Ok(())
}
fn main() { fn main() {
match CommandLine::try_parse() { match CommandLine::try_parse() {
Ok(cmd) => { Ok(cmd) => {
if let Err(error) = run_main(cmd) { if let Err(error) = run_subcommand(cmd.compress_lz4, cmd.input_file, cmd.output_file, cmd.sub_command) {
exit_with_error(error); exit_with_error(error);
} }
}, },

View File

@@ -0,0 +1,39 @@
use std::path::PathBuf;
use tim_tool::logic::project::Job;
use tool_helper::{Error, Output};
pub struct CppHeader {
file_out: Output,
}
impl CppHeader {
pub fn new(file_path: &Option<PathBuf>) -> Result<CppHeader, Error> {
let mut file_out = tool_helper::open_output(file_path)?;
writeln!(file_out, "#pragma once")?;
writeln!(file_out, "#include <PSX/File/cd_file_types.hpp>")?;
writeln!(file_out, "")?;
Ok(CppHeader{file_out})
}
pub fn push_job(&mut self, job: &Job, size: (u16, u16)) -> Result<(), Error> {
let name = job.name.replace('.', "_");
let (clut_x, clut_y) = if let Some(palette_rect) = &job.palette_rect {(palette_rect.pos.x, palette_rect.pos.y)} else {(0, 0)};
writeln!(self.file_out, "namespace {} {{", name)?;
writeln!(self.file_out, "\tusing namespace JabyEngine;")?;
writeln!(self.file_out, "")?;
writeln!(self.file_out, "\tstatic constexpr auto tim = SimpleTIM::create({}, {}, {}, {});", job.image_pos.x, job.image_pos.y, clut_x, clut_y)?;
writeln!(self.file_out, "\tstatic constexpr auto size = GPU::SizeI16::create({}, {});", size.0, size.1)?;
writeln!(self.file_out, "}}")?;
Ok(())
}
}
impl Drop for CppHeader {
fn drop(&mut self) {
}
}

View File

@@ -0,0 +1,90 @@
mod hpp_out;
use crate::images::args::{Arguments as IMGArguments, ClutAlignment, ColorType};
use clap::Args;
use hpp_out::CppHeader;
use std::path::PathBuf;
use tool_helper::{Error, Input};
use tim_tool::logic::{tim::types::Encoding, project::*};
#[derive(Args)]
pub struct Arguments {
#[clap(long="hpp", value_parser)]
hpp_out_path: Option<PathBuf>
}
pub fn run_project(input: Input, args: Arguments, input_path: Option<PathBuf>, output_path: &Option<PathBuf>) -> Result<(), Error> {
let location_path = if let Some(input_path) = input_path {input_path} else {PathBuf::from(".")};
let output_path = if let Some(output_path) = &output_path {
let mut output_path = output_path.clone();
if output_path.is_file() {
output_path.pop();
}
output_path
} else {PathBuf::from(".")};
let project = serde_json::from_reader::<Input, Project>(input).map_err(|error|{Error::from_text(format!("Reading project failed: {}", error))})?;
let mut hpp_out = CppHeader::new(&args.hpp_out_path)?;
for mut job in project.jobs {
let args = to_arguments(&job)?;
let output_path = {
let mut path = output_path.clone();
path.push(&job.name);
path.set_extension("img");
path
};
let sub_command = crate::SubCommands::SimpleTIM(args);
let org_img_size = crate::run_subcommand(job.settings.compress, Some(Job::create_file_path(job.file_path, &location_path)), Some(output_path), sub_command)?;
job.file_path = PathBuf::new();
hpp_out.push_job(&job, org_img_size.unwrap_or((0, 0)))?;
}
Ok(())
}
fn to_arguments(job: &Job) -> Result<IMGArguments, Error> {
let (semi_transparent, transparent_palette) = get_transparency(&job.settings.transparency);
return Ok(IMGArguments {
color_depth: get_encoding(&job.settings.encoding),
clut_align: get_palette_rect(&job.palette_rect)?,
semi_transparent,
transparent_palette,
});
fn get_transparency(transparency: &Transparency) -> (bool, bool) {
match transparency {
Transparency::None => (false, false),
Transparency::FirstColor => (false, true),
Transparency::PSXSemi => (true, false),
Transparency::Both => (true, true),
}
}
fn get_encoding(encoding: &Encoding) -> ColorType {
match encoding {
Encoding::FourBit => ColorType::Clut4,
Encoding::EightBit => ColorType::Clut8,
Encoding::FullColor => ColorType::Full16,
}
}
fn get_palette_rect(rect: &Option<PaletteRect>) -> Result<ClutAlignment, Error> {
if let Some(rect) = rect {
if rect.size.height == 1 {
return Ok(ClutAlignment::Linear);
}
if rect.size.width%16 == 0 {
return Ok(ClutAlignment::Block);
}
return Err(Error::from_text(format!("psxfileconv currently only supports linear or block CLUTs with a width of 16px")));
}
Ok(ClutAlignment::None)
}
}

941
src/Tools/psxreadmap/Cargo.lock generated Normal file
View File

@@ -0,0 +1,941 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "allocator-api2"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys 0.59.0",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bitflags"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cassowary"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets 0.52.6",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.96",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys 0.48.0",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "crossterm"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
dependencies = [
"bitflags",
"crossterm_winapi",
"libc",
"mio",
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi",
]
[[package]]
name = "crossterm_winapi"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
dependencies = [
"winapi",
]
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "either"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "foldhash"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f"
[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
]
[[package]]
name = "heck"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hound"
version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
]
[[package]]
name = "indoc"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "itertools"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
dependencies = [
"either",
]
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "lock_api"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "lru"
version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
dependencies = [
"hashbrown 0.15.2",
]
[[package]]
name = "lz4"
version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4"
dependencies = [
"lz4-sys",
]
[[package]]
name = "lz4-sys"
version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "mio"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",
"wasi",
"windows-sys 0.48.0",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "parking_lot"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-targets 0.52.6",
]
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "psxreadmap"
version = "1.0.0"
dependencies = [
"clap",
"crossterm",
"ratatui",
"readmap",
"tool_helper",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ratatui"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5659e52e4ba6e07b2dad9f1158f578ef84a73762625ddb51536019f34d180eb"
dependencies = [
"bitflags",
"cassowary",
"crossterm",
"indoc",
"itertools",
"lru",
"paste",
"stability",
"strum",
"unicode-segmentation",
"unicode-width",
]
[[package]]
name = "readmap"
version = "1.0.0"
dependencies = [
"num-traits",
"tool_helper",
]
[[package]]
name = "redox_syscall"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834"
dependencies = [
"bitflags",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "signal-hook"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801"
dependencies = [
"libc",
"signal-hook-registry",
]
[[package]]
name = "signal-hook-mio"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
dependencies = [
"libc",
"mio",
"signal-hook",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
dependencies = [
"libc",
]
[[package]]
name = "smallvec"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "stability"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce"
dependencies = [
"quote",
"syn 1.0.109",
]
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "strum"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
dependencies = [
"strum_macros",
]
[[package]]
name = "strum_macros"
version = "0.25.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.96",
]
[[package]]
name = "syn"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tool_helper"
version = "1.0.0"
dependencies = [
"byteorder",
"cdtypes",
"colored",
"envmnt",
"hound",
"lz4",
"paste",
"wslpath",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "unicode-segmentation"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "unicode-width"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn 2.0.96",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.96",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [
"windows_aarch64_gnullvm 0.48.5",
"windows_aarch64_msvc 0.48.5",
"windows_i686_gnu 0.48.5",
"windows_i686_msvc 0.48.5",
"windows_x86_64_gnu 0.48.5",
"windows_x86_64_gnullvm 0.48.5",
"windows_x86_64_msvc 0.48.5",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

6503
src/Tools/tim_tool/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,23 @@
[package] [package]
name = "tim_tool" name = "tim_tool"
version = "0.1.0" version = "1.0.0"
edition = "2021" edition = "2021"
[profile.release] [profile.release]
panic = "abort" panic = "abort"
[dependencies] [dependencies]
pathdiff = "0.2.3"
png = "0.17.16" png = "0.17.16"
rfd = "0.15.2" rfd = "0.15.3"
slint = "1.9.2" slint = "1.10.0"
serde = {version = "1.0.219", features = ["derive"]}
serde_json = "1.0"
tiny-skia = "0.11.4" tiny-skia = "0.11.4"
tool_helper = {path = "../tool_helper"} tool_helper = {path = "../tool_helper"}
[build-dependencies] [build-dependencies]
slint-build = "1.9.2" slint-build = "1.10.0"
[package.metadata.bundle] [package.metadata.bundle]
name = "TIMTOOL" name = "TIMTOOL"

View File

@@ -1,63 +0,0 @@
use crate::MainWindow;
use super::{GUIElements, GUIElementsRef, MainWindowRef, display_error};
use slint::Image;
use tool_helper::Error;
pub struct FileTab {
main_window: MainWindowRef
}
impl FileTab {
pub fn new(main_window: MainWindowRef) -> FileTab {
FileTab{main_window}
}
pub fn clear_load(&self) {
let main_window = self.main_window.borrow();
main_window.set_file_tab_browse_path("".into());
main_window.set_file_tab_image_data(Image::default());
main_window.set_file_tab_image_name("".into());
main_window.set_file_tab_enable(false);
}
pub fn update_new_load(&self, file_name: Option<String>, image: Image) {
let main_window = self.main_window.borrow();
main_window.set_file_tab_image_data(image);
if let Some(file_name) = file_name {
main_window.set_file_tab_image_name(file_name.into());
}
else {
main_window.set_file_tab_image_name("".into());
}
main_window.set_file_tab_enable(true);
}
pub fn get_file_name(&self) -> String {
self.main_window.borrow().get_file_tab_image_name().to_string()
}
pub fn on_browse_file(&self, gui_elements: GUIElementsRef, mut function: impl FnMut(&mut GUIElements, &MainWindow) -> Result<(), Error> + 'static) {
let main_window_cloned = self.main_window.clone();
let gui_cloned = gui_elements.clone();
self.main_window.borrow().on_file_tab_browse_convert_image(move || {
if let Err(error) = function(&mut gui_cloned.borrow_mut(), &main_window_cloned.borrow()) {
display_error("Loadind file failed", &error.to_string());
}
});
}
pub fn on_add_image(&self, gui_elements: GUIElementsRef, mut function: impl FnMut(&mut GUIElements, &MainWindow) -> Result<(), Error> + 'static) {
let main_window_cloned = self.main_window.clone();
let gui_cloned = gui_elements.clone();
self.main_window.borrow().on_file_tab_add_convert_image(move || {
if let Err(error) = function(&mut gui_cloned.borrow_mut(), &main_window_cloned.borrow()) {
display_error("Adding file failed", &error.to_string());
}
});
}
}

View File

@@ -0,0 +1,252 @@
use std::{fs::File, io::Write, path::PathBuf};
use crate::{gui::{self, main_tab::{MainTab, NewVRAMImageInfo}, MutexTIMManager, VRAM_HEIGHT, VRAM_WIDTH}, MainWindow};
use super::FileTab;
use rfd::FileDialog;
use slint::SharedString;
use tim_tool::logic::{project::{FileSettings, ImagePosition, Job, PaletteRect, Project, Transparency}, tim::types::Encoding, TIMManager};
use tool_helper::Error;
pub(super) fn on_browse_file(tim_manager: MutexTIMManager) -> impl FnMut(&mut FileTab, &MainWindow) -> Result<(), Error> + 'static {
return move |file_tab, main_window| -> Result<(), Error> {
let file = FileDialog::new()
.add_filter("PNG image (.png)", &["png"])
.set_title("PNG image file")
.pick_file();
if let Some(file) = file {
if let Some(file_path) = file.to_str() {
main_window.set_file_tab_browse_path(SharedString::from(file_path));
}
let file_name = if let Some(name) = file.file_name() {Some(name.to_string_lossy().to_string())} else {None};
let (image, palette) = tim_manager.lock().expect("VRAM already locked").load_unadded_tim(&file)?;
let img_size = image.size();
if img_size.width > VRAM_WIDTH as u32 || img_size.height > VRAM_HEIGHT as u32 {
return Err(Error::from_text(format!("Image size ({}; {}) is to big for VRAM ({}, {})", img_size.width, img_size.height, VRAM_WIDTH, VRAM_HEIGHT)));
}
return file_tab.update_new_loaded_file(file_name, image, palette);
}
Ok(())
};
}
pub(super) fn on_update_palette_size(tim_manager: MutexTIMManager) -> impl FnMut(&mut FileTab, &MainWindow, u16, u16) -> Result<(), Error> + 'static {
return move |file_tab, _main_window, width, height| -> Result<(), Error> {
file_tab.update_palette(tim_manager.lock().expect("VRAM already locked").change_unadded_tim_palette_size(width, height)?);
Ok(())
};
}
pub(super) fn on_add_image(tim_manager: MutexTIMManager) -> impl FnMut(&mut FileTab, &mut MainTab, &MainWindow) -> Result<(), Error> + 'static {
return move |file_tab, main_tab, main_window| {
let file_name = file_tab.get_file_name();
let encoding = file_tab.get_encoding()?;
add_unadded_tim(main_tab, &mut tim_manager.lock().expect("VRAM already locked"), UnaddedTIM::new(&file_name, encoding), FileSettings::from_encoding(encoding))?;
file_tab.clear_load();
main_window.invoke_change_to_main();
Ok(())
};
}
pub(super) fn on_load_project_clicked(tim_manager: MutexTIMManager) -> impl FnMut(&mut FileTab, &mut MainTab, &MainWindow) -> Result<(), Error> + 'static {
move |_file_tab, main_tab, main_window| {
let open_location = main_window.get_project_widget_open_project_path();
if open_location.is_empty() {
return Err(Error::from_str("Please specify location for project file to open"));
}
let file_content = tool_helper::read_file_to_string(&PathBuf::from(open_location.as_str()))?;
let new_project = match serde_json::from_str::<Project>(&file_content) {
Ok(project) => project,
Err(error) => {
return Err(Error::from_error(error));
}
};
let mut tim_manager = tim_manager.lock().expect("VRAM already locked");
if !main_window.get_project_widget_append_project_elements() {
clear_all_vram_images(main_tab, &mut tim_manager);
main_window.invoke_clear_file_tab_current_selected_file();
}
for job in new_project.jobs {
let file_path = Job::create_file_path(job.file_path, open_location.as_str());
let (_, _) = tim_manager.load_unadded_tim(&file_path)?;
let (pal_x, pal_y, pal_width, pal_height) = if let Some(palette_rect) = job.palette_rect {palette_rect.into()} else {(0, 0, 0, 0)};
tim_manager.change_unadded_tim_palette_size(pal_width, pal_height)?;
let unadded_tim = UnaddedTIM{
file_name: &job.name,
image_x: job.image_pos.x,
image_y: job.image_pos.y,
palette_x: pal_x,
palette_y: pal_y,
encoding: job.settings.encoding
};
add_unadded_tim(main_tab, &mut tim_manager, unadded_tim, job.settings)?;
}
main_window.invoke_change_to_main();
Ok(())
}
}
pub(super) fn on_save_project_clicked(tim_manager: MutexTIMManager) -> impl FnMut(&mut FileTab, &MainTab, &MainWindow) -> Result<(), Error> + 'static {
move |_file_tab, main_tab, main_window| {
let save_location = main_window.get_project_widget_save_project_path();
if save_location.is_empty() {
return Err(Error::from_str("Please specify save location for project file"));
}
let tim_info = tim_manager.lock().expect("VRAM already locked").clone_added_tims();
let vram_info = main_tab.clone_vram_info();
let use_rel_path = main_window.get_project_widget_use_rel_paths();
if tim_info.len() != vram_info.len() {
return Err(Error::from_str("TIM and VRAM info not in sync! Please close program"));
}
let mut cur_job:Option<Job> = None;
let mut cur_palette:Option<PaletteRect> = None;
let mut map_result = Ok(());
let mut project = Project::new(tim_info.into_iter().zip(vram_info.into_iter()).filter_map(|(tim, (name, vram))| {
if map_result.is_err() {
return None;
}
if vram.is_palette {
let cur_palette = std::mem::replace(&mut cur_palette, None);
if let Some(mut cur_palette) = cur_palette {
cur_palette.pos = ImagePosition::new(vram.x as u16, vram.y as u16);
if let Some(cur_job) = &mut cur_job {
cur_job.palette_rect = Some(cur_palette);
}
}
None
}
else {
// We are done with the old job
let prev_job = std::mem::replace(&mut cur_job, None);
if let Some(tim) = tim {
if let Some((width, height)) = tim.get_palette_size() {
cur_palette = Some(PaletteRect::new(0, 0, width, height));
}
let file_path = if use_rel_path {
match tim.get_path_rel_to(PathBuf::from(save_location.as_str())) {
Ok(file_path) => file_path,
Err(error) => {
map_result = Err(error);
PathBuf::new()
}
}
} else {tim.get_path()};
cur_job = Some(Job::new(name, file_path, (vram.x as u16, vram.y as u16), FileSettings::new(
vram.use_compression,
Transparency::from(vram.trans_setting),
Encoding::from_str(vram.encoding_str.as_str())
)));
}
prev_job
}
}).collect());
map_result?;
if let Some(cur_job) = cur_job {
project.jobs.push(cur_job);
}
let json_content = match serde_json::to_string(&project) {
Ok(json_content) => json_content,
Err(error) => {
return Err(Error::from_error(error));
}
};
let mut file = File::create(save_location)?;
file.write_all(json_content.as_bytes())?;
gui::display_information("Saving project", "Project saved successfully");
Ok(())
}
}
pub(super) fn on_browse_open_project_clicked() -> impl FnMut(&mut FileTab, &MainWindow) -> Result<(), Error> + 'static {
move |_file_tab, main_window| {
let file_path = create_project_file_dialog()
.set_title("Save location for TIM project file")
.pick_file();
if let Some(file_path) = file_path {
if let Some(file_path) = file_path.to_str() {
main_window.set_project_widget_open_project_path(SharedString::from(file_path));
}
}
Ok(())
}
}
pub(super) fn on_browse_save_project_clicked() -> impl FnMut(&mut FileTab, &MainWindow) -> Result<(), Error> + 'static {
move |_file_tab, main_window| {
let file_path = create_project_file_dialog()
.set_title("Save location for TIM project file")
.save_file();
if let Some(file_path) = file_path {
if let Some(file_path) = file_path.to_str() {
main_window.set_project_widget_save_project_path(SharedString::from(file_path));
}
}
Ok(())
}
}
struct UnaddedTIM<'a> {
pub file_name: &'a String,
pub image_x: u16,
pub image_y: u16,
pub palette_x: u16,
pub palette_y: u16,
pub encoding: Encoding,
}
impl<'a> UnaddedTIM<'a> {
pub fn new(file_name: &String, encoding: Encoding,) -> UnaddedTIM {
UnaddedTIM{file_name, image_x: 0, image_y: 0, palette_x: 0, palette_y: 0, encoding}
}
}
fn add_unadded_tim(main_tab: &mut MainTab, tim_manager: &mut TIMManager, unadded_tim: UnaddedTIM, settings: FileSettings) -> Result<(), Error> {
let (image, palette_image) = tim_manager.get_converted_unadded_tim_image(unadded_tim.encoding)?;
let (full_image, _) = tim_manager.get_converted_unadded_tim_image(Encoding::FullColor)?;
let image = NewVRAMImageInfo::new(image, unadded_tim.image_x, unadded_tim.image_y, settings);
let palette_image = if let Some(palette_image) = palette_image { Some(NewVRAMImageInfo::new(palette_image, unadded_tim.palette_x, unadded_tim.palette_y, FileSettings::from_encoding(Encoding::FullColor))) } else { None };
let images_created = main_tab.add_new_vram_file(unadded_tim.file_name, full_image, image, palette_image);
if let Err(error) = tim_manager.add_unadded_tim(images_created) {
main_tab.pop_vram_files(images_created);
return Err(error);
}
Ok(())
}
fn clear_all_vram_images(main_tab: &mut MainTab, tim_manager: &mut TIMManager) {
tim_manager.clear();
main_tab.clear();
}
fn create_project_file_dialog() -> FileDialog {
FileDialog::new()
.add_filter("TIM project file (.tim_project)", &["tim_project"])
.add_filter("JSON file (.json; .jsn)", &["json", "jsn"])
.add_filter("All", &["*"])
}

View File

@@ -0,0 +1,188 @@
mod callbacks;
use crate::gui::MutexTIMManager;
use super::{main_tab::SharedMainTab, MainWindowRef, display_error};
use slint::{Image, SharedString};
use std::{cell::RefCell, rc::Rc};
use tim_tool::logic::tim::types::Encoding;
use tool_helper::Error;
pub struct FileTab {
main_window: MainWindowRef,
encoding_options: Rc<slint::VecModel<SharedString>>
}
pub type SharedFileTab = Rc<RefCell<FileTab>>;
impl FileTab {
fn update_encoding_options(&self, width: u32, height: u32, has_palette: bool) -> Result<&str, Error> {
self.encoding_options.clear();
if has_palette {
let mut selected_str = Encoding::EightBit.to_str();
let has_4bit = width%4 == 0;
let has_8bit = width%2 == 0;
if !has_4bit && !has_8bit {
return Err(Error::from_text(format!("Image width must be multiple of 2 and or 4 ({}/{})", width, height)));
}
if has_4bit {
self.encoding_options.push(SharedString::from(format!("{} ({}/{})", Encoding::FourBit.to_str(), width/4, height)));
selected_str = Encoding::FourBit.to_str();
}
if has_8bit {
self.encoding_options.push(SharedString::from(format!("{} ({}/{})", Encoding::EightBit.to_str(), width/2, height)));
}
Ok(selected_str)
}
else {
self.encoding_options.push(SharedString::from(format!("{} ({}/{})", Encoding::FullColor.to_str(), width, height)));
Ok(Encoding::FullColor.to_str())
}
}
pub fn new(main_window: MainWindowRef, main_tab: SharedMainTab, tim_manager: MutexTIMManager) -> SharedFileTab {
let encoding_options = Rc::new(slint::VecModel::from(Vec::<SharedString>::new()));
main_window.borrow().set_file_tab_encoding_options(encoding_options.clone().into());
let object = Rc::new(RefCell::new(FileTab{main_window: main_window.clone(), encoding_options}));
// Image conv functions
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_browse_file(tim_manager.clone()));
main_window.borrow().on_file_tab_browse_convert_image(move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow()) {
display_error("Loading file failed", &error.to_string());
}
});
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_update_palette_size(tim_manager.clone()));
main_window.borrow().on_file_tab_update_palette_size(move |width, height| {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow(), width as u16, height as u16) {
display_error("Updating palette failed", &error.to_string());
}
});
let (cloned_object, cloned_main_tab, cloned_main_window, mut function) = (object.clone(), main_tab.clone(), main_window.clone(), callbacks::on_add_image(tim_manager.clone()));
main_window.borrow().on_file_tab_add_convert_image(move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &mut cloned_main_tab.borrow_mut(), &cloned_main_window.borrow()) {
display_error("Adding file failed", &error.to_string());
}
});
// Project functions
let (cloned_object, cloned_main_tab, cloned_main_window, mut function) = (object.clone(), main_tab.clone(), main_window.clone(), callbacks::on_load_project_clicked(tim_manager.clone()));
main_window.borrow().on_project_widget_load_project_clicked(move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &mut cloned_main_tab.borrow_mut(), &cloned_main_window.borrow()) {
display_error("Loading project failed", &error.to_string());
}
});
let (cloned_object, cloned_main_tab, cloned_main_window, mut function) = (object.clone(), main_tab.clone(), main_window.clone(), callbacks::on_save_project_clicked(tim_manager.clone()));
main_window.borrow().on_project_widget_save_project_clicked (move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &cloned_main_tab.borrow(), &cloned_main_window.borrow()) {
display_error("Saving project failed", &error.to_string());
}
});
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_browse_open_project_clicked());
main_window.borrow().on_project_widget_browse_open_project_clicked (move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow()) {
display_error("Browsing project failed", &error.to_string());
}
});
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_browse_save_project_clicked());
main_window.borrow().on_project_widget_browse_save_project_clicked(move || {
if let Err(error) = function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow()) {
display_error("Browsing save location failed", &error.to_string());
}
});
object
}
pub fn clear_load(&self) {
let main_window = self.main_window.borrow();
self.encoding_options.clear();
main_window.set_file_tab_browse_path("".into());
main_window.set_file_tab_image_data(Image::default());
main_window.set_file_tab_image_width(0);
main_window.set_file_tab_image_height(0);
main_window.set_file_tab_palette_data(Image::default());
main_window.set_file_tab_palette_width(0);
main_window.set_file_tab_palette_height(0);
main_window.set_file_tab_image_name("".into());
main_window.set_file_tab_enable(false);
}
pub fn update_new_loaded_file(&self, file_name: Option<String>, image: Image, palette: Option<Image>) -> Result<(), Error> {
let has_palette = palette.is_some();
self.update_palette(palette);
let main_window = self.main_window.borrow();
let image_size = image.size();
main_window.set_file_tab_image_data(image);
main_window.set_file_tab_image_width(image_size.width as i32);
main_window.set_file_tab_image_height(image_size.height as i32);
if let Some(file_name) = file_name {
main_window.set_file_tab_image_name(file_name.into());
}
else {
main_window.set_file_tab_image_name("".into());
}
main_window.set_file_tab_selected_encoding(SharedString::from(self.update_encoding_options(image_size.width, image_size.height, has_palette)?));
main_window.set_file_tab_enable(true);
Ok(())
}
pub fn update_palette(&self, palette: Option<Image>) {
let main_window = self.main_window.borrow();
if let Some(palette) = palette {
let size = palette.size();
main_window.set_file_tab_palette_data(palette);
main_window.set_file_tab_palette_width(size.width as i32);
main_window.set_file_tab_palette_height(size.height as i32);
main_window.set_file_tab_palette_visible(true);
}
else {
main_window.set_file_tab_palette_width(0);
main_window.set_file_tab_palette_height(0);
main_window.set_file_tab_palette_visible(false);
}
}
pub fn get_file_name(&self) -> String {
self.main_window.borrow().get_file_tab_image_name().to_string()
}
pub fn get_encoding(&self) -> Result<Encoding, Error> {
let selected_encoding = self.main_window.borrow().get_file_tab_selected_encoding();
if selected_encoding.starts_with(Encoding::FourBit.to_str()) {
Ok(Encoding::FourBit)
}
else if selected_encoding.starts_with(Encoding::EightBit.to_str()) {
Ok(Encoding::EightBit)
}
else if selected_encoding.starts_with(Encoding::FullColor.to_str()) {
Ok(Encoding::FullColor)
}
else {
Err(Error::from_str("Failed to obtain encoding"))
}
}
}

View File

@@ -1,20 +0,0 @@
use super::create_vram_bg;
use super::MainWindowRef;
use super::{file_tab::FileTab, main_tab::MainTab};
pub struct GUIElements {
pub file_tab: FileTab,
pub main_tab: MainTab,
}
impl GUIElements {
pub fn new(main_window: MainWindowRef) -> Result<GUIElements, slint::PlatformError> {
main_window.borrow().set_main_tab_vram_bg(GUIElements::create_bg()?);
Ok(GUIElements{file_tab: FileTab::new(main_window.clone()), main_tab: MainTab::new(main_window.clone())})
}
fn create_bg() -> Result<slint::Image, slint::PlatformError> {
Ok(slint::Image::from_rgba8_premultiplied(create_vram_bg(320, 256).ok_or(slint::PlatformError::Other("Failed creating VRAM background image".to_string()))?))
}
}

View File

@@ -1,122 +0,0 @@
use crate::{gui::{VRAM_HEIGHT, VRAM_WIDTH}, MainWindow, VRAMImage};
use super::{GUIElementsRef, MainWindowRef};
use slint::Model;
use std::{rc::Rc, sync::{Arc, Mutex}};
struct VRAM {
pub file_list: Rc<slint::VecModel<slint::StandardListViewItem>>,
pub image_list: Rc<slint::VecModel<VRAMImage>>
}
pub struct MainTab {
main_window: MainWindowRef,
vram: Arc<Mutex<VRAM>>,
}
impl MainTab {
pub fn new(main_window: MainWindowRef) -> MainTab {
let vram_file_list:Vec<slint::StandardListViewItem> = main_window.borrow().get_main_tab_vram_file_list().iter().collect();
let vram_file_list = Rc::new(slint::VecModel::from(vram_file_list));
let vram_image_list = Rc::new(slint::VecModel::from(Vec::<VRAMImage>::new()));
main_window.borrow().set_main_tab_vram_file_list(vram_file_list.clone().into());
main_window.borrow().set_main_tab_vram_images(vram_image_list.clone().into());
MainTab{main_window, vram: Arc::new(Mutex::new(VRAM{file_list: vram_file_list, image_list: vram_image_list}))}
}
pub fn add_new_vram_file(&mut self, file_name: &String, image: slint::Image, image_palette: Option<slint::Image>) {
let vram_data = self.vram.lock().expect("VRAM already locked");
let add_new_image = |file_name: &String, image: slint::Image, palette_count: i32, is_palette: bool| {
let vram_image = VRAMImage{
img: image,
x: 0,
y: 0,
palette_count,
is_palette,
};
vram_data.file_list.push(slint::StandardListViewItem::from(file_name.as_str()));
vram_data.image_list.push(vram_image);
};
add_new_image(file_name, image, if image_palette.is_some() {1} else {0}, false);
if let Some(image_palette) = image_palette {
let file_name = file_name.clone() + " (Palette)";
add_new_image(&file_name, image_palette, 0, true);
}
}
pub fn remove_vram_file(&mut self, idx: usize) -> bool {
let vram_data = self.vram.lock().expect("VRAM already locked");
let remove_image = |idx: usize| {
vram_data.file_list.remove(idx);
vram_data.image_list.remove(idx);
};
let extras = {
if let Some(element) = vram_data.image_list.iter().skip(idx).next() {
if element.is_palette {
return false;
}
else {
element.palette_count as usize
}
}
else {
0
}
};
for _ in idx..=idx+extras {
remove_image(idx);
}
return true;
}
pub fn move_vram_image(&mut self, idx: usize, dx: i32, dy: i32) {
let vram_data = self.vram.lock().expect("VRAM already locked");
if let Some(mut vram_info) = vram_data.image_list.row_data(idx) {
vram_info.x += dx;
vram_info.y += dy;
if vram_info.x < 0 {
vram_info.x = 0;
}
if vram_info.y < 0 {
vram_info.y = 0;
}
let (vram_img_width, vram_img_height) = (vram_info.img.size().width as i32, vram_info.img.size().height as i32);
if (vram_info.x + vram_img_width) > VRAM_WIDTH as i32 {
vram_info.x = VRAM_WIDTH as i32 - vram_img_width;
}
if (vram_info.y + vram_img_height) > VRAM_HEIGHT as i32 {
vram_info.y = VRAM_HEIGHT as i32 - vram_img_height;
}
vram_data.image_list.set_row_data(idx, vram_info);
}
}
pub fn on_move_vram_image(&self, gui_elements: GUIElementsRef, mut function: impl FnMut(&mut MainTab, &MainWindow, i32, i32, i32) + 'static) {
let main_window_cloned = self.main_window.clone();
let gui_cloned = gui_elements.clone();
self.main_window.borrow().on_move_vram_image(move |idx, dx, dy| {
function(&mut gui_cloned.borrow_mut().main_tab, &main_window_cloned.borrow(), idx, dx, dy);
});
}
pub fn on_remove_file(&self, gui_elements: GUIElementsRef, mut function: impl FnMut(&mut MainTab, &MainWindow, i32) + 'static) {
let main_window_cloned = self.main_window.clone();
let gui_cloned = gui_elements.clone();
self.main_window.borrow().on_main_tab_remove_file_clicked(move |idx| {
function(&mut gui_cloned.borrow_mut().main_tab, &main_window_cloned.borrow(), idx);
});
}
}

View File

@@ -0,0 +1,19 @@
use crate::{gui::MutexTIMManager, MainWindow, display_information};
use super::MainTab;
pub fn on_move_vram_image() -> impl FnMut(&mut MainTab, &MainWindow, i32, i32, i32) + 'static {
return move |main_tab, _main_window, idx, dx, dy| {
main_tab.move_vram_image(idx as usize, dx, dy);
}
}
pub fn on_remove_file(tim_manager: MutexTIMManager) -> impl FnMut(&mut MainTab, &MainWindow, i32) + 'static {
return move |main_tab, _main_window, idx| {
if idx >= 0 {
match main_tab.remove_vram_file(idx as usize) {
Ok(range) => tim_manager.lock().expect("VRAM already locked").remove_added_tim(range),
Err(error) => display_information("Removing VRAM file", error)
}
}
}
}

View File

@@ -0,0 +1,189 @@
mod callbacks;
use crate::{gui::{MutexTIMManager, VRAM_HEIGHT, VRAM_WIDTH}, VRAMImgData, VRAMInfo, VRAMData};
use super::MainWindowRef;
use slint::{Model, SharedString};
use std::{cell::RefCell, ops::RangeInclusive, rc::Rc, sync::{Arc, Mutex}};
use tim_tool::logic::project::FileSettings;
pub struct NewVRAMImageInfo {
pub image: slint::Image,
pub x: u16,
pub y: u16,
pub settings: FileSettings,
}
impl NewVRAMImageInfo {
pub fn new(image: slint::Image, x: u16, y: u16, settings: FileSettings) -> NewVRAMImageInfo {
NewVRAMImageInfo{image, x, y, settings}
}
}
struct VRAM {
count: usize,
file_list: Rc<slint::VecModel<slint::StandardListViewItem>>,
info: Rc<slint::VecModel<VRAMData>>
}
impl VRAM {
pub fn push(&mut self, name: slint::StandardListViewItem, image: VRAMData) {
self.file_list.push(name);
self.info.push(image);
self.count += 1;
}
pub fn remove(&mut self, idx: usize) {
self.count -= 1;
self.file_list.remove(idx);
self.info.remove(idx);
}
pub fn pop(&mut self) {
self.remove(self.count - 1);
}
}
pub struct MainTab {
vram: Arc<Mutex<VRAM>>,
}
pub type SharedMainTab = Rc<RefCell<MainTab>>;
impl MainTab {
pub fn new(main_window: MainWindowRef, tim_manager: MutexTIMManager) -> SharedMainTab {
let vram_file_list:Vec<slint::StandardListViewItem> = main_window.borrow().get_main_tab_vram_file_list().iter().collect();
let vram_file_list = Rc::new(slint::VecModel::from(vram_file_list));
let info = Rc::new(slint::VecModel::from(Vec::<VRAMData>::new()));
main_window.borrow().set_main_tab_vram_file_list(vram_file_list.clone().into());
main_window.borrow().set_main_tab_vram_data(info.clone().into());
let object = SharedMainTab::new(MainTab{vram: Arc::new(Mutex::new(VRAM{count: 0, file_list: vram_file_list, info}))}.into());
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_move_vram_image());
main_window.borrow().on_move_vram_image(move |idx, dx, dy| {
function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow(), idx, dx, dy);
});
let (cloned_object, cloned_main_window, mut function) = (object.clone(), main_window.clone(), callbacks::on_remove_file(tim_manager));
main_window.borrow().on_main_tab_remove_file_clicked(move |idx| {
function(&mut cloned_object.borrow_mut(), &cloned_main_window.borrow(), idx);
});
object
}
pub fn clear(&mut self) {
let mut vram_data = self.vram.lock().expect("VRAM already locked");
let count = vram_data.count;
for _ in 0..count {
vram_data.pop();
}
}
pub fn add_new_vram_file(&mut self, file_name: &String, full_image: slint::Image, texture: NewVRAMImageInfo, image_palette: Option<NewVRAMImageInfo>) -> usize {
let mut vram_data = self.vram.lock().expect("VRAM already locked");
let mut add_new_image = |file_name: &String, full_image: slint::Image, vram_image: NewVRAMImageInfo, palette_count: i32, is_palette: bool| {
let encoding_str = if is_palette {"<Palette>"} else {vram_image.settings.encoding.to_str()};
let vram_image = VRAMData {
images: VRAMImgData {
full_image,
image: vram_image.image,
},
info: VRAMInfo {
x: vram_image.x as i32,
y: vram_image.y as i32,
encoding_str: SharedString::from(encoding_str),
use_compression: vram_image.settings.compress,
trans_setting: vram_image.settings.transparency.as_idx(),
palette_count,
is_palette,
}
};
vram_data.push(slint::StandardListViewItem::from(file_name.as_str()), vram_image);
};
let mut images_added = 1;
add_new_image(file_name, full_image, texture, if image_palette.is_some() {1} else {0}, false);
if let Some(image_palette) = image_palette {
let file_name = " => ".to_owned() + file_name.as_str() + " (Palette)";
images_added += 1;
add_new_image(&file_name, image_palette.image.clone(), image_palette, 0, true);
}
images_added
}
pub fn remove_vram_file(&mut self, idx: usize) -> Result<RangeInclusive<usize>, &'static str> {
let mut vram_data = self.vram.lock().expect("VRAM already locked");
let extras = {
if let Some(element) = vram_data.info.iter().skip(idx).next() {
if element.info.is_palette {
return Err("Can not remove palette. Delete image instead");
}
else {
element.info.palette_count as usize
}
}
else {
0
}
};
let range = idx..=idx+extras;
let mut remove_image = |idx: usize| {
vram_data.remove(idx);
};
for _ in range.clone() {
remove_image(idx);
}
return Ok(range);
}
pub fn pop_vram_files(&mut self, count: usize) {
let mut vram_data = self.vram.lock().expect("VRAM already locked");
for _ in 0..count {
vram_data.pop();
}
}
pub fn move_vram_image(&mut self, idx: usize, dx: i32, dy: i32) {
let vram_data = self.vram.lock().expect("VRAM already locked");
if let Some(mut vram_info) = vram_data.info.row_data(idx) {
vram_info.info.x += dx;
vram_info.info.y += dy;
if vram_info.info.x < 0 {
vram_info.info.x = 0;
}
if vram_info.info.y < 0 {
vram_info.info.y = 0;
}
let (vram_img_width, vram_img_height) = (vram_info.images.image.size().width as i32, vram_info.images.image.size().height as i32);
if (vram_info.info.x + vram_img_width) > VRAM_WIDTH as i32 {
vram_info.info.x = VRAM_WIDTH as i32 - vram_img_width;
}
if (vram_info.info.y + vram_img_height) > VRAM_HEIGHT as i32 {
vram_info.info.y = VRAM_HEIGHT as i32 - vram_img_height;
}
vram_data.info.set_row_data(idx, vram_info);
}
}
pub fn clone_vram_info(&self) -> Vec<(String, VRAMInfo)> {
let vram_data = self.vram.lock().expect("VRAM already locked");
vram_data.info.iter().zip(vram_data.file_list.iter()).map(|(vram_data, file_name)| {
(file_name.text.to_string(), vram_data.info.clone())
}).collect()
}
}

View File

@@ -1,20 +1,42 @@
mod file_tab; mod file_tab;
mod gui_elements;
mod main_tab; mod main_tab;
use crate::MainWindow; use crate::MainWindow;
use file_tab::{FileTab, SharedFileTab};
use main_tab::{MainTab, SharedMainTab};
use rfd::MessageDialog; use rfd::MessageDialog;
use std::{cell::RefCell, rc::Rc}; use std::{cell::RefCell, rc::Rc, sync::Mutex};
use slint::{Rgba8Pixel, SharedPixelBuffer}; use slint::{Rgba8Pixel, SharedPixelBuffer};
use tim_tool::logic::TIMManager;
use tiny_skia::{Rect, Transform}; use tiny_skia::{Rect, Transform};
pub use gui_elements::GUIElements; type MainWindowRef = Rc<RefCell<MainWindow>>;
pub type MutexTIMManager = Rc<Mutex<TIMManager>>;
pub const VRAM_WIDTH:usize = 1024; pub const VRAM_WIDTH:usize = 1024;
pub const VRAM_HEIGHT:usize = 512; pub const VRAM_HEIGHT:usize = 512;
type MainWindowRef = Rc<RefCell<MainWindow>>; pub struct GUIElements {
type GUIElementsRef = Rc<RefCell<GUIElements>>; _file_tab: SharedFileTab,
_main_tab: SharedMainTab,
}
impl GUIElements {
pub fn new(main_window: MainWindowRef, tim_manager: MutexTIMManager) -> Result<GUIElements, slint::PlatformError> {
main_window.borrow().set_main_tab_vram_bg(GUIElements::create_bg()?);
let _main_tab = MainTab::new(main_window.clone(), tim_manager.clone());
let _file_tab = FileTab::new(main_window.clone(), _main_tab.clone(), tim_manager);
Ok(GUIElements{_file_tab, _main_tab})
}
fn create_bg() -> Result<slint::Image, slint::PlatformError> {
Ok(slint::Image::from_rgba8_premultiplied(create_vram_bg(320, 256).ok_or(slint::PlatformError::Other("Failed creating VRAM background image".to_string()))?))
}
}
pub fn display_information(title: impl Into<String>, text: impl Into<String>) { pub fn display_information(title: impl Into<String>, text: impl Into<String>) {
MessageDialog::new().set_title(title).set_level(rfd::MessageLevel::Info).set_description(text).show(); MessageDialog::new().set_title(title).set_level(rfd::MessageLevel::Info).set_description(text).show();

View File

@@ -1,37 +1,5 @@
pub mod project;
pub mod tim; pub mod tim;
pub mod tim_mgr;
use std::path::PathBuf; pub use tim_mgr::TIMManager;
use slint::Image;
use tim::TIMInfo;
use tool_helper::Error;
pub struct Logic {
unadded_tim: Option<TIMInfo>,
}
impl Logic {
pub fn new() -> Logic {
Logic{unadded_tim: None}
}
pub fn set_unadded_tim(&mut self, path: &PathBuf) -> Result<(Image, Option<Image>), Error> {
let tim_info = TIMInfo::from_image(path)?;
let image = tim_info.get_slint_images();
self.unadded_tim = Some(tim_info);
Ok(image)
}
pub fn add_unadded_tim_as(&mut self, _name: &String) -> Result<(Image, Option<Image>), Error> {
if let Some(unadded_tim) = &self.unadded_tim {
let image = unadded_tim.get_slint_images();
self.unadded_tim = None;
Ok(image)
}
else {
Err(Error::from_str("No data found for loaded image"))
}
}
}

View File

@@ -0,0 +1,164 @@
use super::tim::types::Encoding;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Serialize, Deserialize)]
pub struct FileSettings {
pub compress: bool,
pub transparency: Transparency,
pub encoding: Encoding,
}
impl FileSettings {
pub fn new(compress: bool, transparency: Transparency, encoding: Encoding) -> FileSettings {
FileSettings{compress, transparency, encoding}
}
pub fn from_encoding(encoding: Encoding) -> FileSettings {
let mut new_type = FileSettings::default();
new_type.encoding = encoding;
new_type
}
}
impl std::default::Default for FileSettings {
fn default() -> Self {
Self{compress: Default::default(), transparency: Transparency::None, encoding: Encoding::FullColor}
}
}
#[derive(Serialize, Deserialize)]
pub struct Job {
pub name: String,
pub file_path: PathBuf,
pub image_pos: ImagePosition,
pub palette_rect: Option<PaletteRect>,
pub settings: FileSettings,
}
impl Job {
pub fn new(name: String, file_path: PathBuf, image_pos: (u16, u16), settings: FileSettings) -> Job {
Job{name, file_path, image_pos: ImagePosition{x: image_pos.0, y: image_pos.1}, palette_rect: None, settings}
}
pub fn create_file_path<T:?Sized + std::convert::AsRef<std::ffi::OsStr>>(file_path: PathBuf, location_path: &T) -> PathBuf {
if file_path.is_file() {
file_path
}
else {
let mut new_file_path = PathBuf::from(location_path);
new_file_path.pop();
new_file_path.push(file_path);
new_file_path
}
}
}
#[derive(Serialize, Deserialize)]
pub struct Project {
pub jobs: Vec<Job>
}
impl Project {
pub fn new(jobs: Vec<Job>) -> Project {
Project{jobs}
}
}
#[derive(Serialize, Deserialize)]
pub struct ImagePosition {
pub x: u16,
pub y: u16,
}
impl ImagePosition {
pub fn new(x: u16, y: u16) -> ImagePosition {
ImagePosition{x, y}
}
}
impl std::default::Default for ImagePosition {
fn default() -> Self {
ImagePosition::new(0, 0)
}
}
#[derive(Clone, Copy, Serialize, Deserialize)]
pub struct ImageSize {
pub width: u16,
pub height: u16,
}
impl ImageSize {
pub fn new(width: u16, height: u16) -> ImageSize {
ImageSize{width, height}
}
}
impl From<ImageSize> for (u16, u16) {
fn from(value: ImageSize) -> Self {
(value.width, value.height)
}
}
impl std::default::Default for ImageSize {
fn default() -> Self {
ImageSize::new(0, 0)
}
}
#[derive(Serialize, Deserialize)]
pub struct PaletteRect {
pub pos: ImagePosition,
pub size: ImageSize,
}
impl PaletteRect {
pub fn new(x: u16, y: u16, width: u16, height: u16) -> PaletteRect {
PaletteRect{pos: ImagePosition{x, y}, size: ImageSize{width, height}}
}
}
impl From<PaletteRect> for (u16, u16, u16, u16) {
fn from(value: PaletteRect) -> Self {
(value.pos.x, value.pos.y, value.size.width, value.size.height)
}
}
impl std::default::Default for PaletteRect {
fn default() -> Self {
PaletteRect{pos: ImagePosition::default(), size: ImageSize::default()}
}
}
#[derive(Serialize, Deserialize)]
pub enum Transparency {
None,
FirstColor,
PSXSemi,
Both,
}
impl Transparency {
pub fn from(selection: i32) -> Transparency {
match selection {
0 => Transparency::None,
1 => Transparency::FirstColor,
2 => Transparency::PSXSemi,
3 => Transparency::Both,
_ => Transparency::None,
}
}
pub fn as_idx(&self) -> i32 {
match self {
Transparency::None => 0,
Transparency::FirstColor => 1,
Transparency::PSXSemi => 2,
Transparency::Both => 3,
}
}
}

View File

@@ -1,76 +0,0 @@
use std::{fs::File, path::PathBuf};
use slint::{Rgba8Pixel, SharedPixelBuffer};
use tool_helper::Error;
pub struct TIMInfo {
image_data: SharedPixelBuffer<Rgba8Pixel>,
palette: Option<Vec<Rgba8Pixel>>,
}
impl TIMInfo {
pub fn from_image(path: &PathBuf) -> Result<TIMInfo, Error> {
fn make_color(iter: &mut dyn std::iter::Iterator<Item = &u8>, load_alpha: bool) -> Option<Rgba8Pixel> {
Some(Rgba8Pixel::new(
*iter.next()?, *iter.next()?, *iter.next()?,
if load_alpha {*iter.next()?} else {0xFF}))
}
let mut reader = png::Decoder::new(File::open(path)?).read_info().or_else(|error| {Err(Error::from_error(error))})?;
let info = reader.info().clone();
let mut buffer = vec![0; reader.output_buffer_size()];
let frame_info = reader.next_frame(&mut buffer).or_else(|error| {Err(Error::from_error(error))})?;
let bytes_per_pixel = info.bytes_per_pixel();
let bit_depth = frame_info.bit_depth;
let mut image_data = SharedPixelBuffer::new(frame_info.width, frame_info.height);
let mut dst_pixels = image_data.make_mut_slice();
if info.color_type == png::ColorType::Indexed {
let palette = info.palette.ok_or(Error::from_str("Found indexed PNG without palette"))?;
let mut palette_colors = Vec::new();
let mut iter = palette.iter();
while let Some(color) = make_color(&mut iter, false) {
palette_colors.push(color);
}
for byte in buffer.into_iter() {
match bit_depth {
png::BitDepth::Four => {
dst_pixels[0] = palette_colors[(byte >> 4) as usize];
dst_pixels[1] = palette_colors[(byte & 0xF) as usize];
dst_pixels = &mut dst_pixels[2..];
},
png::BitDepth::Eight => {
dst_pixels[0] = palette_colors[byte as usize];
dst_pixels = &mut dst_pixels[1..];
},
_ => {return Err(Error::from_str("Only 4 and 8bit color depth are supported for indexed color images"));}
}
}
Ok(TIMInfo{image_data, palette: Some(palette_colors)})
}
else {
if bytes_per_pixel != 3 && bytes_per_pixel != 4 {
return Err(Error::from_text(format!("Image has {} bytes per pixel, but only 3 and 4 bytes per pixel are supported", bytes_per_pixel)));
}
let mut byte_iter = buffer.iter();
while let Some(color) = make_color(&mut byte_iter, bytes_per_pixel == 4) {
match bit_depth {
png::BitDepth::Eight => {
dst_pixels[0] = color;
dst_pixels = &mut dst_pixels[1..];
}
_ => {return Err(Error::from_str("Only 8bit color depth are supported for direct color images"));}
}
}
Ok(TIMInfo{image_data, palette: None})
}
}
pub fn get_slint_images(&self) -> (slint::Image, Option<slint::Image>) {
(slint::Image::from_rgba8_premultiplied(self.image_data.clone()), None)
}
}

View File

@@ -0,0 +1,170 @@
pub mod types;
use pathdiff::diff_paths;
use std::{fs::File, path::PathBuf};
use slint::{Rgba8Pixel, SharedPixelBuffer};
use tool_helper::Error;
use types::Encoding;
#[derive(Clone)]
pub struct TIMInfo {
path: PathBuf,
image_data: SharedPixelBuffer<Rgba8Pixel>,
palette: Option<PaletteInfo>,
}
impl TIMInfo {
pub fn from_image(path: &PathBuf) -> Result<TIMInfo, Error> {
fn make_color(iter: &mut dyn std::iter::Iterator<Item = &u8>, load_alpha: bool) -> Option<Rgba8Pixel> {
Some(Rgba8Pixel::new(
*iter.next()?, *iter.next()?, *iter.next()?,
if load_alpha {*iter.next()?} else {0xFF}))
}
let mut reader = png::Decoder::new(File::open(path).map_err(|error| Error::from_text(format!("Failed loading \"{}\" with {}", path.to_string_lossy().as_ref(), error)))?).read_info().or_else(|error| {Err(Error::from_error(error))})?;
let info = reader.info().clone();
let mut buffer = vec![0; reader.output_buffer_size()];
let frame_info = reader.next_frame(&mut buffer).or_else(|error| {Err(Error::from_error(error))})?;
let bytes_per_pixel = info.bytes_per_pixel();
let bit_depth = frame_info.bit_depth;
let mut image_data = SharedPixelBuffer::new(frame_info.width, frame_info.height);
let mut dst_pixels = image_data.make_mut_slice();
if info.color_type == png::ColorType::Indexed {
let palette = info.palette.ok_or(Error::from_str("Found indexed PNG without palette"))?;
let mut palette_colors = Vec::new();
let mut iter = palette.iter();
while let Some(color) = make_color(&mut iter, false) {
palette_colors.push(color);
}
for byte in buffer.into_iter() {
match bit_depth {
png::BitDepth::Four => {
dst_pixels[0] = palette_colors[(byte >> 4) as usize];
dst_pixels[1] = palette_colors[(byte & 0xF) as usize];
dst_pixels = &mut dst_pixels[2..];
},
png::BitDepth::Eight => {
dst_pixels[0] = palette_colors[byte as usize];
dst_pixels = &mut dst_pixels[1..];
},
_ => {return Err(Error::from_str("Only 4 and 8bit color depth are supported for indexed color images"));}
}
}
Ok(TIMInfo{path: path.clone(), image_data, palette: Some(PaletteInfo::new(palette_colors))})
}
else {
if bytes_per_pixel != 3 && bytes_per_pixel != 4 {
return Err(Error::from_text(format!("Image has {} bytes per pixel, but only 3 and 4 bytes per pixel are supported", bytes_per_pixel)));
}
let mut byte_iter = buffer.iter();
while let Some(color) = make_color(&mut byte_iter, bytes_per_pixel == 4) {
match bit_depth {
png::BitDepth::Eight => {
dst_pixels[0] = color;
dst_pixels = &mut dst_pixels[1..];
}
_ => {return Err(Error::from_str("Only 8bit color depth are supported for direct color images"));}
}
}
Ok(TIMInfo{path: path.clone(), image_data, palette: None})
}
}
pub fn change_palette_size(&mut self, width: u16, height: u16) -> Result<Option<slint::Image>, Error> {
if let Some(palette) = &mut self.palette {
if width == 0 || height == 0 {
return Err(Error::from_text(format!("{}px x {}px is not a valid size for palette", width, height)));
}
palette.width = width;
palette.height = height;
Ok(Some(palette.get_image()))
}
else {
Ok(None)
}
}
pub fn get_slint_images(&self, encoding: Encoding) -> (slint::Image, Option<slint::Image>) {
fn scaled_copy(src: &SharedPixelBuffer<Rgba8Pixel>, factor: u32) -> SharedPixelBuffer<Rgba8Pixel> {
let mut image_data = SharedPixelBuffer::<Rgba8Pixel>::new(src.width()/factor, src.height());
let mut dst_pixel = image_data.make_mut_slice();
let src_pixel = src.as_slice();
for (idx, pixel) in src_pixel.into_iter().enumerate() {
if idx%factor as usize == 0 {
dst_pixel[0] = *pixel;
dst_pixel = &mut dst_pixel[1..];
}
}
image_data
}
let image_data = match encoding {
Encoding::FourBit => scaled_copy(&self.image_data, 4),
Encoding::EightBit => scaled_copy(&self.image_data, 2),
Encoding::FullColor => self.image_data.clone()
};
(slint::Image::from_rgba8_premultiplied(image_data), if let Some(palette) = &self.palette {
Some(palette.get_image())
} else {
None
})
}
pub fn get_palette_size(&self) -> Option<(u16, u16)> {
if let Some(palette_info) = &self.palette {
Some((palette_info.width, palette_info.height))
}
else {
None
}
}
pub fn get_path(&self) -> std::path::PathBuf {
self.path.clone()
}
pub fn get_path_rel_to(&self, mut reference_path: std::path::PathBuf) -> Result<std::path::PathBuf, Error> {
let file_path = self.path.clone();
reference_path.pop();
diff_paths(&file_path, &reference_path).ok_or_else(|| {
Error::from_text(format!("Can not create relative path from {} to {}", file_path.to_string_lossy().as_ref(), reference_path.to_string_lossy().as_ref()))
})
}
}
#[derive(Clone)]
struct PaletteInfo {
data: Vec<Rgba8Pixel>,
width: u16,
height: u16,
}
impl PaletteInfo {
pub fn new(data: Vec<Rgba8Pixel>) -> PaletteInfo {
let width = if data.len() <= 16 {16} else {256};
PaletteInfo{data, width, height: 1}
}
pub fn get_image(&self) -> slint::Image {
let mut image_data = SharedPixelBuffer::new(self.width as u32, self.height as u32);
let dst_pixels = image_data.make_mut_slice();
for (idx, byte) in dst_pixels.iter_mut().enumerate() {
*byte = if idx < self.data.len() {self.data[idx]} else {Rgba8Pixel::new(0, 0, 0, 0xFF)};
}
slint::Image::from_rgba8_premultiplied(image_data.clone())
}
}

View File

@@ -0,0 +1,31 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Deserialize, Serialize)]
pub enum Encoding {
FourBit,
EightBit,
FullColor,
}
impl Encoding {
const FOUR_BIT_NAME:&str = "4 bit";
const EIGHT_BIT_NAME:&str = "8 bit";
const FULL_COLOR_NAME:&str = "Full color";
pub const fn to_str(&self) -> &str {
match self {
Encoding::FourBit => Self::FOUR_BIT_NAME,
Encoding::EightBit => Self::EIGHT_BIT_NAME,
Encoding::FullColor => Self::FULL_COLOR_NAME,
}
}
pub fn from_str(str: &str) -> Encoding {
match str {
Self::FOUR_BIT_NAME => Encoding::FourBit,
Self::EIGHT_BIT_NAME => Encoding::EightBit,
Self::FULL_COLOR_NAME => Encoding::FullColor,
_ => Encoding::FullColor,
}
}
}

View File

@@ -0,0 +1,80 @@
use slint::Image;
use std::{ops::RangeInclusive, path::PathBuf};
use super::tim::{types::Encoding, TIMInfo};
use tool_helper::Error;
pub struct TIMManager {
added_tims: Vec<Option<TIMInfo>>,
unadded_tim: Option<TIMInfo>,
}
impl TIMManager {
pub fn new() -> TIMManager {
TIMManager{added_tims: Default::default(), unadded_tim: None}
}
pub fn clear(&mut self) {
self.added_tims.clear();
}
pub fn remove_added_tim(&mut self, range: RangeInclusive<usize>) {
let idx = *range.start();
for _ in range {
self.added_tims.remove(idx);
}
}
pub fn load_unadded_tim(&mut self, path: &PathBuf) -> Result<(Image, Option<Image>), Error> {
let tim_info = TIMInfo::from_image(path)?;
let image = tim_info.get_slint_images(Encoding::FullColor);
self.unadded_tim = Some(tim_info);
Ok(image)
}
pub fn get_converted_unadded_tim_image(&self, encoding: Encoding) -> Result<(Image, Option<Image>), Error> {
if let Some(unadded_tim) = &self.unadded_tim {
let (image, palette) = unadded_tim.get_slint_images(encoding);
Ok((image, palette))
}
else {
Err(Error::from_str("No data found for loaded image"))
}
}
pub fn add_unadded_tim(&mut self, images_added: usize) -> Result<(), Error> {
if let Some(_) = &self.unadded_tim {
if images_added >= 1 {
self.added_tims.push(std::mem::replace(&mut self.unadded_tim, None));
for _ in 0..(images_added - 1) {
self.added_tims.push(None);
}
Ok(())
}
else {
Err(Error::from_str("Can not add 0 images"))
}
}
else {
Err(Error::from_str("No data found for loaded image"))
}
}
pub fn change_unadded_tim_palette_size(&mut self, width: u16, height: u16) -> Result<Option<Image>, Error> {
if let Some(unadded_tim) = &mut self.unadded_tim {
unadded_tim.change_palette_size(width, height)
}
else {
Ok(None)
}
}
pub fn clone_added_tims(&self) -> Vec<Option<TIMInfo>> {
self.added_tims.clone()
}
}

View File

@@ -2,85 +2,50 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod gui; mod gui;
use gui::{GUIElements, VRAM_WIDTH, VRAM_HEIGHT, display_information}; use gui::{GUIElements, display_information};
use rfd::FileDialog; use std::{cell::RefCell, rc::Rc, sync::Mutex};
use std::{cell::RefCell, rc::Rc};
use slint::SharedString; use slint::SharedString;
use tim_tool::logic::Logic; use tim_tool::logic::TIMManager;
use tool_helper::Error;
slint::include_modules!(); slint::include_modules!();
struct Application {
main_window: Rc<RefCell<MainWindow>>,
_gui_elements: Rc<RefCell<GUIElements>>,
_tim_manager: Rc<Mutex<TIMManager>>,
}
fn main() -> Result<(), slint::PlatformError> { impl Application {
let logic_ref = Rc::new(RefCell::new(Logic::new())); fn new() -> Result<Application, slint::PlatformError> {
let main_window_ref = Rc::new(RefCell::new(MainWindow::new()?)); let main_window = Rc::new(RefCell::new(MainWindow::new()?));
let gui_elements_ref = Rc::new(RefCell::new(GUIElements::new(main_window_ref.clone())?)); let _tim_manager = Rc::new(Mutex::new(TIMManager::new()));
setup_main_tab(gui_elements_ref.clone()); Ok(Application{
setup_file_tab(gui_elements_ref.clone(), logic_ref); main_window: main_window.clone(),
_gui_elements: Rc::new(RefCell::new(GUIElements::new(main_window.clone(), _tim_manager.clone())?)),
_tim_manager,
})
}
let main_window = main_window_ref.borrow(); fn setup(&self) {
self.setup_about_tab();
}
fn run(&self) -> Result<(), slint::PlatformError> {
let main_window = self.main_window.borrow();
main_window.run() main_window.run()
} }
fn setup_main_tab(gui_elements_ref: Rc<RefCell<GUIElements>>) { fn setup_about_tab(&self) {
let gui_elements = gui_elements_ref.borrow(); const VERSION: &str = env!("CARGO_PKG_VERSION");
gui_elements.main_tab.on_move_vram_image(gui_elements_ref.clone(), move |main_tab, _main_window, idx, dx, dy| { self.main_window.borrow().invoke_set_version(SharedString::from(VERSION));
main_tab.move_vram_image(idx as usize, dx, dy);
});
gui_elements.main_tab.on_remove_file(gui_elements_ref.clone(), move |main_tab, _main_window, idx| {
if idx >= 0 {
if !main_tab.remove_vram_file(idx as usize) {
display_information("Removing VRAM file", "Can not remove palette. Delete image instead");
} }
} }
});
} fn main() -> Result<(), slint::PlatformError> {
let application = Application::new()?;
fn setup_file_tab(gui_elements_ref: Rc<RefCell<GUIElements>>, logic_ref: Rc<RefCell<Logic>>) {
let gui_elements = gui_elements_ref.borrow(); application.setup();
application.run()
let logic = logic_ref.clone();
gui_elements.file_tab.on_browse_file(gui_elements_ref.clone(), move |gui_elements, main_window| -> Result<(), Error> {
let file = FileDialog::new()
.add_filter("PNG image (.png)", &["png"])
.set_title("PNG image file")
.pick_file();
if let Some(file) = file {
if let Some(file_path) = file.to_str() {
main_window.set_file_tab_browse_path(SharedString::from(file_path));
}
let file_tab = &gui_elements.file_tab;
let file_name = if let Some(name) = file.file_name() {Some(name.to_string_lossy().to_string())} else {None};
let (image, _palette_image) = logic.borrow_mut().set_unadded_tim(&file)?;
let img_size = image.size();
if img_size.width > VRAM_WIDTH as u32 || img_size.height > VRAM_HEIGHT as u32 {
return Err(Error::from_text(format!("Image size ({}; {}) is to big for VRAM ({}, {})", img_size.width, img_size.height, VRAM_WIDTH, VRAM_HEIGHT)));
}
file_tab.update_new_load(file_name, image);
}
Ok(())
});
let logic = logic_ref.clone();
gui_elements.file_tab.on_add_image(gui_elements_ref.clone(), move |gui_elements, main_window| {
let main_tab = &mut gui_elements.main_tab;
let file_tab = &gui_elements.file_tab;
let file_name = file_tab.get_file_name();
let (image, palette_image) = logic.borrow_mut().add_unadded_tim_as(&file_name)?;
main_tab.add_new_vram_file(&file_name, image, palette_image);
file_tab.clear_load();
main_window.invoke_change_to_main();
Ok(())
});
} }

View File

@@ -7,18 +7,36 @@ export component MainWindow inherits Window {
// Main Tab values // Main Tab values
in-out property main_tab_vram_bg <=> main_tab.vram_bg; in-out property main_tab_vram_bg <=> main_tab.vram_bg;
in-out property main_tab_vram_file_list <=> main_tab.vram_files; in-out property main_tab_vram_file_list <=> main_tab.vram_files;
in-out property main_tab_vram_images <=> main_tab.vram_images; in-out property main_tab_vram_data <=> main_tab.vram_data;
callback main_tab_remove_file_clicked <=> main_tab.remove_file_clicked; callback main_tab_remove_file_clicked <=> main_tab.remove_file_clicked;
callback move_vram_image <=> main_tab.move_vram_image; callback move_vram_image <=> main_tab.move_vram_image;
// Project widget values
in-out property project_widget-open_project_path <=> file_tab.project_widget-open_project_path;
in-out property project_widget-save_project_path <=> file_tab.project_widget-save_project_path;
in-out property project_widget-append_project_elements <=> file_tab.project_widget-append_project_elements;
in-out property project_widget-use_rel_paths <=> file_tab.project_widget-use_rel_paths;
callback project_widget-load_project_clicked <=> file_tab.project_widget-load_project_clicked;
callback project_widget-save_project_clicked <=> file_tab.project_widget-save_project_clicked;
callback project_widget-browse_open_project_clicked <=> file_tab.project_widget-browse_open_project_clicked;
callback project_widget-browse_save_project_clicked <=> file_tab.project_widget-browse_save_project_clicked;
// Convert Image values // Convert Image values
in-out property file_tab_browse_path <=> file_tab.conv_image_path; in-out property file_tab-encoding_options <=> file_tab.conv-encoding_options;
in-out property file_tab_image_data <=> file_tab.conv_image_data; in-out property file_tab-browse_path <=> file_tab.conv-image_path;
in-out property file_tab_image_name <=> file_tab.conv_image_name; in-out property file_tab-image_data <=> file_tab.conv-image_data;
in-out property file_tab_enable <=> file_tab.conv_image_enable; in-out property file_tab-image_width <=> file_tab.conv-image_width;
callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked; in-out property file_tab-image_height <=> file_tab.conv-image_height;
callback file_tab_add_convert_image <=> file_tab.conv_image_add_clicked; in-out property file_tab-palette_data <=> file_tab.conv-palette_data;
in-out property file_tab-palette_width <=> file_tab.conv-palette_width;
in-out property file_tab-palette_height <=> file_tab.conv-palette_height;
in-out property file_tab-palette_visible <=> file_tab.conv-palette_enable;
in-out property file_tab-selected_encoding <=> file_tab.conv-selected_encoding;
in-out property file_tab-image_name <=> file_tab.conv-image_name;
in-out property file_tab-enable <=> file_tab.conv-enable_view;
callback file_tab-update_palette_size <=> file_tab.conv-image_update_palette_size;
callback file_tab-browse_convert_image <=> file_tab.conv-image_browse_clicked;
callback file_tab-add_convert_image <=> file_tab.conv-image_add_clicked;
title: "TIM Tool 0.1.0"; title: "TIM Tool 0.1.0";
width: tab_widget.width; width: tab_widget.width;
@@ -48,10 +66,14 @@ export component MainWindow inherits Window {
} }
Tab { Tab {
title: "About"; title: "About";
AboutTab {} about_tab := AboutTab {}
} }
} }
public function set_version(version: string) {
about_tab.version = version;
}
public function change_to_load_file() { public function change_to_load_file() {
file_tab.state = State.ConvertImage; file_tab.state = State.ConvertImage;
tab_widget.current-index = 0; tab_widget.current-index = 0;
@@ -59,5 +81,10 @@ export component MainWindow inherits Window {
public function change_to_main() { public function change_to_main() {
tab_widget.current-index = 1; tab_widget.current-index = 1;
main_tab.set_active();
}
public function clear_file_tab-current_selected_file() {
main_tab.clear_current_selection();
} }
} }

View File

@@ -1,14 +1,19 @@
import { AboutSlint } from "std-widgets.slint"; import { AboutSlint } from "std-widgets.slint";
export component AboutTab { export component AboutTab {
in property <string> version;
y: 0px; y: 0px;
VerticalLayout { VerticalLayout {
padding: 8px; padding: 8px;
alignment: start; alignment: start;
Text { Text {
font-size: 24pt; font-size: 24pt;
text: "TIM_Tool Version 0.1.0"; text: "TIM_Tool Version " + root.version;
horizontal-alignment: center; horizontal-alignment: center;
} }
Image {
source: @image-url("../assets/TimTool64x64.png");
image-rendering: pixelated;
}
Text { Text {
font-size: 20pt; font-size: 20pt;
text: "Part of JabyEngine"; text: "Part of JabyEngine";

View File

@@ -1,4 +1,4 @@
import { Button, TabWidget, LineEdit, GroupBox } from "std-widgets.slint"; import { Button, TabWidget, LineEdit, GroupBox, ComboBox, CheckBox } from "std-widgets.slint";
export enum State { export enum State {
Project, Project,
@@ -6,19 +6,115 @@ export enum State {
} }
component ProjectWidget inherits Rectangle { component ProjectWidget inherits Rectangle {
in-out property <string> open_project_path;
in-out property <string> save_project_path;
in-out property <bool> append_project_elements;
in-out property <bool> use_rel_paths;
callback load_project_clicked();
callback save_project_clicked();
callback browse_open_project_clicked();
callback browse_save_project_clicked();
background: #D0D0D0;
VerticalLayout {
alignment: start;
padding: 4px;
GroupBox {
title: "Open Project";
VerticalLayout {
alignment: start;
Text { Text {
text: "!!Planschbecken!!"; text: "Select a project to open.";
}
HorizontalLayout {
alignment: start;
LineEdit {
width: 300pt;
text: root.open_project_path;
}
Button {
text: "Browse";
clicked => {
root.browse_open_project_clicked();
}
}
}
HorizontalLayout {
alignment: start;
CheckBox {
text: "Append elements from project to existing elements";
checked <=> root.append_project_elements;
}
}
HorizontalLayout {
alignment: start;
Button {
text: "Load";
clicked => {
root.load_project_clicked();
}
}
}
}
}
GroupBox {
title: "Save Project";
VerticalLayout {
alignment: start;
padding: 4px;
Text {
text: "Save the current project";
}
HorizontalLayout {
alignment: start;
LineEdit {
width: 300pt;
text: root.save_project_path;
}
Button {
text: "Browse";
clicked => {
root.browse_save_project_clicked();
}
}
}
CheckBox {
text: "Use relative path for files";
checked <=> root.use_rel_paths;
}
HorizontalLayout {
alignment: start;
Button {
text: "Save";
clicked => {
root.save_project_clicked();
}
}
}
}
}
} }
} }
component ConvertImageWidget inherits Rectangle { component ConvertImageWidget inherits Rectangle {
in-out property <[string]> encoding_options: [];
in-out property <string> image_path; in-out property <string> image_path;
in-out property <image> image_data;
in-out property <string> image_name; in-out property <string> image_name;
in-out property <bool> enable_button: false; in-out property <image> image_data;
in-out property <int> image-width;
in-out property <int> image-height;
in-out property <image> palette_data;
in-out property <int> palette_width: 0;
in-out property <int> palette_height: 0;
in-out property <string> selected_encoding;
in-out property <bool> enable_view: false;
in-out property <bool> palette_visible: false;
callback browse_clicked(); callback browse_clicked();
callback add_clicked(); callback add_clicked();
callback update_palette_size(int, int);
background: #D0D0D0; background: #D0D0D0;
@@ -48,21 +144,110 @@ component ConvertImageWidget inherits Rectangle {
} }
GroupBox { GroupBox {
title: "Loaded image"; title: "Loaded image and palette";
VerticalLayout { VerticalLayout {
alignment: start; alignment: start;
padding: 4px; padding: 4px;
HorizontalLayout { HorizontalLayout {
alignment: center; alignment: center;
VerticalLayout {
Rectangle { Rectangle {
width: 256px; width: 256px + 2*4px; // < Because of border
height: 256px; height: 256px + 2*4px; // < Because of border
background: #000000; background: #404040;
border-color: #808080;
border-width: 4px;
Image { Image {
width: 256px; width: 256px;
height: 256px; height: 256px;
source: root.image_data; source: root.image_data;
image-fit: contain; image-fit: contain;
image-rendering: pixelated;
}
}
VerticalLayout {
alignment: center;
Text {
text: "Width: " + root.image-width;
}
}
VerticalLayout {
alignment: center;
Text {
text: "Height: " + root.image-height;
}
}
VerticalLayout {
alignment: center;
ComboBox {
model: root.encoding_options;
enabled: root.enable_view;
selected(current-value) => {
root.selected_encoding = current-value;
}
}
}
}
Rectangle {
// Fake padding because the padding setting for the HorizontalLayout would not work
width: 4px;
height: 1px;
}
VerticalLayout {
Rectangle {
width: 256px + 2*4px; // < Because of border
height: 256px + 2*4px; // < Because of border
background: #404040;
border-color: #808080;
border-width: 4px;
palette_image := Image {
width: 256px;
height: 256px;
source: root.palette_data;
visible: root.palette_visible;
image-fit: contain;
image-rendering: pixelated;
}
}
HorizontalLayout {
alignment: start;
VerticalLayout {
VerticalLayout {
alignment: center;
Text {
text: "Width: ";
}
}
VerticalLayout {
alignment: center;
Text {
text: "Height: ";
}
}
}
VerticalLayout {
palette_width_edit := LineEdit {
width: 40pt;
input-type: number;
enabled: root.palette_visible;
text: root.palette_width;
accepted(text) => {
update_palette_size(palette_width_edit.text.to-float(), palette_height_edit.text.to-float());
}
}
palette_height_edit := LineEdit {
width: 40pt;
input-type: number;
enabled: root.palette_visible;
text: root.palette_height;
accepted(text) => {
update_palette_size(palette_width_edit.text.to-float(), palette_height_edit.text.to-float());
}
}
}
} }
} }
} }
@@ -76,7 +261,7 @@ component ConvertImageWidget inherits Rectangle {
} }
} }
LineEdit { LineEdit {
text: root.image_name; text <=> root.image_name;
} }
} }
HorizontalLayout { HorizontalLayout {
@@ -84,23 +269,52 @@ component ConvertImageWidget inherits Rectangle {
padding: 4px; padding: 4px;
Button { Button {
text: "Add Image"; text: "Add Image";
enabled: root.enable_button; enabled: root.enable_view;
clicked => {root.add_clicked();} clicked => {root.add_clicked();}
} }
} }
} }
} }
} }
public function set_palette_image(image: image) {
palette_image.source = image;
palette_image.visible = true;
}
public function clear_palette_image() {
palette_image.visible = false;
}
} }
export component FileTab inherits Rectangle { export component FileTab inherits Rectangle {
in-out property <string> conv_image_path;
in-out property <image> conv_image_data;
in-out property <string> conv_image_name;
in-out property <bool> conv_image_enable;
in-out property <State> state; in-out property <State> state;
callback conv_image_browse_clicked; // For project widget
callback conv_image_add_clicked; in-out property <string> project_widget-open_project_path;
in-out property <string> project_widget-save_project_path;
in-out property <bool> project_widget-append_project_elements;
in-out property <bool> project_widget-use_rel_paths;
callback project_widget-load_project_clicked();
callback project_widget-save_project_clicked();
callback project_widget-browse_open_project_clicked();
callback project_widget-browse_save_project_clicked();
// For image conversion widget
in-out property <[string]> conv-encoding_options;
in-out property <string> conv-image_path;
in-out property <string> conv-image_name;
in-out property <image> conv-image_data;
in-out property <int> conv-image_width;
in-out property <int> conv-image_height;
in-out property <image> conv-palette_data;
in-out property <int> conv-palette_width;
in-out property <int> conv-palette_height;
in-out property <string> conv-selected_encoding;
in-out property <bool> conv-palette_enable;
in-out property <bool> conv-enable_view;
callback conv-image_update_palette_size(int, int);
callback conv-image_browse_clicked;
callback conv-image_add_clicked;
x: 0px; x: 0px;
y: 0px; y: 0px;
@@ -130,19 +344,52 @@ export component FileTab inherits Rectangle {
padding: 4px; padding: 4px;
alignment: start; alignment: start;
if root.state == State.Project : ProjectWidget { if root.state == State.Project : ProjectWidget {
open_project_path <=> root.project_widget-open_project_path;
save_project_path <=> root.project_widget-save_project_path;
append_project_elements <=> root.project_widget-append_project_elements;
use_rel_paths <=> root.project_widget-use_rel_paths;
load_project_clicked() => {
root.project_widget-load_project_clicked();
} }
save_project_clicked() => {
root.project_widget-save_project_clicked();
}
browse_open_project_clicked() => {
root.project_widget-browse_open_project_clicked();
}
browse_save_project_clicked() => {
root.project_widget-browse_save_project_clicked();
}
}
if root.state == State.ConvertImage : ConvertImageWidget { if root.state == State.ConvertImage : ConvertImageWidget {
image_path <=> root.conv_image_path; encoding_options <=> root.conv-encoding_options;
image_data <=> root.conv_image_data; image_path <=> root.conv-image_path;
image_name <=> root.conv_image_name; image_data <=> root.conv-image_data;
enable_button <=> root.conv_image_enable; image-width <=> root.conv-image_width;
image-height <=> root.conv-image_height;
palette_data <=> root.conv-palette_data;
palette_width <=> root.conv-palette_width;
palette_height <=> root.conv-palette_height;
palette_visible <=> root.conv-palette_enable;
selected_encoding <=> root.conv-selected_encoding;
image_name <=> root.conv-image_name;
enable_view <=> root.conv-enable_view;
update_palette_size(width, height) => {
root.conv-image_update_palette_size(width, height);
}
browse_clicked => { browse_clicked => {
root.conv_image_browse_clicked(); root.conv-image_browse_clicked();
} }
add_clicked => { add_clicked => {
root.conv_image_add_clicked(); root.conv-image_add_clicked();
} }
} }
} }

View File

@@ -1,18 +1,31 @@
import { VRAMArea } from "../vram-components.slint"; import { VRAMArea } from "../vram-components.slint";
import { Button, ComboBox, GroupBox, StandardListView } from "std-widgets.slint"; import { Button, CheckBox, ComboBox, GroupBox, StandardListView, LineEdit, ScrollView, Slider } from "std-widgets.slint";
struct VRAMImage { struct VRAMImgData {
img: image, full_image: image,
image: image,
}
struct VRAMInfo {
x: int, x: int,
y: int, y: int,
encoding_str: string,
use_compression: bool,
trans_setting: int,
palette_count: int, palette_count: int,
is_palette: bool, is_palette: bool, // < Can we combine the palette into this, instead of having it separate?
}
struct VRAMData {
images: VRAMImgData,
info: VRAMInfo,
} }
export component MainTab inherits Rectangle { export component MainTab inherits Rectangle {
property <float> scale: 1.0;
in-out property <image> vram_bg; in-out property <image> vram_bg;
in-out property <[StandardListViewItem]> vram_files: []; in-out property <[StandardListViewItem]> vram_files: [];
in-out property <[VRAMImage]> vram_images: []; in-out property <[VRAMData]> vram_data: [];
callback add_file_clicked(); callback add_file_clicked();
callback remove_file_clicked(int); callback remove_file_clicked(int);
@@ -20,14 +33,24 @@ export component MainTab inherits Rectangle {
width: group.width + group.x*2; width: group.width + group.x*2;
height: group.height + group.y*2 + 32px; height: group.height + group.y*2 + 32px;
forward-focus: key_focus;
group := GroupBox { group := GroupBox {
title: "VRAM Layout"; title: "VRAM Layout";
x: 4px; x: 4px;
y: 4px; y: 4px;
width: main_view.width + 2*main_view.x;
VerticalLayout { VerticalLayout {
background_rect := Rectangle { main_view := ScrollView {
width: rect.width/root.scale;
height: rect.height/root.scale;
viewport-x: 0;
viewport-y: 0;
viewport-width: rect.width;
viewport-height: rect.height;
rect := Rectangle {
width: background_image.width + root.get_border_width()*2px; width: background_image.width + root.get_border_width()*2px;
height: background_image.height + root.get_border_width()*2px; height: background_image.height + root.get_border_width()*2px;
border-width: root.get_border_width()*1px; border-width: root.get_border_width()*1px;
@@ -39,25 +62,28 @@ export component MainTab inherits Rectangle {
img: vram_bg; img: vram_bg;
img_x: 0; img_x: 0;
img_y: 0; img_y: 0;
scale: scale;
} }
for vram_image[i] in root.vram_images: VRAMArea { for vram_data[i] in root.vram_data: VRAMArea {
x: root.get_border_width()*1px; x: root.get_border_width()*1px;
y: root.get_border_width()*1px; y: root.get_border_width()*1px;
img: vram_image.img; img: vram_data.images.image;
img_x: vram_image.x; img_x: vram_data.info.x;
img_y: vram_image.y; img_y: vram_data.info.y;
scale: scale;
TouchArea { TouchArea {
x: (parent.img_x + self.lines_crossed_x())*1px; x: ((parent.img_x + self.lines_crossed_x())*1px)*scale;
y: (parent.img_y + self.lines_crossed_y())*1px; y: ((parent.img_y + self.lines_crossed_y())*1px)*scale;
width: (parent.img.width + self.lines_crossed_width())*1px; width: ((parent.img.width + self.lines_crossed_width())*1px)*scale;
height: (parent.img.height + self.lines_crossed_height())*1px; height: ((parent.img.height + self.lines_crossed_height())*1px)*scale;
mouse-cursor: grab; mouse-cursor: grab;
moved => { moved => {
self.mouse-cursor = MouseCursor.grabbing; self.mouse-cursor = MouseCursor.grabbing;
root.move_vram_image(i, (self.mouse-x - self.pressed-x)/1px, (self.mouse-y - self.pressed-y)/1px); root.move_vram_image(i, ((self.mouse-x - self.pressed-x)/scale)/1px, ((self.mouse-y - self.pressed-y)/scale)/1px);
cur_sel_x.display_value = parent.img_x; cur_sel_x.text = parent.img_x;
cur_sel_y.display_value = parent.img_y; cur_sel_y.text = parent.img_y;
} }
pointer-event(event) => { pointer-event(event) => {
if event.kind == PointerEventKind.up { if event.kind == PointerEventKind.up {
@@ -65,10 +91,22 @@ export component MainTab inherits Rectangle {
} }
if event.kind == PointerEventKind.down { if event.kind == PointerEventKind.down {
cur_sel_x.display_value = parent.img_x; cur_sel_x.text = parent.img_x;
cur_sel_y.display_value = parent.img_y; cur_sel_y.text = parent.img_y;
cur_sel_img.source = parent.img; cur_sel_width.text = "Width: " + vram_data.images.image.width;
cur_sel_height.text = "Height: " + vram_data.images.image.height;
cur_sel_img.source = vram_data.images.full_image;
encoding_text.encoding_str = vram_data.info.encoding_str;
cur_sel_img.visible = true; cur_sel_img.visible = true;
if !vram-data.info.is_palette {
file_settings_box.set_active(i);
}
else {
file_settings_box.set_inactive();
}
vram_files_list.current-item = i; vram_files_list.current-item = i;
} }
} }
@@ -92,6 +130,48 @@ export component MainTab inherits Rectangle {
} }
} }
} }
function update_viewport() {
// If this value is positive, then the image moved so much to the right, that we do not use the full display area anymore
if self.viewport-x > 0 {
self.viewport-x = 0;
}
if abs(self.viewport-x) + self.width > self.viewport-width {
self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width;
}
if self.viewport-y > 0 {
self.viewport-y = 0;
}
// If this value is positive, then the image moved so much down, that we do not use the full display area anymore
if abs(self.viewport-y) + self.height > self.viewport-height {
self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height;
}
}
}
HorizontalLayout {
padding: 4px;
VerticalLayout {
alignment: center;
padding-right: 4px;
Text {
text: "Scale: " + round(slider.value) + "%";
}
}
slider := Slider {
minimum: 100.0;
maximum: 800.0;
step: 1.0;
value: 100.0;
changed(value) => {
root.scale = round(value)/100.0;
main_view.update_viewport();
}
}
}
HorizontalLayout { HorizontalLayout {
padding: 4px; padding: 4px;
GroupBox { GroupBox {
@@ -100,15 +180,41 @@ export component MainTab inherits Rectangle {
alignment: start; alignment: start;
padding: 4px; padding: 4px;
vram_files_list := StandardListView { vram_files_list := StandardListView {
width: background_image.width/2; width: background_image.width/root.scale/2;
height: 128px; height: 128px;
model: root.vram_files; model: root.vram_files;
current-item-changed(current-item) => { current-item-changed(current-item) => {
cur_sel_x.display_value = root.vram_images[current-item].x; cur_sel_x.text = root.vram_data[current-item].info.x;
cur_sel_y.display_value = root.vram_images[current-item].y; cur_sel_y.text = root.vram_data[current-item].info.y;
cur_sel_img.source = root.vram_images[current-item].img; cur_sel_width.text = "Width: " + root.vram_data[current-item].images.image.width;
cur_sel_height.text = "Height: " + root.vram_data[current-item].images.image.height;
cur_sel_img.source = root.vram_data[current-item].images.full_image;
encoding_text.encoding_str = root.vram_data[current-item].info.encoding_str;
cur_sel_img.visible = true; cur_sel_img.visible = true;
if !root.vram_data[current-item].info.is_palette {
file_settings_box.set_active(current-item);
}
else {
file_settings_box.set_inactive();
}
}
item-pointer-event(item, event, position) => {
if event.button == PointerEventButton.right && event.kind == PointerEventKind.down {
main_view.viewport-x = -(root.vram_data[item].info.x + (root.vram_data[item].info.x/64))*root.scale*1px + (main_view.width/4);
main_view.viewport-y = -(root.vram_data[item].info.y + (root.vram_data[item].info.y/256))*root.scale*1px + (main_view.height/4);
main_view.update_viewport();
}
}
}
HorizontalLayout {
padding: 4px;
alignment: center;
Text {
text: "Right click to focus element on screen";
} }
} }
HorizontalLayout { HorizontalLayout {
@@ -121,10 +227,7 @@ export component MainTab inherits Rectangle {
text: "Remove file"; text: "Remove file";
clicked => { clicked => {
root.remove_file_clicked(vram_files_list.current_item); root.remove_file_clicked(vram_files_list.current_item);
vram_files_list.current-item = -1; root.clear_current_selection();
cur_sel_x.display_value = 0;
cur_sel_y.display_value = 0;
cur_sel_img.visible = false;
} }
} }
} }
@@ -142,19 +245,98 @@ export component MainTab inherits Rectangle {
width: 128px; width: 128px;
height: 128px; height: 128px;
image-fit: contain; image-fit: contain;
image-rendering: pixelated;
} }
} }
cur_sel_x := Text { HorizontalLayout {
in-out property <int> display_value; alignment: start;
text: "X: " + display_value; VerticalLayout {
alignment: center;
Text {
text: "X: ";
} }
cur_sel_y :=Text {
in-out property <int> display_value;
text: "Y: " + display_value;
} }
ComboBox { cur_sel_x := LineEdit {
model: ["4-bit", "16-bit", "24-bit"]; input-type: number;
current-value: "4-bit"; text: 0;
width: 48pt;
accepted(text) => {
if(vram_files_list.current-item != -1) {
root.move_vram_image(vram_files_list.current-item, text.to-float() - vram_data[vram_files_list.current-item].info.x, 0);
self.text = vram_data[vram_files_list.current-item].info.x;
}
}
}
VerticalLayout {
alignment: center;
cur_sel_width := Text {
text: "Width: 0";
}
}
}
HorizontalLayout {
alignment: start;
VerticalLayout {
alignment: center;
Text {
text: "Y: ";
}
}
cur_sel_y := LineEdit {
input-type: number;
text: 0;
width: 48pt;
accepted(text) => {
if(vram_files_list.current-item != -1) {
root.move_vram_image(vram_files_list.current-item, 0, text.to-float() - vram_data[vram_files_list.current-item].info.y);
self.text = vram_data[vram_files_list.current-item].info.y;
}
}
}
VerticalLayout {
alignment: center;
cur_sel_height := Text {
text: "Height: 0";
}
}
}
encoding_text := Text {
in-out property <string> encoding_str;
text: "Encoding: " + encoding_str;
}
}
}
file_settings_box := GroupBox {
title: "File settings";
enabled: false;
VerticalLayout {
alignment: start;
lz4_check_box := CheckBox {
text: "Compress (lz4)";
enabled: file_settings_box.enabled;
toggled => {
if(vram_files_list.current-item != -1) {
root.vram_data[vram_files_list.current-item].info.use_compression = self.checked;
}
}
}
GroupBox {
title: "Transparency:";
enabled: file_settings_box.enabled;
VerticalLayout {
alignment: start;
trans_combo_box := ComboBox {
model: ["No transparency", "First color transparent", "PSX semi-transparency", "Both"];
enabled: file_settings_box.enabled;
selected(current-value) => {
if(vram_files_list.current-item != -1) {
root.vram_data[vram_files_list.current-item].info.trans_setting = self.current-index;
} }
} }
} }
@@ -162,7 +344,61 @@ export component MainTab inherits Rectangle {
} }
} }
public function set_active(current-item: int) {
lz4_check_box.checked = root.vram_data[current-item].info.use_compression;
trans_combo_box.current-index = root.vram_data[current-item].info.trans_setting;
self.enabled = true;
}
public function set_inactive() {
lz4_check_box.checked = false;
trans_combo_box.current-index = 0;
self.enabled = false;
}
}
}
}
}
key_focus := FocusScope {
key-pressed(event) => {
if(vram_files_list.current-item != -1) {
if(event.text == Key.LeftArrow) {
root.move_vram_image(vram_files_list.current-item, -1, 0);
cur_sel_x.text = vram_data[vram_files_list.current-item].info.x;
}
if(event.text == Key.RightArrow) {
root.move_vram_image(vram_files_list.current-item, 1, 0);
cur_sel_x.text = vram_data[vram_files_list.current-item].info.x;
}
if(event.text == Key.UpArrow) {
root.move_vram_image(vram_files_list.current-item, 0, -1);
cur_sel_y.text = vram_data[vram_files_list.current-item].info.y;
}
if(event.text == Key.DownArrow) {
root.move_vram_image(vram_files_list.current-item, 0, 1);
cur_sel_y.text = vram_data[vram_files_list.current-item].info.y;
}
}
accept
}
}
function get_border_width() -> int { function get_border_width() -> int {
return 4; return 4;
} }
public function clear_current_selection() {
vram_files_list.current-item = -1;
cur_sel_x.text = 0;
cur_sel_y.text = 0;
cur_sel_img.visible = false;
}
public function set_active() {
key_focus.focus();
}
} }

View File

@@ -3,14 +3,18 @@ component VRAMSegment inherits Rectangle {
in property <image> img; in property <image> img;
in property <int> clip_x; in property <int> clip_x;
in property <int> clip_y; in property <int> clip_y;
in property <float> scale: 1.0;
width: 64px; width: 64px*scale;
height: 256px; height: 256px*scale;
clip: true; clip: true;
Image { Image {
source: img; source: img;
x: -root.clip_x*1px; x: -root.clip_x*1px*scale;
y: -root.clip_y*1px; y: -root.clip_y*1px*scale;
width: img.width*1px*scale;
height: img.height*1px*scale;
image-rendering: pixelated;
} }
} }
@@ -18,17 +22,19 @@ export component VRAMArea inherits Rectangle {
in property <image> img; in property <image> img;
in property <int> img_x; in property <int> img_x;
in property <int> img_y; in property <int> img_y;
in property <float> scale: 1.0;
width: (64*16+15)*1px; width: ((64*16+15)*1px)*scale;
height: (256*2+1)*1px; height: ((256*2+1)*1px)*scale;
for idx in 32 : VRAMSegment { for idx in 32 : VRAMSegment {
x: root.get_x(idx)*(64px + 1px); x: (root.get_x(idx)*(64px + 1px))*scale;
y: root.get_y(idx)*(256px + 1px); y: (root.get_y(idx)*(256px + 1px))*scale;
img: img; img: img;
clip_x: (root.get_x(idx)*64) - root.img_x; clip_x: (root.get_x(idx)*64) - root.img_x;
clip_y: (root.get_y(idx)*256) - root.img_y; clip_y: (root.get_y(idx)*256) - root.img_y;
scale: root.scale;
} }
function get_x(idx: int) -> int { function get_x(idx: int) -> int {

556
src/Tools/tool_helper/Cargo.lock generated Normal file
View File

@@ -0,0 +1,556 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys",
]
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bumpalo"
version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cc"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
[[package]]
name = "cdtypes"
version = "1.0.0"
dependencies = [
"byteorder",
"chrono",
"paste",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-targets",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "envmnt"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d73999a2b8871e74c8b8bc23759ee9f3d85011b24fafc91a4b3b5c8cc8185501"
dependencies = [
"fsio",
"indexmap",
]
[[package]]
name = "fsio"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dad0ce30be0cc441b325c5d705c8b613a0ca0d92b6a8953d41bd236dc09a36d0"
dependencies = [
"dunce",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hound"
version = "3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
[[package]]
name = "iana-time-zone"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "js-sys"
version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "log"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
[[package]]
name = "lz4"
version = "1.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4"
dependencies = [
"lz4-sys",
]
[[package]]
name = "lz4-sys"
version = "1.11.1+lz4-1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "paste"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tool_helper"
version = "1.0.0"
dependencies = [
"byteorder",
"cdtypes",
"colored",
"envmnt",
"hound",
"lz4",
"paste",
"wslpath",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
dependencies = [
"unicode-ident",
]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

244
src/Tools/wslpath/Cargo.lock generated Normal file
View File

@@ -0,0 +1,244 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
"once_cell",
"windows-sys",
]
[[package]]
name = "clap"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.5.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "colorchoice"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "proc-macro2"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
dependencies = [
"proc-macro2",
]
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "syn"
version = "2.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "utf8parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "wslpath"
version = "1.1.0"
dependencies = [
"clap",
]

View File

@@ -19,7 +19,7 @@
{ {
"label": "make", "label": "make",
"type": "shell", "type": "shell",
"command": "../../scripts/podman_jaby_engine.sh ${workspaceFolder}/..:src/FontWriter make ${input:target} BUILD_PROFILE=${input:build cfg}", "command": "../../scripts/podman_jaby_engine.sh ${workspaceFolder}/..:src/FontWriter bear --output ${workspaceFolder}/../compile_commands.json -- make ${input:target} BUILD_PROFILE=${input:build cfg}",
"group": "build" "group": "build"
} }
], ],