Mat Stack Fix

* Implemented new lightweight CPU/RDP profiler
* Added RSP profiling to the lightweight profiler
* Added CPU audio to lightweight profiler
* Changed lingering manual light struct definitions to gdSPDefLights1, made a dummy light for Koopa's pink shorts
* Ran script to convert all light commands to lightcolor commands
* Added define guards for the profiler
* Wrote function for setting up global light direction in the frame
* Moved camera matrix into projection stack
* Corrected cameraToObject for the new matrix stack (fixes culling and sound)
* Fixed billboarding with new matrix stack
* Fixed shadows with new matrix stack
* Fixed some areas where the game was previously extracting the camera matrix from various matrices
* Restored vanilla light and env map directions under new matrix stack
* Fix goddard crash
* Fix geo_process_level_of_detail
* Remove 'construct_float' from 'geo_process_level_of_detail'
* Removed some accidentally added files
* Removed unnecessary matrix multiplications in geo_process_object
* Added fixlights script to build system for fixing custom assets and added option to disable it if needed
* Fixed visual debug with new matstack and cleaned up visual debug code
* Fixed handling of WORLD_SCALE in view matrix so it doesn't get cancelled out
* Fixed clip planes not scaling based on WORLD_SCALE

Co-authored-by: Mr-Wiseguy <mrwiseguyromhacking@gmail.com>
Co-authored-by: Arceveti <arceveti@gmail.com>
Co-authored-by: thecozies <collinpferguson@gmail.com>
This commit is contained in:
Reonu
2022-07-19 14:04:54 +01:00
committed by GitHub
parent 1820b146c0
commit 5a9b5a9751
441 changed files with 3271 additions and 7508 deletions

View File

@@ -85,6 +85,9 @@ else ifeq ($(VERSION),sh)
DEFINES += VERSION_SH=1
endif
# FIXLIGHTS - converts light objects to light color commands for assets, needed for vanilla-style lighting
FIXLIGHTS ?= 1
DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE
TARGET := sm64
@@ -222,7 +225,7 @@ TARGET_STRING := sm64
# UNF - whether to use UNFLoader flashcart library
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
UNF ?= 0
$(eval $(call validate-option,UNF,0 1))
ifeq ($(UNF),1)
@@ -234,7 +237,7 @@ endif
# ISVPRINT - whether to fake IS-Viewer presence,
# allowing for usage of CEN64 (and possibly Project64) to print messages to terminal.
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
ISVPRINT ?= 0
$(eval $(call validate-option,ISVPRINT,0 1))
ifeq ($(ISVPRINT),1)
@@ -252,7 +255,7 @@ endif
# HVQM - whether to use HVQM fmv library
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
HVQM ?= 0
$(eval $(call validate-option,HVQM,0 1))
ifeq ($(HVQM),1)
@@ -287,7 +290,7 @@ $(eval $(call validate-option,GZIPVER,std libdef))
# GODDARD - whether to use libgoddard (Mario Head)
# 1 - includes code in ROM
# 0 - does not
# 0 - does not
GODDARD ?= 0
$(eval $(call validate-option,GODDARD,0 1))
ifeq ($(GODDARD),1)
@@ -423,8 +426,6 @@ DEP_FILES := $(O_FILES:.o=.d) $(LIBZ_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(B
# detect prefix for MIPS toolchain
ifneq ($(call find-command,mips64-elf-ld),)
CROSS := mips64-elf-
else ifneq ($(call find-command,mips-n64-ld),)
CROSS := mips-n64-
else ifneq ($(call find-command,mips64-ld),)
CROSS := mips64-
else ifneq ($(call find-command,mips-linux-gnu-ld),)
@@ -513,6 +514,7 @@ AIFF_EXTRACT_CODEBOOK := $(TOOLS_DIR)/aiff_extract_codebook
VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
SKYCONV := $(TOOLS_DIR)/skyconv
FIXLIGHTS_PY := $(TOOLS_DIR)/fixlights.py
ifeq ($(GZIPVER),std)
GZIP := gzip
else
@@ -814,6 +816,14 @@ $(BUILD_DIR)/src/game/version_data.h: tools/make_version.sh
#==============================================================================#
# Compile C code
ifeq ($(FIXLIGHTS),1)
# This must not be run multiple times at once, so we run it ahead of time rather than in a rule
DUMMY != $(FIXLIGHTS_PY) actors
# Modify the leveldata build rule to fix lights for any files in that level's folder
$(BUILD_DIR)/levels/%/leveldata.o: levels/%/leveldata.c
$(V)$(FIXLIGHTS_PY) $(dir $<)
$(V)$(CC) -c $(CFLAGS) -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
endif
$(BUILD_DIR)/%.o: %.c
$(call print,Compiling:,$<,$@)
$(V)$(CC) -c $(CFLAGS) -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<