From c8e5cfcdef0069d42faed229a453338ab09bcbdd Mon Sep 17 00:00:00 2001 From: Stefan Stefanov Date: Sun, 21 Apr 2024 09:38:05 +0300 Subject: [PATCH] add odin-aseprite dependency & start of a generator --- .gitmodules | 3 + .vscode/tasks.json | 136 ++++++++++++--------- README.md | 2 + src/aseprite | 1 + src/aseprite_odin_generator/atlas.png | Bin 0 -> 10342 bytes src/aseprite_odin_generator/big.aseprite | Bin 0 -> 683 bytes src/aseprite_odin_generator/big.png | Bin 0 -> 515 bytes src/aseprite_odin_generator/generator.odin | 82 +++++++++++++ src/game.odin | 10 +- 9 files changed, 170 insertions(+), 64 deletions(-) create mode 100644 .gitmodules create mode 160000 src/aseprite create mode 100644 src/aseprite_odin_generator/atlas.png create mode 100644 src/aseprite_odin_generator/big.aseprite create mode 100644 src/aseprite_odin_generator/big.png create mode 100644 src/aseprite_odin_generator/generator.odin diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6282b93 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/aseprite"] + path = src/aseprite + url = https://github.com/bersK/odin-aseprite.git diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d4d47ba..b1eca51 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,60 +1,80 @@ { - "version": "2.0.0", - "command": "", - "args": [], - "tasks": [ - { - "label": "Build Debug", - "type": "shell", - "windows": { - "command": "${workspaceFolder}/scripts/build_debug.bat", - }, - "linux": { - "command": "${workspaceFolder}/scripts/build_debug.sh", - }, - "osx": { - "command": "${workspaceFolder}/scripts/build_debug.sh", - }, - "group": "build" - }, - { - "label": "Build Release", - "type": "shell", - "windows": { - "command": "${workspaceFolder}/scripts/build_release.bat", - }, - "linux": { - "command": "${workspaceFolder}/scripts/build_release.sh", - }, - "osx": { - "command": "${workspaceFolder}/scripts/build_release.sh", - }, - "group": "build" - }, - { - "label": "Build Hot Reload", - "type": "shell", - "windows": { - "command": "${workspaceFolder}/scripts/build_hot_reload.bat; start game.exe", - }, - "linux": { - "command": "${workspaceFolder}/scripts/build_hot_reload.sh", - }, - "osx": { - "command": "${workspaceFolder}/scripts/build_hot_reload.sh", - }, - "presentation": { - "echo": true, - "reveal": "always", - "focus": false, - "panel": "shared", - "showReuseMessage": false, - "clear": true - }, - "group": { - "kind": "build", - "isDefault": true - }, - } - ] + "version": "2.0.0", + "command": "", + "args": [], + "tasks": [ + { + "label": "Build Debug", + "type": "shell", + "windows": { + "command": "${workspaceFolder}/scripts/build_debug.bat", + }, + "linux": { + "command": "${workspaceFolder}/scripts/build_debug.sh", + }, + "osx": { + "command": "${workspaceFolder}/scripts/build_debug.sh", + }, + "group": "build" + }, + { + "label": "Build Release", + "type": "shell", + "windows": { + "command": "${workspaceFolder}/scripts/build_release.bat", + }, + "linux": { + "command": "${workspaceFolder}/scripts/build_release.sh", + }, + "osx": { + "command": "${workspaceFolder}/scripts/build_release.sh", + }, + "group": "build" + }, + { + "label": "Build Hot Reload", + "type": "shell", + "windows": { + "command": "${workspaceFolder}/scripts/build_hot_reload.bat; start game.exe", + }, + "linux": { + "command": "${workspaceFolder}/scripts/build_hot_reload.sh", + }, + "osx": { + "command": "${workspaceFolder}/scripts/build_hot_reload.sh", + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": false, + "clear": true + }, + "group": { + "kind": "build", + "isDefault": false + }, + }, + { + "label": "Build&Run Tile Generator Test", + "type": "shell", + "command": "odin run src/aseprite_odin_generator -out:build/aseprite_odin_generator.exe", + "options": { + "cwd": "${workspaceFolder}" + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": false, + "clear": true + }, + "group": { + "kind": "build", + "isDefault": true + }, + } + ] } \ No newline at end of file diff --git a/README.md b/README.md index 6dc89db..a20f4ac 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,6 @@ Yet-Another-Atlas-Packer by Stefan Stefanov Simple atlas packer using `stb_rect_pack` from the `stb` family of header libraries & `raylib` for rendering/ui. +I'm using a custom marshall/unmarshall odin library for reading .aseprite files found [here](https://github.com/blob1807/odin-aseprite) + Project template provided by Karl Zylinski on github [here](https://github.com/karl-zylinski/odin-raylib-hot-reload-game-template). diff --git a/src/aseprite b/src/aseprite new file mode 160000 index 0000000..f21bed8 --- /dev/null +++ b/src/aseprite @@ -0,0 +1 @@ +Subproject commit f21bed838a6d1e6bc1178ea0876596eb14190192 diff --git a/src/aseprite_odin_generator/atlas.png b/src/aseprite_odin_generator/atlas.png new file mode 100644 index 0000000000000000000000000000000000000000..02082b443dfd9eb206f7375267ffaa77d2d3983a GIT binary patch literal 10342 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&zE~)R&4YzZe)abUj@hLn`8u-vm$nd%l6K zE6+YHMS^v)qJb0>f;eo(GQ;h0nF))Va{_{R(t03+Il<&=f7^i!jvffXa5#gxA+h8~ zy@@*91{sj;AYaS0m~m5R1VW*q~-kMHNf{HmEn`F!b>K>`!}&Y80^MS&+!_ zW#y@V^1KfaQVYeI7I!~(3)a1<*bwtm{BE7itZ8nSFF`9Xo`nJux?9{QYeyGEeS_U!qJj&v?LrY2}eu9p;8ha cwr63OzgS(~VBO7$!1aR+p00i_>zopr0H?L}mjD0& literal 0 HcmV?d00001 diff --git a/src/aseprite_odin_generator/big.aseprite b/src/aseprite_odin_generator/big.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..bfc55aa64ad69013a578098a6aac7774308fdcf1 GIT binary patch literal 683 zcmZ3@#K7=iDI)^|BLkxXkYHd)0b&GjU|<9ZG6(=6Er2%A{$C&2z_zjhEf51@b_KAN zNYhpv2;st4g1$?Ee6Uw`C&# z7m55oq5A)I_~k!!GoQsr9rZV!;VqXRAnfDAqvyh4nahy5iebhbhO<9;KK`Hb_y6BZ zZ$Ec_y>0)uiu0EN^GzP6$;^`W)*{YHDv6UV`cDO&JQ2|Lt+D-UXzVK^n-hKf0FFKy&( zFc5LQsFU=P=^Ed|6v->9N@9!~4QnPyShC0c@0$I5<&)b&HapB0OGmwE<2Vb`j*I>i zely7O`fv8+6?utiU+7X0Su@1uFvw&=<)G4GngoH~;f^FdS)5EV0uyFtc`KV2IAJ5CQ-VR-(fI literal 0 HcmV?d00001 diff --git a/src/aseprite_odin_generator/big.png b/src/aseprite_odin_generator/big.png new file mode 100644 index 0000000000000000000000000000000000000000..b2f4a733dad684329714b55426dfa179171fb62a GIT binary patch literal 515 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G!U;i$lZxy-8q?;K=xiw7srr_ zIdAW5GCg-HgEmVfX