-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-assets
64 lines (45 loc) · 2.52 KB
/
make-assets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
substDirList = $(foreach dir, $(1), \
$(patsubst %.$(2), %.$(3), \
$(patsubst asset-src/%, assets/%, $(wildcard $(dir)/*.$(2)))))
substDirListT = $(foreach dir, $(1), \
$(patsubst %.$(2), %.$(3), \
$(patsubst asset-src/%, asset-temp/%, $(wildcard $(dir)/*.$(2)))))
substDirListTs1 = $(foreach dir, $(1), \
$(patsubst %.$(2), %.$(3), \
$(patsubst asset-src/models/functions/%, asset-temp/models/%, $(wildcard $(dir)/*.$(2)))))
all: maps terrain entity-sprites
python3 tools/rebuild-index.py
## MAPS ###
maps: $(call substDirList,asset-src/maps,msf,map)
assets/maps/%.map: asset-src/maps/%.msf
mkdir -p assets/maps
python3 tools/compile-map.py --level=9 $< asset-src/textures/terrain/gimpfiles/blocknames.tti asset-src/textures/decorations/gimpfiles/blocknames.tti $@
## TERRAIN AND DECORATIONS ##
terrain: assets/textures/terrain/blocks.0.png assets/textures/decorations/blocks.0.png
terrain-pngs: $(call substDirListT,asset-src/textures/terrain/gimpfiles,xcf,png)
asset-temp/textures/terrain/gimpfiles/%.png: asset-src/textures/terrain/gimpfiles/%.xcf
mkdir -p asset-temp/textures/terrain/gimpfiles
xcf2png $< > $@
assets/textures/terrain/blocks.0.png: terrain-pngs
mkdir -p assets/textures/terrain
python3 tools/autostitch.py assets/textures/terrain/blocks asset-src/textures/terrain/gimpfiles/blocknames.tti assets/textures/terrain/blocks.tti asset-temp/textures/terrain/gimpfiles
decoration-pngs: $(call substDirListT,asset-src/textures/decorations/gimpfiles,xcf,png)
asset-temp/textures/decorations/gimpfiles/%.png: asset-src/textures/decorations/gimpfiles/%.xcf
mkdir -p asset-temp/textures/decorations/gimpfiles
xcf2png $< > $@
assets/textures/decorations/blocks.0.png: decoration-pngs
mkdir -p assets/textures/decorations
python3 tools/autostitch.py assets/textures/decorations/blocks asset-src/textures/decorations/gimpfiles/blocknames.tti assets/textures/decorations/blocks.tti asset-temp/textures/decorations/gimpfiles
## ENTITY SPRITES ##
entity-sprites: assets/textures/entity/entities.0.png
assets/textures/entity/entities.0.png: entity-pngs
mkdir -p assets/textures/entity
python3 tools/autostitch.py assets/textures/entity/entities "*" assets/textures/entity/entities.tti asset-temp/textures/entity/gimpfiles
entity-pngs: $(call substDirListT,asset-src/textures/entity/gimpfiles,xcf,png)
asset-temp/textures/entity/gimpfiles/%.png: asset-src/textures/entity/gimpfiles/%.xcf
mkdir -p asset-temp/textures/entity/gimpfiles
xcf2png $< > $@
clean:
rm -rf asset-temp assets
yukkuri:
@echo "ゆっくりしていってね!"