Added LEGACY_RES Flag
This commit is contained in:
parent
0ca30fbd7e
commit
ae1eaab79c
77
Makefile
77
Makefile
@ -43,9 +43,7 @@ TEXTURE_FIX ?= 0
|
|||||||
# Enable extended options menu by default
|
# Enable extended options menu by default
|
||||||
EXT_OPTIONS_MENU ?= 1
|
EXT_OPTIONS_MENU ?= 1
|
||||||
# Disable text-based save-files by default
|
# Disable text-based save-files by default
|
||||||
TEXTSAVES ?= 0
|
TEXTSAVES ?= 1
|
||||||
# Load resources from external files
|
|
||||||
EXTERNAL_DATA ?= 0
|
|
||||||
# Enable Discord Rich Presence
|
# Enable Discord Rich Presence
|
||||||
DISCORDRPC ?= 0
|
DISCORDRPC ?= 0
|
||||||
|
|
||||||
@ -65,8 +63,7 @@ AUDIO_API ?= SDL2
|
|||||||
# Controller backends (can have multiple, space separated): SDL2
|
# Controller backends (can have multiple, space separated): SDL2
|
||||||
CONTROLLER_API ?= SDL2
|
CONTROLLER_API ?= SDL2
|
||||||
|
|
||||||
# Misc settings for EXTERNAL_DATA
|
LEGACY_RES ?= 0
|
||||||
|
|
||||||
BASEDIR ?= res
|
BASEDIR ?= res
|
||||||
|
|
||||||
# Automatic settings for PC port(s)
|
# Automatic settings for PC port(s)
|
||||||
@ -412,7 +409,7 @@ RPC_LIBS :=
|
|||||||
ifeq ($(DISCORDRPC),1)
|
ifeq ($(DISCORDRPC),1)
|
||||||
ifeq ($(WINDOWS_BUILD),1)
|
ifeq ($(WINDOWS_BUILD),1)
|
||||||
RPC_LIBS := lib/discord/libdiscord-rpc.dll
|
RPC_LIBS := lib/discord/libdiscord-rpc.dll
|
||||||
else ifeq ($(OSX_BUILD),1)
|
else ifeq ($(OSX_BUILD),1)
|
||||||
# needs testing
|
# needs testing
|
||||||
RPC_LIBS := lib/discord/libdiscord-rpc.dylib
|
RPC_LIBS := lib/discord/libdiscord-rpc.dylib
|
||||||
else
|
else
|
||||||
@ -595,14 +592,14 @@ ifeq ($(LEGACY_GL),1)
|
|||||||
CFLAGS += -DLEGACY_GL
|
CFLAGS += -DLEGACY_GL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# TODO: Remove -DEXTERNAL_DATA
|
||||||
|
|
||||||
# Load external textures
|
# Load external textures
|
||||||
ifeq ($(EXTERNAL_DATA),1)
|
CC_CHECK += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
||||||
CC_CHECK += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
CFLAGS += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
||||||
CFLAGS += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
# tell skyconv to write names instead of actual texture data and save the split tiles so we can use them later
|
||||||
# tell skyconv to write names instead of actual texture data and save the split tiles so we can use them later
|
SKYTILE_DIR := $(BUILD_DIR)/textures/skybox_tiles
|
||||||
SKYTILE_DIR := $(BUILD_DIR)/textures/skybox_tiles
|
SKYCONV_ARGS := --store-names --write-tiles "$(SKYTILE_DIR)"
|
||||||
SKYCONV_ARGS := --store-names --write-tiles "$(SKYTILE_DIR)"
|
|
||||||
endif
|
|
||||||
|
|
||||||
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
|
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
|
||||||
|
|
||||||
@ -670,8 +667,6 @@ else
|
|||||||
CP := cp
|
CP := cp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(EXTERNAL_DATA),1)
|
|
||||||
|
|
||||||
BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/
|
BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/
|
||||||
BASEPACK_LST := $(BUILD_DIR)/basepack.lst
|
BASEPACK_LST := $(BUILD_DIR)/basepack.lst
|
||||||
|
|
||||||
@ -696,9 +691,7 @@ $(BASEPACK_LST): $(EXE)
|
|||||||
|
|
||||||
# prepares the resource ZIP with base data
|
# prepares the resource ZIP with base data
|
||||||
$(BASEPACK_PATH): $(BASEPACK_LST)
|
$(BASEPACK_PATH): $(BASEPACK_LST)
|
||||||
@$(PYTHON) $(TOOLS_DIR)/mkzip.py $(BASEPACK_LST) $(BASEPACK_PATH)
|
@$(PYTHON) $(TOOLS_DIR)/mkzip.py $(BASEPACK_LST) $(BASEPACK_PATH) $(LEGACY_RES)
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(BUILD_DIR_BASE)
|
$(RM) -r $(BUILD_DIR_BASE)
|
||||||
@ -797,42 +790,6 @@ ifeq ($(DISCORDRPC),1)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################
|
|
||||||
# TEXTURE GENERATION #
|
|
||||||
################################################################
|
|
||||||
|
|
||||||
# RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4
|
|
||||||
|
|
||||||
ifeq ($(EXTERNAL_DATA),1)
|
|
||||||
|
|
||||||
$(BUILD_DIR)/%: %.png
|
|
||||||
$(ZEROTERM) "$(patsubst %.png,%,$^)" > $@
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
$(BUILD_DIR)/%: %.png
|
|
||||||
$(N64GRAPHICS) -i $@ -g $< -f $(lastword $(subst ., ,$@))
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(BUILD_DIR)/%.inc.c: $(BUILD_DIR)/% %.png
|
|
||||||
hexdump -v -e '1/1 "0x%X,"' $< > $@
|
|
||||||
echo >> $@
|
|
||||||
|
|
||||||
ifeq ($(EXTERNAL_DATA),0)
|
|
||||||
|
|
||||||
# Color Index CI8
|
|
||||||
$(BUILD_DIR)/%.ci8: %.ci8.png
|
|
||||||
$(N64GRAPHICS_CI) -i $@ -g $< -f ci8
|
|
||||||
|
|
||||||
# Color Index CI4
|
|
||||||
$(BUILD_DIR)/%.ci4: %.ci4.png
|
|
||||||
$(N64GRAPHICS_CI) -i $@ -g $< -f ci4
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
################################################################
|
|
||||||
|
|
||||||
# compressed segment generation
|
# compressed segment generation
|
||||||
|
|
||||||
# PC Area
|
# PC Area
|
||||||
@ -875,19 +832,9 @@ $(SOUND_BIN_DIR)/%.m64: $(SOUND_BIN_DIR)/%.o
|
|||||||
$(SOUND_BIN_DIR)/%.o: $(SOUND_BIN_DIR)/%.s
|
$(SOUND_BIN_DIR)/%.o: $(SOUND_BIN_DIR)/%.s
|
||||||
$(AS) $(ASFLAGS) -o $@ $<
|
$(AS) $(ASFLAGS) -o $@ $<
|
||||||
|
|
||||||
ifeq ($(EXTERNAL_DATA),1)
|
|
||||||
|
|
||||||
$(SOUND_BIN_DIR)/%.inc.c: $(SOUND_BIN_DIR)/%
|
$(SOUND_BIN_DIR)/%.inc.c: $(SOUND_BIN_DIR)/%
|
||||||
$(ZEROTERM) "$(patsubst $(BUILD_DIR)/%,%,$^)" | hexdump -v -e '1/1 "0x%X,"' > $@
|
$(ZEROTERM) "$(patsubst $(BUILD_DIR)/%,%,$^)" | hexdump -v -e '1/1 "0x%X,"' > $@
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
$(SOUND_BIN_DIR)/%.inc.c: $(SOUND_BIN_DIR)/%
|
|
||||||
hexdump -v -e '1/1 "0x%X,"' $< > $@
|
|
||||||
echo >> $@
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl.inc.c $(SOUND_BIN_DIR)/sound_data.tbl.inc.c $(SOUND_BIN_DIR)/sequences.bin.inc.c $(SOUND_BIN_DIR)/bank_sets.inc.c
|
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl.inc.c $(SOUND_BIN_DIR)/sound_data.tbl.inc.c $(SOUND_BIN_DIR)/sequences.bin.inc.c $(SOUND_BIN_DIR)/bank_sets.inc.c
|
||||||
|
|
||||||
$(BUILD_DIR)/levels/scripts.o: $(BUILD_DIR)/include/level_headers.h
|
$(BUILD_DIR)/levels/scripts.o: $(BUILD_DIR)/include/level_headers.h
|
||||||
@ -985,4 +932,4 @@ MAKEFLAGS += --no-builtin-rules
|
|||||||
|
|
||||||
-include $(DEP_FILES)
|
-include $(DEP_FILES)
|
||||||
|
|
||||||
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
@ -14,8 +14,8 @@ def md5(fname):
|
|||||||
hash_md5.update(chunk)
|
hash_md5.update(chunk)
|
||||||
return hash_md5.hexdigest()
|
return hash_md5.hexdigest()
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
if len(sys.argv) < 4:
|
||||||
print('usage: mkzip <lstfile> <dstpath>')
|
print('usage: mkzip <lstfile> <dstpath> <legacy>')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
lst = []
|
lst = []
|
||||||
@ -26,13 +26,20 @@ with open(sys.argv[1], 'r') as f:
|
|||||||
continue
|
continue
|
||||||
tok = line.split()
|
tok = line.split()
|
||||||
lst.append((tok[0], tok[1]))
|
lst.append((tok[0], tok[1]))
|
||||||
|
if not sys.argv[3] or not sys.argv[3] == "1":
|
||||||
for (fname, aname) in lst:
|
for (fname, aname) in lst:
|
||||||
path = os.path.join(sys.argv[2], aname)
|
path = os.path.join(sys.argv[2], aname)
|
||||||
old_md5 = md5(fname);
|
old_md5 = md5(fname)
|
||||||
if not os.path.exists(path) or os.path.exists(path) and old_md5 != md5(path):
|
if not os.path.exists(path) or os.path.exists(path) and old_md5 != md5(path):
|
||||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||||
copyfile(fname, path)
|
copyfile(fname, path)
|
||||||
print("Copying: " + path)
|
print("Copying: " + path)
|
||||||
else:
|
else:
|
||||||
print("Skipping: " + path + " - MD5: "+md5(fname))
|
print("Skipping: " + path + " - MD5: "+md5(fname))
|
||||||
|
else:
|
||||||
|
zipPath = os.path.join(sys.argv[2], "awesome-legacy.zip")
|
||||||
|
print("Using Legacy System")
|
||||||
|
with zipfile.ZipFile(zipPath, 'w', allowZip64=False) as zipf:
|
||||||
|
for (fname, aname) in lst:
|
||||||
|
zipf.write(fname, arcname=aname)
|
||||||
|
print("Legacy - Copying: " + aname)
|
Loading…
Reference in New Issue
Block a user