Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,6 @@ RNCPACK := $(TOOLS_DIR)/rncpack
FILESIZER := $(TOOLS_DIR)/filesizer
N64CKSUM := $(TOOLS_DIR)/n64cksum
N64GRAPHICS := $(TOOLS_DIR)/n64graphics
N64GRAPHICS_CI := $(TOOLS_DIR)/n64graphics_ci
BINPNG := $(TOOLS_DIR)/BinPNG.py
TEXTCONV := $(TOOLS_DIR)/textconv
AIFF_EXTRACT_CODEBOOK := $(TOOLS_DIR)/aiff_extract_codebook
VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
Expand Down Expand Up @@ -695,28 +693,27 @@ $(BUILD_DIR)/src/game/puppycam2.o: $(BUILD_DIR)/include/text_strings.h
#==============================================================================#
TEXTURE_ENCODING := u8

# Convert PNGs to RGBA32, RGBA16, IA16, IA8, IA4, IA1, I8, I4 binary files
$(BUILD_DIR)/%: %.png
$(call print,Converting:,$<,$@)
$(V)$(N64GRAPHICS) -s raw -i $@ -g $< -f $(lastword $(subst ., ,$@))
define convert_texture
$$(BUILD_DIR)/%$(1).inc.c: %$(1).png
$$(call print,Converting:,$$<,$$@)
$$(V)$$(N64GRAPHICS) -s $$(TEXTURE_ENCODING) -i $$@ -g $$< $(2)
$$(BUILD_DIR)/%$(1).preswap.inc.c: %$(1).preswap.png
$$(call print,Converting:,$$<,$$@)
$$(V)$$(N64GRAPHICS) -s $$(TEXTURE_ENCODING) -i $$@ -g $$< $(2) -S
endef

$(BUILD_DIR)/%.preswap.inc.c: %.preswap.png
$(call print,Converting:,$<,$@)
$(V)$(N64GRAPHICS) -s $(TEXTURE_ENCODING) -i $@ -g $< -f $(lastword ,$(subst ., ,$*)) -S
$(eval $(call convert_texture,,-f $$(lastword ,$$(subst ., ,$$*))))
$(eval $(call convert_texture,.ci4_rgba16,-p $$(patsubst %.inc.c,%.pal,$$@) -f ci4 -c rgba16))
$(eval $(call convert_texture,.ci8_rgba16,-p $$(patsubst %.inc.c,%.pal,$$@) -f ci8 -c rgba16))
$(eval $(call convert_texture,.ci4_ia16,-p $$(patsubst %.inc.c,%.pal,$$@) -f ci4 -c ia16))
$(eval $(call convert_texture,.ci8_ia16,-p $$(patsubst %.inc.c,%.pal,$$@) -f ci8 -c ia16))
Comment thread
LucretiaArc marked this conversation as resolved.
$(eval $(call convert_texture,.ci4,-p $$(patsubst %.ci4.inc.c,%.rgba16.pal,$$@) -f ci4 -c rgba16))
$(eval $(call convert_texture,.ci8,-p $$(patsubst %.ci8.inc.c,%.rgba16.pal,$$@) -f ci8 -c rgba16))
Comment thread
LucretiaArc marked this conversation as resolved.

$(BUILD_DIR)/%.inc.c: %.png
# Convert image files to binary - used primarily for IPL3 "IA1" textures
$(BUILD_DIR)/%: %.png
$(call print,Converting:,$<,$@)
$(V)$(N64GRAPHICS) -s $(TEXTURE_ENCODING) -i $@ -g $< -f $(lastword ,$(subst ., ,$*))

# Color Index CI8
$(BUILD_DIR)/%.ci8.inc.c: %.ci8.png
$(call print,Converting CI:,$<,$@)
$(V)$(BINPNG) $< $@ 8

# Color Index CI4
$(BUILD_DIR)/%.ci4.inc.c: %.ci4.png
$(call print,Converting CI:,$<,$@)
$(V)$(BINPNG) $< $@ 4
$(V)$(N64GRAPHICS) -s raw -i $@ -g $< -f $(lastword $(subst ., ,$@))


#==============================================================================#
Expand Down
1 change: 0 additions & 1 deletion tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/mio0
/n64cksum
/n64graphics
/n64graphics_ci
/patch_elf_32bit
/rncpack
/slienc
Expand Down
41 changes: 0 additions & 41 deletions tools/BinPNG.py

This file was deleted.

4 changes: 1 addition & 3 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CC := gcc
CXX := g++
CFLAGS := -I. -O2 -s
LDFLAGS := -lm
ALL_PROGRAMS := armips filesizer lz4tpack deflatepack rncpack n64graphics n64graphics_ci mio0 slienc n64cksum textconv aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv
ALL_PROGRAMS := armips filesizer lz4tpack deflatepack rncpack n64graphics mio0 slienc n64cksum textconv aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv
LIBAUDIOFILE := audiofile/libaudiofile.a

ifneq ($(shell uname), Darwin)
Expand Down Expand Up @@ -44,8 +44,6 @@ rncpack_SOURCES := rncpack.c
n64graphics_SOURCES := n64graphics.c utils.c
n64graphics_CFLAGS := -DN64GRAPHICS_STANDALONE

n64graphics_ci_SOURCES := n64graphics_ci_dir/n64graphics_ci.c n64graphics_ci_dir/exoquant/exoquant.c n64graphics_ci_dir/utils.c

mio0_SOURCES := libmio0.c
mio0_CFLAGS := -DMIO0_STANDALONE

Expand Down
5 changes: 1 addition & 4 deletions tools/n64graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ static void print_usage(void)
" -w WIDTH export texture width (default: %d)\n"
" -h HEIGHT export texture height (default: %d)\n"
" -r ROTATE rotate envmap texture for rgba extraction only (default: false)\n"
" -S swap words on odd lines (importing only, does not support ci4, ci8, or ia1 formats)\n"
" -S swap words on odd lines (importing only, does not support ia1 format)\n"
"CI arguments:\n"
" -c CI_FORMAT CI palette format: rgba16, ia16 (default: %s)\n"
" -p PAL_FILE palette binary file to import/export from/to\n"
Expand Down Expand Up @@ -1020,9 +1020,6 @@ int main(int argc, char *argv[])
if (config.format.depth == 1) {
ERROR("Word swapping unavailable for IA1 texture format\n");
return EXIT_FAILURE;
} else if (config.format.format == IMG_FORMAT_CI) {
ERROR("Word swapping unavailable for CI texture formats\n");
return EXIT_FAILURE;
}

int swap_bytes = (config.format.depth == 32) ? 8 : 4;
Expand Down
21 changes: 0 additions & 21 deletions tools/n64graphics_ci_dir/LICENSE

This file was deleted.

29 changes: 0 additions & 29 deletions tools/n64graphics_ci_dir/README.md

This file was deleted.

Loading