1704 Commits

Author SHA1 Message Date
Matt Penny
7819056f1c Chamber 16 vertex lighting and ambient sound 2024-12-07 23:43:53 -05:00
Matt Penny
a239d9b986 Fix version header regeneration with Ninja 2024-12-06 00:40:48 -05:00
Matt Penny
96602ecc71 Fix VPK extraction when using Ninja
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.
2024-12-06 00:29:11 -05:00
Matt Penny
a4f047f1d8 Chamber 16 collision and culling 2024-12-03 23:29:41 -05:00
Matt Penny
7e53d1206b Fix portal gun animation glitches
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.
2024-11-29 00:40:20 -05:00
Matt Penny
c3a96fb854 Fill empty space in signage_overlay_midair1
Duplicate signage_overlay_turret so signage_overlay_midair2 does not
have empty white space below it. Otherwise, the border looks too white
in game.
2024-11-25 21:10:59 -05:00
Matt Penny
cb4b8b29c8 Finish modelling chamber 16
No Rattmann den or scrawlings for now.
No collision or culling.
2024-11-25 21:01:33 -05:00
Matt Penny
455f25b5d9 Fix build with Makefile CMake generator
* 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.
2024-11-23 02:02:13 -05:00
Matt Penny
a0a542965a Model beginning of chamber 16 2024-11-23 00:01:59 -05:00
Matt Penny
4ebba1f678 Fix chamber 14 stair pit grating display in Blender 2024-11-22 23:02:52 -05:00
Matt Penny
46762c3600 Match chamber 6 wall light cutouts to original game 2024-11-22 00:11:34 -05:00
Matt Penny
50ec6bcdcb Chamber 15 signage warnings 2024-11-21 22:42:21 -05:00
Matt Penny
60c1588fff Fix window glass position in final room of chamber 15 2024-11-21 20:42:10 -05:00
Matt Penny
10d3478dca Don't expose sound segment externs in soundplayer header 2024-11-21 17:56:15 -05:00
Matt Penny
0fd1954898 Do not hard code build output directory name
The game can now be built in any directory
2024-11-20 23:38:24 -05:00
Matt Penny
bbb6f7b095 Add missing font characters for Polish and Romanian translations
* Also explicitly ignore non-breaking space
* Fail string generation if any font characters are missing
2024-11-20 21:43:01 -05:00
Matt Penny
5d482bbcd8 Sound conversion cleanup
* 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
2024-11-18 23:00:20 -05:00
Matt Penny
e884e283fa CMake cleanup
* Use "strings" instead of "subtitles" for translation-related files and types
* Remove CMAKE preprocessor define
* Remove makefile hack in generate_sound_ids
2024-11-18 21:56:20 -05:00
Matt Penny
fb31e1b2d0 Remove PORTAL64_WITH_DEBUGGER line from debugger.md 2024-11-16 20:01:52 -05:00
Matt Penny
c35e2e64fc Remove Makefile and update build docs 2024-11-16 19:52:30 -05:00
Matt Penny
771c06d934 CMake: finish options for configuring languages
* 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!)
2024-11-14 23:52:36 -05:00
Matt Penny
8853940a2a CMake: support configurable text languages
* 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
2024-11-14 23:50:20 -05:00
Matt Penny
efb83d1923 Use more standard luac file extension when building Skeletool lua files 2024-11-14 23:50:20 -05:00
Matt Penny
1c6efda386 Generate font layout information during build
Removed generated font code from repo to avoid duplication and make
updating fonts cleaner. The files in `assets/fonts/` are the source
of truth.
2024-11-14 23:50:20 -05:00
Matt Penny
00559b6ca3 CMake: support multiple audio languages
* 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).
2024-11-14 23:50:19 -05:00
Matt Penny
33981fae6a Add CMake variables to enable debugger, display list validator, and RSP profiler 2024-11-14 23:50:19 -05:00
hackgrid
5949334ff0
enable single-language builds besides english (#89) 2024-11-09 03:06:33 -05:00
Matt Penny
1a85c65408 Remove unused editorconfig file 2024-11-07 01:02:53 -05:00
Matt Penny
051f8ada46 Fix inability to override CMake toolchain variables 2024-11-07 00:47:04 -05:00
Matt Penny
d07521f70a CMake: clean up linking
* 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
2024-11-07 00:32:09 -05:00
Matt Penny
13691d919a Move tools into subdirectories 2024-11-06 23:25:02 -05:00
Matt Penny
31ce4e17a0 Game builds with CMake 2024-11-06 01:38:18 -05:00
Matt Penny
13db5ddc5e CMake: generate linker script fragments for segments
* Animations
* Levels
* Dynamic models
* Strings

Started to hook this up to the linker. There are still some errors to fix.
2024-11-05 02:07:16 -05:00
Matt Penny
1df470e87b Add missing include, reenable asserts 2024-11-02 21:14:58 -04:00
Matt Penny
bbc5a686a6 CMake: reorganize code segment into separate library
Required for linker script.

Refactored some asset targets to make this possible.
2024-11-02 21:03:39 -04:00
Matt Penny
6b4222e743 Automatic discovery of libgcc, remove newlib dependency (for now)
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.
2024-11-02 20:44:58 -04:00
Matt Penny
1bb1a71aae Remove build directory name from includes in main linker script 2024-11-02 02:30:11 -04:00
Matt Penny
a29bb36041 Do not rely on hardcoded directories when linking
* 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)
2024-11-02 02:07:08 -04:00
Haydn Trigg
dd1f1d5b07
Fix spelling of collisionObjectShouldGenerateContacts (#92) 2024-10-30 21:19:54 -04:00
Haydn Trigg
d16bf1ac01
Fix floating point syntax (#91)
* plane.c fix floating point syntax

* Update quaternion.c

* Update matrix.c

* Update collision_scene.c
2024-10-30 21:14:48 -04:00
Matt Penny
11a81e100f Refactor linker script segment generation
* Code for this now lives in one place instead of 3. This will make it
  easier to generate with CMake.
* Simplify subtitle alignment
2024-10-25 02:08:09 -04:00
Matt Penny
4c1484d5e6 Use PROJECT_BINARY_DIR instead of CMAKE_BINARY_DIR 2024-10-22 00:13:54 -04:00
Matt Penny
1a10e45682 Clean up skeletool CMake integration, and use consistent naming
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.
2024-10-21 23:29:43 -04:00
Matt Penny
b04e404b0b CMake: finish skeletool integration
* Embed Lua scripts in a cross-platform way (generated C source files)
* Automatically find `luac`
* Automatically build skeletool when building main project
2024-10-21 22:50:17 -04:00
Matt Penny
80a896d508 Namespaced name for imported libultra target 2024-10-19 21:33:42 -04:00
Matt Penny
e61142b902 Build skeletool with CMake 2024-10-19 21:18:15 -04:00
Matt Penny
3b9fba522b Get Skeletool dependencies from system
Do not install while building
2024-10-19 21:18:14 -04:00
Matt Penny
42a9189c95 CMake: get assembly working
* 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.
2024-10-19 16:30:58 -04:00
Matt Penny
4e9e9d32d6 ASM: simplify, document, start integrating with CMake
* 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.
2024-10-19 02:38:52 -04:00
Matt Penny
1cb12690b8 Fix UV mapping on elevator bottom edge 2024-10-17 21:20:01 -04:00