Build images from scratch

This commit is contained in:
Bill Rossi 2025-03-08 13:30:17 -05:00
parent 24b460bbf2
commit a54152cfea
5 changed files with 19 additions and 4 deletions

4
.gitignore vendored
View File

@ -4,4 +4,6 @@ starship_futuretime_linux
starship_futuretime_mac starship_futuretime_mac
starship_futuretime_windows.exe starship_futuretime_windows.exe
*.zip *.zip
levels/*.csv levels/*.csv
img/*.png
tilesets/*.png

View File

@ -6,6 +6,7 @@ WIN_LIB=-Llib -Iinclude -Wall -lraylib -lopengl32 -lgdi32 -lwinmm -lcomdlg32 -lo
WIN_CFLAGS=-Wall -lraylib -lm -lpthread WIN_CFLAGS=-Wall -lraylib -lm -lpthread
TILED=~/app/tiled TILED=~/app/tiled
ASEPRITE=aseprite
GAME=starship_futuretime GAME=starship_futuretime
@ -15,9 +16,9 @@ ITCH_CHANNEL_LINUX=linux-x64
ITCH_CHANNEL_WINDOWS=windows-x64 ITCH_CHANNEL_WINDOWS=windows-x64
ITCH_CHANNEL_MAC=mac ITCH_CHANNEL_MAC=mac
.PHONY: clean run butler_upload build_levels .PHONY: clean run butler_upload build_levels build_images
run: $(GAME)_linux build_levels run: $(GAME)_linux build_levels build_images
SKIP_INTRO=1 ./$(GAME)_linux SKIP_INTRO=1 ./$(GAME)_linux
debug: $(GAME)_linux_dbg debug: $(GAME)_linux_dbg
@ -25,11 +26,21 @@ debug: $(GAME)_linux_dbg
in_level_files := $(wildcard levels/*.tmx) in_level_files := $(wildcard levels/*.tmx)
out_level_files := $(foreach a, $(in_level_files), $(basename $(a)).csv) out_level_files := $(foreach a, $(in_level_files), $(basename $(a)).csv)
build_levels: $(in_level_files) $(out_level_files) build_levels: build_images $(in_level_files) $(out_level_files)
levels/%.csv: levels/%.tmx tilesets/*.tsx levels/%.csv: levels/%.tmx tilesets/*.tsx
$(TILED) --export-map $< $@ $(TILED) --export-map $< $@
in_images := $(wildcard img/*.aseprite) $(wildcard tilesets/*.aseprite)
out_images := $(foreach a, $(in_images), $(basename $(a)).png)
build_images: $(in_images) $(out_images)
img/%.png: img/%.aseprite
$(ASEPRITE) -b $< --save-as $@
%.png: %.aseprite
$(ASEPRITE) -b $< --save-as $@
$(GAME)_linux: *.c $(GAME)_linux: *.c
$(CC) *.c $(CFLAGS) -o $(GAME)_linux $(CC) *.c $(CFLAGS) -o $(GAME)_linux
@ -50,6 +61,8 @@ clean:
rm -f ./$(GAME)_mac rm -f ./$(GAME)_mac
rm -f ./$(GAME)_mac.zip rm -f ./$(GAME)_mac.zip
rm -f ./levels/*.csv rm -f ./levels/*.csv
rm -f ./img/*.png
rm -f ./tilesets/*.png
$(GAME)_linux.zip: $(GAME)_linux $(GAME)_linux.zip: $(GAME)_linux
rm -f ./$(GAME)_linux.zip rm -f ./$(GAME)_linux.zip

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B