Also fixed some minor issues:
* Fix turret texture mirroring
* Further shorten command string for sound table generation
* Allow re-queuing same subtitle after it disappears
* Allow pressing switch during countdown to restart timer
* Fix button UV mapping
* Fix button pose position (default to unpressed)
* Play "button release" sound on timeout
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
* 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.
Previously, grav_flare was used (likely due to a copy/paste error),
resulting in a warning during build and unnecessary texture data
being included in the fleck_ash2 generated model.
* When building with CMake, dynamic model lists are now generated
* Factored common code out of generate_*_list.js files to deduplicate
* Better separated generated model lists from main game code
`dynamic_asset_data.c` and `dynamic_animated_asset_data.c`
previously #included the corresponding generated headers, and
`dynamic_asset_loader.c` declared externs for the contents.
This messiness was likely done so the generated code would be built
automatically (the Makefile globs all C files under `src/`).
Now, model list data is output to C source files which are built
explicitly. This, with some refactoring, allows the previously
mentioned source files and externs to be removed.
This is a bit hacky in the Makefile but will be automatic under
CMake by using target properties.
* Reorganized some files under `tools/`