mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
Remove previous failed attempts at fixing sound compile issues
This commit is contained in:
parent
e70ed3ed2b
commit
dc63c6588f
3 changed files with 0 additions and 128 deletions
19
Makefile
19
Makefile
|
@ -933,24 +933,6 @@ ifeq ($(WINDOWS_BUILD),1)
|
|||
endif
|
||||
endif
|
||||
|
||||
# precomp custom sounds
|
||||
# hacky stupid thing for windows builds (non-auto-builder)
|
||||
# this way it won't fail to compile custom sounds anymore
|
||||
ifeq ($(WINDOWS_BUILD),999)
|
||||
ifeq ($(WINDOWS_AUTO_BUILDER),1)
|
||||
else
|
||||
ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||
$(info Copying precomp samples...)
|
||||
Command := mkdir -p "$(BUILD_DIR)/sound"
|
||||
Resp := $(shell $(call Command))
|
||||
Command := mkdir -p "$(BUILD_DIR)/sound/samples"
|
||||
Resp := $(shell $(call Command))
|
||||
Command := unzip -o "sound/precomp/samples.zip" -d "$(BUILD_DIR)/sound/"
|
||||
Resp := $(shell $(call Command))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(ASAN),1)
|
||||
|
||||
ifeq ($(COMPILER),gcc)
|
||||
|
@ -1163,7 +1145,6 @@ N64CKSUM := $(TOOLS_DIR)/n64cksum
|
|||
N64GRAPHICS := $(TOOLS_DIR)/n64graphics
|
||||
N64GRAPHICS_CI := $(TOOLS_DIR)/n64graphics_ci
|
||||
TEXTCONV := $(TOOLS_DIR)/textconv
|
||||
AIFF_EXTRACT_FAILSAFE := $(TOOLS_DIR)/aiff_extract_codebook_failsafe.py
|
||||
AIFF_EXTRACT_CODEBOOK := $(TOOLS_DIR)/aiff_extract_codebook
|
||||
VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
|
||||
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
|
||||
|
|
Binary file not shown.
|
@ -1,109 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
# example before: tools/aiff_extract_codebook sound/samples/sfx_custom_luigi/00.aiff >build/us_pc/sound/samples/sfx_custom_luigi/00.table
|
||||
|
||||
|
||||
s_size = 0
|
||||
|
||||
# check arguments
|
||||
if len(sys.argv) != 4:
|
||||
print(sys.argv[0] + ': was passed the incorrect number of arguments: ' + str(sys.argv), file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
# get arguments
|
||||
a_cmd = sys.argv[1]
|
||||
a_input = sys.argv[2]
|
||||
a_output = sys.argv[3]
|
||||
|
||||
# validate input
|
||||
if not os.path.isfile(a_input):
|
||||
print(sys.argv[0] + ': original input file does not exist "' + a_input + '"', file=sys.stderr)
|
||||
else:
|
||||
# run original command
|
||||
s_cmd = [ a_cmd, a_input ]
|
||||
with open(a_output, 'w') as outfile:
|
||||
subprocess.call(s_cmd, stdout=outfile, shell=False)
|
||||
outfile.flush()
|
||||
os.fsync(outfile.fileno())
|
||||
|
||||
# try to read the file length repeatedly
|
||||
s_itr = 0
|
||||
while s_size <= 0 and s_itr < 8:
|
||||
# sleep between iterations
|
||||
if s_itr > 0:
|
||||
time.sleep(0.1 + 0.05 * s_itr)
|
||||
s_itr += 1
|
||||
|
||||
# check for existence
|
||||
if not os.path.isfile(a_output):
|
||||
continue
|
||||
|
||||
# read file size
|
||||
with open(a_output, 'r') as outfile:
|
||||
s_text = outfile.read()
|
||||
s_size = len(s_text)
|
||||
|
||||
# check final existence
|
||||
if not os.path.isfile(a_output):
|
||||
print(sys.argv[0] + ': original output file does not exist "' + a_output + '"', file=sys.stderr)
|
||||
|
||||
# check size
|
||||
if s_size > 6:
|
||||
exit(0)
|
||||
print(sys.argv[0] + ': original output file has a size of zero "' + a_output + '"', file=sys.stderr)
|
||||
|
||||
# only override custom
|
||||
if 'custom' not in a_input:
|
||||
print(sys.argv[0] + ': original input file is not custom "' + a_input + '"', file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
|
||||
# figure out which mario sound path to try to grab
|
||||
m_path = 'sound/samples/sfx_mario/'
|
||||
if '_peach' in a_input:
|
||||
m_path = 'sound/samples/sfx_mario_peach/'
|
||||
|
||||
# make sure mario path exists
|
||||
if not os.path.isdir(m_path):
|
||||
print(sys.argv[0] + ': could not find override mario path "' + m_path + '" for "' + a_input + '"', file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
# generate table of mario sounds
|
||||
m_table = {}
|
||||
m_any_sound = None
|
||||
for m_file in os.listdir(m_path):
|
||||
m_filename = m_path + os.path.basename(m_file)
|
||||
m_hex = m_file.split('_')[0].upper()
|
||||
m_table[m_hex] = m_filename
|
||||
m_any_sound = m_filename
|
||||
|
||||
# figure out input hex
|
||||
n_hex = os.path.basename(a_input).split('.')[0].split('_')[0].upper()
|
||||
if n_hex not in m_table:
|
||||
print(sys.argv[0] + ': could not find hex in mario table "' + m_path + '" for "' + a_input + '"', file=sys.stderr)
|
||||
n_input = m_any_sound
|
||||
else:
|
||||
# override input file
|
||||
n_input = m_table[n_hex]
|
||||
|
||||
# run override command
|
||||
s_cmd = [ a_cmd, n_input ]
|
||||
with open(a_output, 'w') as outfile:
|
||||
subprocess.call(s_cmd, stdout=outfile, shell=False)
|
||||
|
||||
# get size
|
||||
if not os.path.isfile(a_output):
|
||||
print(sys.argv[0] + ': override output file does not exist "' + a_output + '"', file=sys.stderr)
|
||||
else:
|
||||
with open(a_output, 'r') as outfile:
|
||||
s_text = outfile.read().strip()
|
||||
s_size = len(s_text)
|
||||
|
||||
# check size
|
||||
if s_size <= 0:
|
||||
print(sys.argv[0] + ': override output file has a size of zero "' + a_output + '"', file=sys.stderr)
|
||||
exit(1)
|
Loading…
Reference in a new issue