Builds failed if VPKs were not previously extracted since VPK contents
are not explicitly listed as custom command outputs. Specifying every
extracted file would mean duplicating content from the asset
CMakeLists.txt files and is also quite noisy (there are many files) for
little gain.
Instead, relax the dependencies around files sourced from VPKs. Now the
build just depends on the VPKs having been extracted and not the files
within. After all, these files should never change.
If Portal is updated with new VPKs, they will trigger re-extraction and
dependent targets will be rebuilt. Targets will NOT be rebuilt if users
modify original Portal game files in portal_pak_dir.
The skeletool command for model generation placed model flags before
default flags.
Normally this isn't a problem, but v_portalgun.flags overrides the
default scene scale by specifying the same argument again with a
different value. Since its arguments were not last in the command,
the scale was not overridden and its animations were incorrect.
Fixed by refactoring the convert_asset script into a more general
run_command script, which supports the required functionality of reading
arguments from a file while also allowing the caller to choose their
position relative to other arguments.
* Create output directories before running skeletool
- Was missing for levels and materials
* Update toolchain-specified assembler include directory
- Change from project root to build output directory
- Looks like this workaround isn't needed for the Ninja generator.
Keep it to support the Makefile generator.
* Use .sox files for ambience_base and tank_turret_loop1 instead of
hard-coded conversion
* Rename .msox to .sox
- Format is same and extension is no longer needed to differentiate
* Output transformed sounds to portal_pak_modified instead of build dir
- Consistent with other conversions, and easy to preview when adding
new sounds
- Avoids hard-coding build output directory in .ins files
* Use "strings" instead of "subtitles" for translation-related files and types
* Remove CMAKE preprocessor define
* Remove makefile hack in generate_sound_ids
* AUDIO_LANGUAGES and TEXT_LANGUAGES are now validated against
supported languages
* Alternately, "all" can be specified to include all languages
(default for TEXT_LANGUAGES)
* Also fixed linker script not regenerating on language change
CMake builds now have parity with the Makefile (and more!)
* Comma-separated languages can be specified using the TEXT_LANGUAGES
CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language
As part of this, I cleaned up the string generation script, and fixed
some incorrect Bulgarian HINT_ strings.
TODO:
* Allow specifying "all" for text/audio language
* Invalid character validation
* Comma-separated languages can be specified using the AUDIO_LANGUAGES
CMake cache variable (defaults to just English)
* Multi-language builds can include any combination of supported languages
* Single-language builds can use any supported language
As part of this, I refactored the sound lookup tables to not store
information about non-localized sounds (which previously occupied most
of the table).
* Linker script file and preprocessing logic moved to subdirectory
* Linker script related flag passing moved to function in toolchain file
* ROM generation logic moved to toolchain file
Implemented strcpy and strlen, which were all that were needed
(math functions and sprintf are in libultra).
To move further away from libultra, some standard library
implementation - such as newlib - will either need to be added
back later, or if the usage is small, functions can be reimplemented.
For now, removing it makes building easier.
* Use preprocessor directives to pass microcode object file paths
* Add build directory to include path when preprocessing, so directory
name is not needed when including generated linker script fragments
* Pass required files on the command line so wildcard matching can be used
* Also remove special case for creating object file for boot code (use
incbin in asm file instead)
Renamed all instances of skelatool -> skeletool. This is more consistent
than the mixed usage previously, which consequently makes adding the
external project in CMake easier.
* Embed Lua scripts in a cross-platform way (generated C source files)
* Automatically find `luac`
* Automatically build skeletool when building main project
* Assemble through `gcc` instead of `as` directly, so source files are
preprocessed (i.e., `#include`)
* `gcc` does not pass `-I` include directories to `as`. This can
supposedly be fixed by recompiling `gcc` with `--with-gnu-as`. Popular
N64 toolchain binary distributions don't do this, and to lower the
barrier to entry I don't want to force users to have to compile their
own. Work around it by passing `-Wa,-I`.
* CMake only finds assembly dependencies when preprocessing, not when
assembling. Use `#include` instead of `.include` to work around this.
The `.incbin`s used by `sound_data.s` are covered by the
sound_data_tables target dependency.
* Refactor entry point
* Remove unused code
* Reformat level header to be more clear, and add more comments
Looks like assembling with CMake will require some changes to the
assembler flags, and possibly some manual dependency specification.