LANG -> AUDIO

This commit is contained in:
Thatcher Chamberlin 2023-02-19 14:36:52 -05:00
parent e9ddfd6c4a
commit 90cd88f1a8
4 changed files with 13 additions and 13 deletions

View file

@ -195,15 +195,15 @@ $(error Invalid target: T=$(T))
endif
export T
# Select sound language
LANGUAGE_SOUND_FOLDER = config/_default_cfg_src_/res/$(LANG)
ifeq ($(LANG),)
$(error Please specify the sound language in the command line: LANG=<languageAbbrev>)
# Select audio source
AUDIO_FOLDER = config/_default_cfg_src_/res/$(AUDIO)
ifeq ($(AUDIO),)
$(error Please specify the sound language in the command line: AUDIO=<audioName>)
endif
ifeq ($(wildcard $(LANGUAGE_SOUND_FOLDER)),)
$(error Invalid target: LANG=$(LANG))
ifeq ($(wildcard $(AUDIO_FOLDER)),)
$(error Invalid target: AUDIO=$(AUDIO))
endif
export LANG
export AUDIO
KBUILD_OUTPUT := $(KBUILD_OUTPUT)/$(T)

View file

@ -81,10 +81,10 @@ and recompile with `./build.sh`!
### Language support
The `LANG` environment variable can be set when running the `build.sh` script to load sound files
for languages other than the default English. For example, running `LANG=cn ./build.sh` will load sounds files from
The `AUDIO` environment variable can be set when running the `build.sh` script to load sound files
for languages other than the default English. For example, running `AUDIO=cn ./build.sh` will load sounds files from
`config/_default_cfg_src_/res/cn/` instead of the default `en/` folder.
The current languages supported with sound files are English (`en`) and Chinese (`cn`). Other languages
(or other sets of custom sounds) may be added by adding all the correct sound files into a
`config/_default_cfg_src_/res/<custom_language>/` directory and building with `LANG=<custom_language> ./build.sh`.
`config/_default_cfg_src_/res/<custom_sounds>/` directory and building with `AUDIO=<custom_sounds> ./build.sh`.

View file

@ -1,7 +1,7 @@
#!/bin/bash
# use LANG environment variable, default to "en"
LANG="${LANG:-en}"
# use AUDIO environment variable, default to "en"
AUDIO="${AUDIO:-en}"
make -j T=open_source DEBUG=1 >log.txt 2>&1

View file

@ -9,7 +9,7 @@ ifeq ($(VOICE_DATAPATH_TYPE),gsound)
obj_cpp += $(patsubst $(cur_dir)%,%,$(wildcard $(cur_dir)/app_voice/app_$(VOICE_DATAPATH_TYPE)/*.cpp))
endif
obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/$(LANG)/*.mp3))
obj_mp3 := $(patsubst $(cur_dir)%,%,$(wildcard ../../config/_default_cfg_src_/res/$(AUDIO)/*.mp3))
obj-y := $(obj_mp3:.mp3=.snd.o) $(obj_mp3:.mp3=.snd.cpp) $(obj_c:.c=.o) $(obj_s:.S=.o) $(obj_cpp:.cpp=.o)