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
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.
* 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).
* 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)
* 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/`
Incidental changes along the way:
* Move `export_level.lua` to `tools/level_scripts/`
* Small reorganizations/fixes to existing `CMakeLists.txt` files
* Support passing absolute paths to level export
Some parts need to be cleaned up/removed/streamlined after the CMake
build can build the game on its own and compatibility with what the
old makefile does is no longer needed.
Useful for room shapes which cannot be handled by standard visibility
checks.
Normally this can be addressed with additional rooms and doorways, but
sometimes a room is required to be a complex shape (for example, to
accomodate animated static geometry).
These instances should be few and far between, so leaving this as an
opt-in feature that can be used during level authoring.
* Doorway normals now always point toward room A. This was intended
and code was written for it, but typos prevented it from working.
* Consistent doorway directions allowed resurrection of previous
collisionSceneRaycastDoorways() implementation
Standard culling is quite coarse, for performance reasons:
* Only uses axis-aligned bounding boxes
* One visible object in a BVH node will make all others in the same node visible
These properties allow the bounding boxes of rotated objects to clip through
the back of portals to be considered visible, causing improper rendering.
This commit introduces a new optional argument for `@static` level
objects: `precise_culling`. Static geometry marked for precise culling
will be culled based on its exact (i.e., rotated) bounding box, in the
same way dynamic/animated geometry is.
Precise culling is more expensive than standard culling so it is opt-in.
It is intended only for the few situations that can hit the edge cases
described above.
Eliminates the two stationary dynamic collision objects that were
previously used.
This change refactors entities.lua and collision_export.lua to support
autogenerated static collision for any object which may need it in the
future.