diff options
Diffstat (limited to 'pixel-client')
-rw-r--r-- | pixel-client/makefile | 51 | ||||
-rw-r--r-- | pixel-client/tools/Cargo.toml | 2 |
2 files changed, 38 insertions, 15 deletions
diff --git a/pixel-client/makefile b/pixel-client/makefile index 6a56fc62..6aa891d3 100644 --- a/pixel-client/makefile +++ b/pixel-client/makefile @@ -1,4 +1,18 @@ - +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# SPRITES = $(shell find assets/sprites -name '*.ta') SPRITES_PNG = $(patsubst %.ta,%.png,$(SPRITES)) @@ -8,7 +22,16 @@ TEXTURES_IMPORT_PNG = $(patsubst %.import.png,%.ta,$(shell find assets/textures PNG = $(shell find assets/textures -name '*.png') -.PHONY: tex_pack tex_export tex_import clean +CLIENT_DEPS = assets/atlas.meta.csv assets/atlas.ta assets/connect.csv assets/palette.csv + +IMPORT = ../target/release/tex_import +EXPORT = ../target/release/tex_export +PACK = ../target/release/tex_pack +COMPOSE = ../target/release/tex_compose +CLIENT = ../target/release/pixelcurry + +.PHONY: all tex_pack tex_export tex_import clean +all: $(CLIENT) tex_pack: assets/atlas.ta tex_import: $(TEXTURES_IMPORT_PNG) tex_export: $(TEXTURES_PNG) $(SPRITES_PNG) assets/atlas.png @@ -17,21 +40,21 @@ clean: rm -fr assets/sprites rm -f assets/atlas.ta assets/atlas.meta.csv +$(CLIENT): $(shell find src -type f) $(CLIENT_DEPS) + cargo build --release --bin pixelcurry +$(IMPORT) $(EXPORT) $(PACK) $(COMPOSE): $(shell find tools/src -type f) + { cd tools; cargo build --release; } -IMPORT = ../target/release/tex_import -EXPORT = ../target/release/tex_export -PACK = ../target/release/tex_pack -COMPOSE = ../target/release/tex_compose - -%.ta: %.import.png +%.ta: %.import.png $(IMPORT) $(IMPORT) $< $@ -%.png: %.ta - ../target/release/tex_export $< $@ +%.png: %.ta $(EXPORT) + $(EXPORT) $< $@ -assets/sprites/%/all: assets/%.ini $(TEXTURES) +assets/sprites/%/all: assets/%.ini $(TEXTURES) $(COMPOSE) @mkdir -p $(basename $@) - ../target/release/tex_compose $< assets/textures $(basename $@) + $(COMPOSE) $< assets/textures $(basename $@) @touch $@ -assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all assets/sprites/misc/all - ../target/release/tex_pack assets/atlas.ta assets/atlas.meta.csv $(SPRITES) +assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all assets/sprites/misc/all $(PACK) + @echo $(PACK) assets/atlas.ta assets/atlas.meta.csv ... + @$(PACK) assets/atlas.ta assets/atlas.meta.csv $(SPRITES) diff --git a/pixel-client/tools/Cargo.toml b/pixel-client/tools/Cargo.toml index f3075594..3392352b 100644 --- a/pixel-client/tools/Cargo.toml +++ b/pixel-client/tools/Cargo.toml @@ -9,4 +9,4 @@ anyhow = "1.0.86" log = "0.4.22" env_logger = "0.11.3" clap = { version = "4.5.9", features = ["derive"] } -sdl2 = "0.37.0" +sdl2 = { version = "0.37.0", features = ["image", "ttf"] } |