-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 1.72 KB
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
GAME=hellwave
BASE=id1
BASEDIR := ../$(BASE)
GAMEDIR := .
MAPS := $(filter-out $(GAMEDIR)/maps/autosave.map %.autosave.map,$(wildcard $(GAMEDIR)/maps/*.map))
BSP_FILES := $(MAPS:.map=.bsp)
NAV_FILES := $(MAPS:.map=.nav)
DEDICATED := node --preserve-symlinks --preserve-symlinks-main ../../dedicated.mjs
TOOLS_DIR := ../../../tools/ericw-tools
QBSP := $(TOOLS_DIR)/qbsp
VIS := $(TOOLS_DIR)/vis
LIGHT := $(TOOLS_DIR)/light
FORMAT=bsp2
LMSCALE=8
LGRIDSIZE=-lightgrid_dist 16 16 16
LGRID=-lightgrid
QUALITY=-extra4
FLAGS=-lowpriority
BMODELFLAGS=-bspx -bmodelcontents
ADDMAPS=-add $(GAMEDIR)/maps/_hw_lights.map
# -bspxonly/-novanilla skip the vanilla lighting lump in favor of BSPX RGB data,
# which is required for BSP29/BSP2 (whose native lump is mono-only) but breaks
# Quake II output: Q2's native LIGHTING lump is already RGB, and there is no
# BSPX lightmap-equivalent lump for it to fall back to, so -novanilla silently
# leaves the compiled BSP38 with zero lighting data. Only apply them for Q1-family formats.
ifeq ($(FORMAT),q2bsp)
LIGHT_BSPXFLAGS=
else
LIGHT_BSPXFLAGS=-bspxonly -novanilla
endif
all: $(BSP_FILES) $(NAV_FILES)
%.bsp: %.map
$(QBSP) -basedir $(BASEDIR) -gamedir $(GAMEDIR) $(FLAGS) $(ADDMAPS) -transwater -litwater -splitturb -nosoftware $(BMODELFLAGS) -$(FORMAT) $<
$(VIS) -basedir $(BASEDIR) -gamedir $(GAMEDIR) $(FLAGS) -noambientwater -noambientslime -noambientlava $<
$(LIGHT) -basedir $(BASEDIR) -gamedir $(GAMEDIR) $(FLAGS) $(LIGHT_BSPXFLAGS) -bspx -bspxlux -wrnormals -lightmap_scale $(LMSCALE) $(LGRID) $(LGRIDSIZE) $(QUALITY) $<
%.nav: %.map
@mapname=$$(basename "$<" .map); \
$(DEDICATED) -noserver -basedir $(notdir $(BASEDIR)) -game $(GAME) +nav_build_process 1 +map $$mapname
clean:
rm -f $(GAMEDIR)/maps/*.bsp