Do not hard code build output directory name

The game can now be built in any directory
This commit is contained in:
Matt Penny 2024-11-20 23:38:24 -05:00
parent bbb6f7b095
commit 0fd1954898
71 changed files with 363 additions and 393 deletions

View File

@ -37,14 +37,16 @@ set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(VPK_DIR "${PROJECT_SOURCE_DIR}/vpk")
# Extracted/generated file output directories
set(LINKER_SCRIPT_DIR "${PROJECT_BINARY_DIR}/ld")
set(PAK_DIR "${PROJECT_SOURCE_DIR}/portal_pak_dir")
set(PAK_MODIFIED_DIR "${PROJECT_SOURCE_DIR}/portal_pak_modified")
set(GENERATED_CODE_DIR "${PROJECT_BINARY_DIR}/codegen")
set(LINKER_SCRIPT_DIR "${PROJECT_BINARY_DIR}/ld")
set(PAK_DIR "${PROJECT_SOURCE_DIR}/portal_pak_dir")
set(PAK_MODIFIED_DIR "${PROJECT_SOURCE_DIR}/portal_pak_modified")
add_library(platform INTERFACE)
find_package(Libultra REQUIRED)
target_link_libraries(platform INTERFACE libultra::libultra)
target_include_directories(platform INTERFACE
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/src"
)

View File

@ -3,11 +3,11 @@
.section .data
.glabel _soundsSegmentRomStart
.incbin "build/assets/sound/sounds.sounds"
.incbin "assets/sound/sounds.sounds"
.balign 16
.glabel _soundsSegmentRomEnd
.glabel _soundsTblSegmentRomStart
.incbin "build/assets/sound/sounds.sounds.tbl"
.incbin "assets/sound/sounds.sounds.tbl"
.balign 16
.glabel _soundsTblSegmentRomEnd

View File

@ -30,7 +30,7 @@ function(_add_convert_font_command FONT_NAME INPUT_FILES OUTPUT_LIST)
GET FONT_DIR_NAME PARENT_PATH
FONT_DIR_NAME
)
set(OUTPUT_FILE "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}/${FONT_DIR_NAME}.c")
set(OUTPUT_FILE "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}/${FONT_DIR_NAME}.c")
add_custom_command(
DEPENDS

View File

@ -407,8 +407,8 @@ function(_add_material_generate_command INPUT_FILE OUTPUT_LIST)
)
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}")
set(OUTPUT_FILE_H "${PROJECT_BINARY_DIR}/${RELATIVE_DIR}/${MATERIAL_NAME}.h")
set(OUTPUT_FILE_C "${PROJECT_BINARY_DIR}/${RELATIVE_DIR}/${MATERIAL_NAME}_mat.c")
set(OUTPUT_FILE_H "${GENERATED_CODE_DIR}/${RELATIVE_DIR}/${MATERIAL_NAME}.h")
set(OUTPUT_FILE_C "${GENERATED_CODE_DIR}/${RELATIVE_DIR}/${MATERIAL_NAME}_mat.c")
# Depend on all textures for simplicity
set(DEPENDENCY_FILES ${INPUT_FILE} ${TEXTURES_TRANSFORMED})

View File

@ -87,8 +87,8 @@ set(MODELS
${STATIC_MODELS}
)
# Most models depend on both of these. Some only depend on one or the other,
# but use both for simplicity. Otherwise there would be many special cases.
# Most models depend on both of these. Some only depend on one or the other.
# Use both here for simplicity. Otherwise there would be many special cases.
set(MODEL_DEFAULT_MATERIALS
${ASSETS_DIR}/materials/static.skm.yaml
${ASSETS_DIR}/materials/objects.skm.yaml
@ -131,10 +131,7 @@ function(_add_model_generate_command MODEL_NAME MODEL_FBX MODEL_OUTPUT_LIST ANIM
list(APPEND MODEL_MATERIALS ${FILE_MATERIALS})
endif()
cmake_path(
REMOVE_EXTENSION MODEL_FBX
OUTPUT_VARIABLE OUTPUT_FILE_NO_EXTENSION
)
set(OUTPUT_FILE_NO_EXTENSION "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}/${MODEL_NAME}")
cmake_path(
GET OUTPUT_FILE_NO_EXTENSION PARENT_PATH
OUTPUT_DIR
@ -274,7 +271,7 @@ set(DYNAMIC_ANIMATED_MODEL_HEADERS "")
foreach(GENERATED_HEADER ${DYNAMIC_MODEL_GENERATED_HEADERS})
cmake_path(
RELATIVE_PATH GENERATED_HEADER
BASE_DIRECTORY "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}"
BASE_DIRECTORY "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}"
OUTPUT_VARIABLE MODEL_NAME
)
cmake_path(
@ -289,7 +286,7 @@ foreach(GENERATED_HEADER ${DYNAMIC_MODEL_GENERATED_HEADERS})
endif()
endforeach()
set(DYNAMIC_MODEL_LIST_OUT_DIR "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}")
set(DYNAMIC_MODEL_LIST_OUT_DIR "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}")
set(DYNAMIC_MODEL_LIST_H "${DYNAMIC_MODEL_LIST_OUT_DIR}/dynamic_model_list.h")
set(DYNAMIC_MODEL_LIST_C "${DYNAMIC_MODEL_LIST_OUT_DIR}/dynamic_model_list.c")

View File

@ -447,7 +447,7 @@ add_custom_command(
VERBATIM
)
set(BUILD_AUDIO_DIR "${PROJECT_BINARY_DIR}/src/audio")
set(BUILD_AUDIO_DIR "${GENERATED_CODE_DIR}/src/audio")
set(CLIPS_H "${BUILD_AUDIO_DIR}/clips.h")
set(LANGUAGES_H "${BUILD_AUDIO_DIR}/languages.h")
set(LANGUAGES_C "${BUILD_AUDIO_DIR}/languages.c")

View File

@ -86,11 +86,7 @@ endfunction()
function(_add_level_generate_command LEVEL_NAME LEVEL_FBX LEVEL_OUTPUT_LIST ANIM_OUTPUT_LIST)
set(LEVEL_YAML "${CMAKE_CURRENT_SOURCE_DIR}/${LEVEL_NAME}/${LEVEL_NAME}.yaml")
cmake_path(
REMOVE_EXTENSION LEVEL_FBX
OUTPUT_VARIABLE OUTPUT_FILE_NO_EXTENSION
)
set(OUTPUT_FILE_NO_EXTENSION "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}/${LEVEL_NAME}/${LEVEL_NAME}")
set(OUTPUT_FILE_H "${OUTPUT_FILE_NO_EXTENSION}.h")
set(OUTPUT_FILE_GEO_C "${OUTPUT_FILE_NO_EXTENSION}_geo.c")
@ -190,7 +186,7 @@ list(FILTER
INCLUDE REGEX "\.h$"
)
set(LEVEL_LIST_OUT_DIR "${PROJECT_BINARY_DIR}/${RELATIVE_CURRENT_DIR}")
set(LEVEL_LIST_OUT_DIR "${GENERATED_CODE_DIR}/${RELATIVE_CURRENT_DIR}")
set(LEVEL_LIST "${LEVEL_LIST_OUT_DIR}/level_list.h")
add_custom_command(

View File

@ -1,4 +1,4 @@
set(BUILD_STRINGS_DIR "${PROJECT_BINARY_DIR}/src/strings")
set(BUILD_STRINGS_DIR "${GENERATED_CODE_DIR}/src/strings")
set(FONT_DEF "${PROJECT_SOURCE_DIR}/assets/fonts/dejavu_sans/dejavu_sans_all.json")
set(GENERATE_STRINGS "${PROJECT_SOURCE_DIR}/tools/text/generate_strings.py")

View File

@ -22,11 +22,11 @@ configuration time (`make`, `ninja`, etc.).
Configure the build system with the following command. Portal 64 is
cross-compiled for the N64, and so a toolchain file must be specified.
**Note:** Currently, the build directory must be named `build`.
```sh
cd portal64
cmake -G "Ninja" -B build -S . -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-N64.cmake
# Replace <build_directory> with build directory name
cmake -G "Ninja" -B <build_directory> -S . -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-N64.cmake
```
### Changing the CMake Generator

View File

@ -16,7 +16,6 @@ target_link_libraries(engine INTERFACE
platform
)
# TODO: file sets, headers
target_sources(engine INTERFACE
audio/audio.c
audio/audiomgr.c
@ -192,7 +191,7 @@ endif()
#########################
set(GEN_VERSION_HEADER "${PROJECT_SOURCE_DIR}/cmake/GenVersionHeader.cmake")
set(VERSION_H "${PROJECT_BINARY_DIR}/version.h")
set(VERSION_H "${GENERATED_CODE_DIR}/version.h")
add_custom_target(version_header
DEPENDS

View File

@ -1,7 +1,7 @@
#include "clips.h"
#include "../../build/src/audio/clips.h"
#include "codegen/src/audio/clips.h"
unsigned short soundsSkippable[8] = {
SOUNDS_PORTAL_ENTER1,

View File

@ -2,9 +2,10 @@
#define __DECOR_OBJECT_H__
#include <ultra64.h>
#include "../physics/collision_object.h"
#include "../math/transform.h"
#include "../graphics/renderstate.h"
#include "graphics/renderstate.h"
#include "math/transform.h"
#include "physics/collision_object.h"
enum DecorObjectFlags {
// important objects respawn at their original

View File

@ -1,12 +1,12 @@
#include "decor_object_list.h"
#include "../../build/assets/materials/static.h"
#include "../../build/src/audio/clips.h"
#include "../../build/assets/models/dynamic_model_list.h"
#include "../../build/assets/models/props/light_rail_endcap.h"
#include "physics/collision_cylinder.h"
#include "physics/collision_box.h"
#include "../physics/collision_cylinder.h"
#include "../physics/collision_box.h"
#include "codegen/assets/materials/static.h"
#include "codegen/src/audio/clips.h"
#include "codegen/assets/models/dynamic_model_list.h"
#include "codegen/assets/models/props/light_rail_endcap.h"
struct Vector2 gCylinderColliderEdgeVectors[] = {
{0.0f, 1.0f},

View File

@ -1,6 +1,6 @@
#include "effect_definitions.h"
#include "../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
struct SplashParticleDefinition gFailPortalSplash[2] = {
{

View File

@ -1,15 +1,14 @@
#include "portal_trail.h"
#include "../math/vector2.h"
#include "../math/mathf.h"
#include "../defs.h"
#include "../build/assets/models/portal_gun/ball_trail.h"
#include "../build/assets/materials/static.h"
#include "../graphics/color.h"
#include "defs.h"
#include "graphics/color.h"
#include "math/vector2.h"
#include "math/mathf.h"
#include "system/time.h"
#include "codegen/assets/models/portal_gun/ball_trail.h"
#include "codegen/assets/materials/static.h"
#define TRAIL_LENGTH 8.0f
#define FADE_IN_LENGTH 4.0f
#define SEGMENT_LENGTH 2.0f

View File

@ -1,6 +1,6 @@
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"
#include "codegen/assets/materials/ui.h"
Gfx* gDejaVuSansImages[] = {
ui_dejavu_sans_0,

View File

@ -1,6 +1,6 @@
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"
#include "codegen/assets/materials/ui.h"
Gfx* gDejaVuSansImages[] = {
ui_dejavu_sans_0,

View File

@ -6,7 +6,7 @@
#include "graphics/color.h"
#include "math/vector2s16.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/strings/strings.h"
struct FontKerning {
char amount;

View File

@ -1,6 +1,6 @@
#include "dejavu_sans.h"
#include "../build/assets/materials/ui.h"
#include "codegen/assets/materials/ui.h"
Gfx* gLiberationMonoImages[] = {
ui_liberation_mono_0,

View File

@ -1,17 +1,18 @@
#include "credits.h"
#include "audio/soundplayer.h"
#include "font/font.h"
#include "font/liberation_mono.h"
#include "graphics/image.h"
#include "levels.h"
#include "system/controller.h"
#include "system/time.h"
#include "./levels.h"
#include "../audio/soundplayer.h"
#include "../build/src/audio/clips.h"
#include "../util/memory.h"
#include "../util/rom.h"
#include "../graphics/image.h"
#include "../build/assets/materials/static.h"
#include "../build/assets/materials/ui.h"
#include "../system/controller.h"
#include "../font/font.h"
#include "../font/liberation_mono.h"
#include "util/memory.h"
#include "util/rom.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/audio/clips.h"
#define FADE_IN_TIME 1.0f

View File

@ -1,14 +1,15 @@
#include "intro.h"
#include "audio/soundplayer.h"
#include "graphics/image.h"
#include "levels.h"
#include "system/controller.h"
#include "system/time.h"
#include "./levels.h"
#include "../audio/soundplayer.h"
#include "../build/src/audio/clips.h"
#include "../util/memory.h"
#include "../util/rom.h"
#include "../graphics/image.h"
#include "../build/assets/materials/images.h"
#include "../system/controller.h"
#include "util/memory.h"
#include "util/rom.h"
#include "codegen/assets/materials/images.h"
#include "codegen/src/audio/clips.h"
#define INTRO_TIME 9.0f

View File

@ -1,8 +0,0 @@
#ifndef __LEVEL_DEF_GEN_H__
#define __LEVEL_DEF_GEN_H__
#include "../../build/assets/materials/static.h"
#include "level_definition.h"
#endif

View File

@ -1,17 +1,16 @@
#include "levels.h"
#include "../build/assets/test_chambers/level_list.h"
#include "../build/assets/materials/static.h"
#include "physics/collision_scene.h"
#include "static_render.h"
#include "cutscene_runner.h"
#include "../graphics/graphics.h"
#include "../player/player.h"
#include "../savefile/checkpoint.h"
#include "graphics/graphics.h"
#include "physics/collision_scene.h"
#include "player/player.h"
#include "savefile/checkpoint.h"
#include "static_render.h"
#include "util/rom.h"
#include "util/memory.h"
#include "../util/rom.h"
#include "../util/memory.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/test_chambers/level_list.h"
struct LevelDefinition* gCurrentLevel;
int gCurrentLevelIndex;

View File

@ -1,14 +1,14 @@
#include "static_render.h"
#include "levels.h"
#include "util/memory.h"
#include "defs.h"
#include "../graphics/render_scene.h"
#include "../math/mathf.h"
#include "../math/rotated_box.h"
#include "../scene/signals.h"
#include "graphics/render_scene.h"
#include "levels.h"
#include "math/mathf.h"
#include "math/rotated_box.h"
#include "scene/signals.h"
#include "util/memory.h"
#include "../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
void staticRenderTraverseIndex(
struct StaticContentBox* box,

View File

@ -1,6 +1,8 @@
#include "locales.h"
#include "../build/src/audio/languages.h"
#include "../savefile/savefile.h"
#include "savefile/savefile.h"
#include "codegen/src/audio/languages.h"
int mapLocaleSound(int soundId) {
// Is this a localized sound?

View File

@ -5,8 +5,8 @@
#include "savefile/savefile.h"
#include "system/controller.h"
#include "../build/src/audio/languages.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/audio/languages.h"
#include "codegen/src/strings/strings.h"
#define GAMEPLAY_Y 54
#define GAMEPLAY_WIDTH 252

View File

@ -1,11 +1,12 @@
#include "cheat_codes.h"
#include "../build/src/audio/clips.h"
#include "../audio/soundplayer.h"
#include "../scene/scene.h"
#include "../build/src/audio/clips.h"
#include "../savefile/savefile.h"
#include "../levels/levels.h"
#include "audio/soundplayer.h"
#include "levels/levels.h"
#include "savefile/savefile.h"
#include "scene/scene.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/audio/clips.h"
struct CheatCodePattern gCheatCodes[CheatCodeCount] = {
[CheatCodeUnlockGun] = {

View File

@ -4,8 +4,8 @@
#include "font/dejavu_sans.h"
#include "system/controller.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/audio/clips.h"
#define DIALOG_LEFT 40
#define DIALOG_WIDTH (SCREEN_WD - (DIALOG_LEFT * 2))

View File

@ -7,10 +7,10 @@
#include "system/controller.h"
#include "util/memory.h"
#include "../build/assets/materials/ui.h"
#include "codegen/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
#define CONTROL_ROW_HEIGHT 14

View File

@ -7,8 +7,8 @@
#include "util/memory.h"
#include "util/rom.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/strings/strings.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/strings/strings.h"
void gameMenuInit(struct GameMenu* gameMenu, struct LandingMenuOption* options, int optionCount, int darkenBackground) {
landingMenuInit(&gameMenu->landingMenu, options, optionCount, darkenBackground);

View File

@ -1,12 +1,12 @@
#include "joystick_options.h"
#include "../system/controller.h"
#include "../font/dejavu_sans.h"
#include "../audio/soundplayer.h"
#include "../savefile/savefile.h"
#include "audio/soundplayer.h"
#include "font/dejavu_sans.h"
#include "savefile/savefile.h"
#include "system/controller.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "codegen/src/audio/clips.h"
#include "codegen/assets/materials/ui.h"
#define MENU_Y 54
#define MENU_WIDTH 252

View File

@ -8,10 +8,10 @@
#include "system/controller.h"
#include "util/memory.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/audio/clips.h"
#include "../build/version.h"
#include "codegen/version.h"
#define PORTAL_LOGO_X 30
#define PORTAL_LOGO_Y 74

View File

@ -7,8 +7,8 @@
#include "system/controller.h"
#include "util/memory.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
void loadGameMenuInit(struct LoadGameMenu* loadGame, struct SavefileListMenu* savefileList) {
loadGame->savefileList = savefileList;

View File

@ -6,10 +6,10 @@
#include "util/memory.h"
#include "util/rom.h"
#include "../build/assets/materials/ui.h"
#include "codegen/assets/materials/ui.h"
#include "../build/assets/test_chambers/test_chamber_00/test_chamber_00.h"
#include "../build/src/audio/clips.h"
#include "codegen/assets/test_chambers/test_chamber_00/test_chamber_00.h"
#include "codegen/src/audio/clips.h"
struct LandingMenuOption gMainMenuOptions[] = {
{GAMEUI_NEWGAME, GameMenuStateNewGame},

View File

@ -1,15 +1,15 @@
#include "menu_builder.h"
#include "audio/soundplayer.h"
#include "font/dejavu_sans.h"
#include "math/mathf.h"
#include "strings/translations.h"
#include "system/controller.h"
#include "system/time.h"
#include "util/memory.h"
#include "../font/dejavu_sans.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/audio/clips.h"
#include <stdbool.h>

View File

@ -14,10 +14,10 @@
#include "util/rom.h"
#include "../build/assets/materials/ui.h"
#include "../build/assets/materials/images.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/assets/materials/images.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
struct Chapter gChapters[] = {
{images_chapter1_rgba_16b, 0, 0},

View File

@ -1,15 +1,14 @@
#include "options_menu.h"
#include "../font/font.h"
#include "../font/dejavu_sans.h"
#include "font/font.h"
#include "font/dejavu_sans.h"
#include "savefile/savefile.h"
#include "system/controller.h"
#include "../savefile/savefile.h"
#include "codegen/assets/materials/ui.h"
#include "../build/assets/materials/ui.h"
#include "../system/controller.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
struct Tab gOptionTabs[] = {

View File

@ -7,8 +7,8 @@
#include "system/controller.h"
#include "util/memory.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
void saveGameMenuInit(struct SaveGameMenu* saveGame, struct SavefileListMenu* savefileList) {
saveGame->savefileList = savefileList;

View File

@ -10,9 +10,9 @@
#include "util/rom.h"
#include "util/string.h"
#include "../build/assets/materials/ui.h"
#include "../build/src/audio/clips.h"
#include "../build/src/strings/strings.h"
#include "codegen/assets/materials/ui.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
#define SAVE_SLOT_RENDER_W (SAVE_SLOT_IMAGE_W * 2)
#define SAVE_SLOT_RENDER_H (SAVE_SLOT_IMAGE_H * 2)

View File

@ -5,7 +5,7 @@
#include "strings/translations.h"
#include "util/string.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/strings/strings.h"
void textManipTestChamberMessage(char* result, int testChamber) {
strCopy(result, translationsGet(PORTAL_CHAPTER1_TITLE));

View File

@ -5,7 +5,7 @@
#include "savefile/savefile.h"
#include "strings/translations.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/strings/strings.h"
#define MENU_Y 54
#define MENU_WIDTH 252

View File

@ -1,25 +1,27 @@
#include "player.h"
#include "player_rumble_clips.h"
#include "../audio/clips.h"
#include "../audio/soundplayer.h"
#include "../controls/controller_actions.h"
#include "../defs.h"
#include "../levels/levels.h"
#include "../math/mathf.h"
#include "../physics/collision_capsule.h"
#include "../physics/collision_scene.h"
#include "../physics/collision.h"
#include "../physics/config.h"
#include "../physics/point_constraint.h"
#include "system/time.h"
#include "../physics/contact_insertion.h"
#include "../scene/ball.h"
#include "../savefile/savefile.h"
#include "../player/grab_rotation.h"
#include "../build/assets/models/player/chell.h"
#include "../build/assets/materials/static.h"
#include "../build/assets/models/portal_gun/w_portalgun.h"
#include "player/grab_rotation.h"
#include "player_rumble_clips.h"
#include "audio/clips.h"
#include "audio/soundplayer.h"
#include "defs.h"
#include "controls/controller_actions.h"
#include "levels/levels.h"
#include "math/mathf.h"
#include "physics/collision_capsule.h"
#include "physics/collision_scene.h"
#include "physics/collision.h"
#include "physics/config.h"
#include "physics/contact_insertion.h"
#include "physics/point_constraint.h"
#include "savefile/savefile.h"
#include "scene/ball.h"
#include "system/time.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/player/chell.h"
#include "codegen/assets/models/portal_gun/w_portalgun.h"
#define GRAB_RAYCAST_DISTANCE 2.5f
#define GRAB_MIN_OFFSET_Y -1.1f

View File

@ -1,7 +1,7 @@
#ifndef __PLAYER_PLAYER_RUMBLE_CLIPS_H__
#define __PLAYER_PLAYER_RUMBLE_CLIPS_H__
#include "../controls/rumble_pak.h"
#include "controls/rumble_pak.h"
extern struct RumblePakWave gPlayerDieRumbleWave;

View File

@ -1,22 +1,18 @@
#include "./ball.h"
#include "ball.h"
#include "audio/soundplayer.h"
#include "audio/clips.h"
#include "defs.h"
#include "dynamic_scene.h"
#include "../defs.h"
#include "../physics/collision_scene.h"
#include "../physics/collision_box.h"
#include "effects/effect_definitions.h"
#include "physics/collision_scene.h"
#include "physics/collision_box.h"
#include "scene.h"
#include "system/time.h"
#include "../build/assets/models/grav_flare.h"
#include "../build/assets/models/fleck_ash2.h"
#include "../build/assets/materials/static.h"
#include "../audio/soundplayer.h"
#include "../audio/clips.h"
#include "../effects/effect_definitions.h"
#include "./scene.h"
#include "codegen/assets/models/grav_flare.h"
#include "codegen/assets/models/fleck_ash2.h"
#include "codegen/assets/materials/static.h"
#define BALL_RADIUS 0.1f

View File

@ -1,16 +1,15 @@
#include "ball_catcher.h"
#include "system/time.h"
#include "../physics/collision_box.h"
#include "../physics/collision_scene.h"
#include "dynamic_scene.h"
#include "physics/collision_box.h"
#include "physics/collision_scene.h"
#include "signals.h"
#include "../util/dynamic_asset_loader.h"
#include "system/time.h"
#include "util/dynamic_asset_loader.h"
#include "../build/assets/models/props/combine_ball_catcher.h"
#include "../build/assets/materials/static.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/combine_ball_catcher.h"
struct CollisionBox gBallCatcherBox = {
{0.5f, 0.5f, 0.5f},

View File

@ -1,16 +1,14 @@
#ifndef __SCENE_BALL_CATCHER_H__
#define __SCENE_BALL_CATCHER_H__
#include "ball_launcher.h"
#include "../sk64/skeletool_armature.h"
#include "../sk64/skeletool_animator.h"
#include "../physics/collision_object.h"
#include "../levels/level_definition.h"
#include "./ball_launcher.h"
#include "../audio/clips.h"
#include "../audio/soundplayer.h"
#include "audio/clips.h"
#include "audio/soundplayer.h"
#include "levels/level_definition.h"
#include "physics/collision_object.h"
#include "sk64/skeletool_armature.h"
#include "sk64/skeletool_animator.h"
struct BallCatcher {
struct CollisionObject collisionObject;

View File

@ -1,18 +1,17 @@
#include "ball_launcher.h"
#include "system/time.h"
#include "../physics/collision_box.h"
#include "../physics/collision_scene.h"
#include "audio/clips.h"
#include "audio/soundplayer.h"
#include "dynamic_scene.h"
#include "physics/collision_box.h"
#include "physics/collision_scene.h"
#include "signals.h"
#include "../audio/clips.h"
#include "../audio/soundplayer.h"
#include "../util/dynamic_asset_loader.h"
#include "system/time.h"
#include "util/dynamic_asset_loader.h"
#include "../build/assets/models/props/combine_ball_launcher.h"
#include "../build/assets/materials/static.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/combine_ball_launcher.h"
struct CollisionBox gBallLauncherBox = {
{0.5f, 0.5f, 0.5f},

View File

@ -1,13 +1,12 @@
#ifndef __SCENE_BALL_LAUNCHER_H__
#define __SCENE_BALL_LAUNCHER_H__
#include "../sk64/skeletool_armature.h"
#include "../sk64/skeletool_animator.h"
#include "../physics/collision_object.h"
#include "ball.h"
#include "../levels/level_definition.h"
#include "./ball.h"
#include "levels/level_definition.h"
#include "physics/collision_object.h"
#include "sk64/skeletool_armature.h"
#include "sk64/skeletool_animator.h"
struct BallLauncher {
struct CollisionObject collisionObject;

View File

@ -1,19 +1,19 @@
#include "box_dropper.h"
#include "../scene/dynamic_scene.h"
#include "../defs.h"
#include "../physics/config.h"
#include "system/time.h"
#include "signals.h"
#include "../decor/decor_object_list.h"
#include "../util/dynamic_asset_loader.h"
#include "../../build/assets/materials/static.h"
#include "../../build/assets/models/props/box_dropper.h"
#include "../../build/assets/models/dynamic_model_list.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "decor/decor_object_list.h"
#include "defs.h"
#include "hud.h"
#include "physics/config.h"
#include "scene.h"
#include "scene/dynamic_scene.h"
#include "signals.h"
#include "system/time.h"
#include "util/dynamic_asset_loader.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_model_list.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/box_dropper.h"
#define DROPPER_RELOAD_TIME 2.0f
#define DROPPER_DROP_TIME 0.5f

View File

@ -1,19 +1,19 @@
#include "button.h"
#include "defs.h"
#include "../graphics/renderstate.h"
#include "dynamic_scene.h"
#include "../physics/collision_cylinder.h"
#include "../physics/collision_scene.h"
#include "../physics/contact_solver.h"
#include "graphics/renderstate.h"
#include "physics/collision_cylinder.h"
#include "physics/collision_scene.h"
#include "physics/contact_solver.h"
#include "scene/hud.h"
#include "scene/scene.h"
#include "system/time.h"
#include "../util/dynamic_asset_loader.h"
#include "util/dynamic_asset_loader.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "../build/assets/materials/static.h"
#include "../../build/assets/models/props/button.h"
#include "../scene/hud.h"
#include "../scene/scene.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/button.h"
struct Vector2 gButtonCylinderEdgeVectors[] = {
{0.0f, 1.0f},

View File

@ -1,21 +1,17 @@
#include "clock.h"
#include "../scene/dynamic_scene.h"
#include "../defs.h"
#include "../levels/levels.h"
#include "../levels/cutscene_runner.h"
#include "../build/assets/models/signage/clock_digits.h"
#include "../util/memory.h"
#include "defs.h"
#include "levels/cutscene_runner.h"
#include "levels/levels.h"
#include "math/mathf.h"
#include "scene/dynamic_scene.h"
#include "system/time.h"
#include "util/dynamic_asset_loader.h"
#include "util/memory.h"
#include "../build/assets/models/dynamic_model_list.h"
#include "../../build/assets/materials/static.h"
#include "../util/dynamic_asset_loader.h"
#include "../math/mathf.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_model_list.h"
#include "codegen/assets/models/signage/clock_digits.h"
#define DIGIT_WIDTH 512

View File

@ -1,22 +1,21 @@
#include "door.h"
#include "../graphics/render_scene.h"
#include "defs.h"
#include "../scene/dynamic_scene.h"
#include "signals.h"
#include "../math/mathf.h"
#include "system/time.h"
#include "../physics/collision_box.h"
#include "../physics/collision_scene.h"
#include "../util/dynamic_asset_loader.h"
#include "graphics/render_scene.h"
#include "hud.h"
#include "math/mathf.h"
#include "physics/collision_box.h"
#include "physics/collision_scene.h"
#include "scene.h"
#include "scene/dynamic_scene.h"
#include "signals.h"
#include "system/time.h"
#include "util/dynamic_asset_loader.h"
#include "../build/assets/materials/static.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "../build/assets/models/props/door_01.h"
#include "../build/assets/models/props/door_02.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/door_01.h"
#include "codegen/assets/models/props/door_02.h"
#define DOOR_COLLISION_Y_OFFSET 1.0f
#define DOOR_COLLISION_LAYERS (COLLISION_LAYERS_TANGIBLE | COLLISION_LAYERS_STATIC | COLLISION_LAYERS_BLOCK_BALL)

View File

@ -1,21 +1,20 @@
#include "elevator.h"
#include "../physics/collision_scene.h"
#include "../scene/dynamic_scene.h"
#include "../physics/mesh_collider.h"
#include "./signals.h"
#include "../math/mathf.h"
#include "audio/clips.h"
#include "audio/soundplayer.h"
#include "controls/rumble_pak.h"
#include "math/mathf.h"
#include "physics/collision_scene.h"
#include "physics/mesh_collider.h"
#include "savefile/checkpoint.h"
#include "scene/dynamic_scene.h"
#include "signals.h"
#include "system/time.h"
#include "../audio/soundplayer.h"
#include "../audio/clips.h"
#include "../controls/rumble_pak.h"
#include "../savefile/checkpoint.h"
#include "../../build/assets/models/props/round_elevator_collision.h"
#include "../../build/assets/models/props/round_elevator_interior.h"
#include "../../build/assets/models/props/round_elevator.h"
#include "../../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/props/round_elevator_collision.h"
#include "codegen/assets/models/props/round_elevator_interior.h"
#include "codegen/assets/models/props/round_elevator.h"
#define AUTO_OPEN_DISTANCE 4.0f
#define INSIDE_DISTANCE 1.2f

View File

@ -1,17 +1,16 @@
#include "fizzler.h"
#include "../util/memory.h"
#include "../graphics/render_scene.h"
#include "../scene/dynamic_scene.h"
#include "../physics/collision_scene.h"
#include "../util/dynamic_asset_loader.h"
#include "../math/mathf.h"
#include "../decor/decor_object_list.h"
#include "decor/decor_object_list.h"
#include "graphics/render_scene.h"
#include "math/mathf.h"
#include "physics/collision_scene.h"
#include "scene/dynamic_scene.h"
#include "signals.h"
#include "util/dynamic_asset_loader.h"
#include "util/memory.h"
#include "../../build/assets/models/dynamic_model_list.h"
#include "../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_model_list.h"
#define IMAGE_WIDTH 16
#define IMAGE_HEIGHT 64

View File

@ -8,7 +8,7 @@
#include "strings/translations.h"
#include "system/time.h"
#include "../../build/assets/materials/hud.h"
#include "codegen/assets/materials/hud.h"
#define HUD_CENTER_WIDTH 6
#define HUD_CENTER_HEIGHT 8

View File

@ -5,7 +5,7 @@
#include "graphics/renderstate.h"
#include "player/player.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/strings/strings.h"
#define INTRO_BLACK_TIME 3.0f
#define INTRO_FADE_TIME 1.0f

View File

@ -1,16 +1,16 @@
#include "pedestal.h"
#include "../scene/dynamic_scene.h"
#include "../defs.h"
#include "defs.h"
#include "scene/dynamic_scene.h"
#include "scene/hud.h"
#include "scene/scene.h"
#include "system/time.h"
#include "../util/dynamic_asset_loader.h"
#include "util/dynamic_asset_loader.h"
#include "../build/assets/materials/static.h"
#include "../build/assets/models/pedestal.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "../../build/assets/models/portal_gun/w_portalgun.h"
#include "../scene/hud.h"
#include "../scene/scene.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/pedestal.h"
#include "codegen/assets/models/portal_gun/w_portalgun.h"
struct Vector2 gMaxPedistalRotation;
#define MAX_PEDISTAL_ROTATION_DEGREES_PER_SEC (M_PI / 3.0f)

View File

@ -1,25 +1,25 @@
#include "portal.h"
#include "../graphics/screen_clipper.h"
#include "../graphics/graphics.h"
#include "../defs.h"
#include "defs.h"
#include "dynamic_scene.h"
#include "../physics/collision_scene.h"
#include "../math/mathf.h"
#include "../math/vector2s16.h"
#include "graphics/graphics.h"
#include "graphics/screen_clipper.h"
#include "levels/levels.h"
#include "math/mathf.h"
#include "math/vector2s16.h"
#include "physics/collision_scene.h"
#include "portal_surface_generator.h"
#include "scene/dynamic_scene.h"
#include "system/time.h"
#include "../levels/levels.h"
#include "./portal_surface_generator.h"
#include "../scene/dynamic_scene.h"
#include "../build/assets/models/portal/portal_blue.h"
#include "../build/assets/models/portal/portal_blue_filled.h"
#include "../build/assets/models/portal/portal_blue_face.h"
#include "../build/assets/models/portal/portal_collider.h"
#include "../build/assets/models/portal/portal_collider_vertical.h"
#include "../build/assets/models/portal/portal_orange.h"
#include "../build/assets/models/portal/portal_orange_face.h"
#include "../build/assets/models/portal/portal_orange_filled.h"
#include "codegen/assets/models/portal/portal_blue.h"
#include "codegen/assets/models/portal/portal_blue_filled.h"
#include "codegen/assets/models/portal/portal_blue_face.h"
#include "codegen/assets/models/portal/portal_collider.h"
#include "codegen/assets/models/portal/portal_collider_vertical.h"
#include "codegen/assets/models/portal/portal_orange.h"
#include "codegen/assets/models/portal/portal_orange_face.h"
#include "codegen/assets/models/portal/portal_orange_filled.h"
struct ColliderTypeData gPortalColliderType = {
CollisionShapeTypeMesh,

View File

@ -1,17 +1,15 @@
#include "portal_gun.h"
#include "../physics/collision_scene.h"
#include "../physics/collision_cylinder.h"
#include "./scene.h"
#include "effects/effect_definitions.h"
#include "levels/material_state.h"
#include "physics/collision_scene.h"
#include "physics/collision_cylinder.h"
#include "render_plan.h"
#include "scene.h"
#include "../levels/material_state.h"
#include "../effects/effect_definitions.h"
#include "./render_plan.h"
#include "../../build/assets/models/grav_flare.h"
#include "../../build/assets/models/portal_gun/v_portalgun.h"
#include "../../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/grav_flare.h"
#include "codegen/assets/models/portal_gun/v_portalgun.h"
// the portal gun is rendered with a different field of view than the scene
#define FIRST_PERSON_POV_FOV 42.45f

View File

@ -1,11 +1,11 @@
#include "portal_render.h"
#include "../defs.h"
#include "../graphics/graphics.h"
#include "defs.h"
#include "graphics/graphics.h"
#include "render_plan.h"
#include "../build/assets/models/portal/portal_blue_filled.h"
#include "../build/assets/models/portal/portal_orange_filled.h"
#include "codegen/assets/models/portal/portal_blue_filled.h"
#include "codegen/assets/models/portal/portal_orange_filled.h"
struct Quaternion gVerticalFlip = {0.0f, 1.0f, 0.0f, 0.0f};

View File

@ -1,23 +1,20 @@
#include "render_plan.h"
#include "../graphics/screen_clipper.h"
#include "../physics/collision_scene.h"
#include "../levels/static_render.h"
#include "../util/memory.h"
#include "../math/mathf.h"
#include "../math/matrix.h"
#include "graphics/screen_clipper.h"
#include "levels/static_render.h"
#include "levels/levels.h"
#include "math/mathf.h"
#include "math/matrix.h"
#include "physics/collision_scene.h"
#include "portal_render.h"
#include "../scene/dynamic_scene.h"
#include "../levels/levels.h"
#include "../savefile/savefile.h"
#include "savefile/savefile.h"
#include "scene/dynamic_scene.h"
#include "util/memory.h"
#include "../build/assets/models/portal/portal_blue.h"
#include "../build/assets/models/portal/portal_blue_face.h"
#include "../build/assets/models/portal/portal_orange.h"
#include "../build/assets/models/portal/portal_orange_face.h"
#include "codegen/assets/models/portal/portal_blue.h"
#include "codegen/assets/models/portal/portal_blue_face.h"
#include "codegen/assets/models/portal/portal_orange.h"
#include "codegen/assets/models/portal/portal_orange_face.h"
// if a portal takes up a small portion of the screen it is worth to clear
// the zbuffer after drawing the contents instead of

View File

@ -35,8 +35,8 @@
#include "system/time.h"
#include "util/memory.h"
#include "../build/src/strings/strings.h"
#include "../build/src/audio/clips.h"
#include "codegen/src/audio/clips.h"
#include "codegen/src/strings/strings.h"
extern struct GameMenu gGameMenu;

View File

@ -1,12 +1,12 @@
#include "scene_animator.h"
#include "../util/memory.h"
#include "audio/soundplayer.h"
#include "defs.h"
#include "math/mathf.h"
#include "system/time.h"
#include "../math/mathf.h"
#include "../defs.h"
#include "util/memory.h"
#include "../audio/soundplayer.h"
#include "../build/src/audio/clips.h"
#include "codegen/src/audio/clips.h"
struct AnimatedAudioInfo {
short startSoundId;

View File

@ -1,19 +1,19 @@
#include "security_camera.h"
#include "decor/decor_object.h"
#include "defs.h"
#include "../physics/collision_box.h"
#include "../physics/collision_scene.h"
#include "dynamic_scene.h"
#include "levels/cutscene_runner.h"
#include "physics/collision_box.h"
#include "physics/collision_scene.h"
#include "scene.h"
#include "system/time.h"
#include "../levels/cutscene_runner.h"
#include "../decor/decor_object.h"
#include "../util/dynamic_asset_loader.h"
#include "util/dynamic_asset_loader.h"
#include "../build/assets/materials/static.h"
#include "../build/src/audio/clips.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "../../build/assets/models/props/security_camera.h"
#include "codegen/assets/materials/static.h"
#include "codegen/src/audio/clips.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/props/security_camera.h"
struct CollisionBox gSecurityCameraCollisionBox = {
{0.15, 0.3f, 0.35f}

View File

@ -1,14 +1,14 @@
#include "signage.h"
#include "../scene/dynamic_scene.h"
#include "../levels/levels.h"
#include "../defs.h"
#include "../graphics/color.h"
#include "defs.h"
#include "graphics/color.h"
#include "levels/levels.h"
#include "scene/dynamic_scene.h"
#include "system/time.h"
#include "../build/assets/models/props/signage.h"
#include "../build/assets/models/props/cylinder_test.h"
#include "../../build/assets/materials/static.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/props/cylinder_test.h"
#include "codegen/assets/models/props/signage.h"
struct SignStateFrame {

View File

@ -1,8 +1,8 @@
#ifndef __SCENE_SIGNAGE_H__
#define __SCENE_SIGNAGE_H__
#include "../math/transform.h"
#include "../levels/level_definition.h"
#include "levels/level_definition.h"
#include "math/transform.h"
struct Signage {
struct Transform transform;

View File

@ -1,18 +1,17 @@
#include "switch.h"
#include "../physics/collision_cylinder.h"
#include "../physics/collision_scene.h"
#include "dynamic_scene.h"
#include "physics/collision_cylinder.h"
#include "physics/collision_scene.h"
#include "scene/hud.h"
#include "scene/scene.h"
#include "signals.h"
#include "../util/dynamic_asset_loader.h"
#include "../build/assets/models/props/switch001.h"
#include "../build/assets/materials/static.h"
#include "../../build/assets/models/dynamic_animated_model_list.h"
#include "util/dynamic_asset_loader.h"
#include "system/time.h"
#include "../scene/hud.h"
#include "../scene/scene.h"
#include "codegen/assets/models/props/switch001.h"
#include "codegen/assets/materials/static.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
#define COLLIDER_HEIGHT 0.7f
#define TICKTOCK_PAUSE_LENGTH 0.25f

View File

@ -3,7 +3,7 @@
#include "util/memory.h"
#include "util/rom.h"
#include "../build/src/strings/strings.h"
#include "codegen/src/strings/strings.h"
char* gLoadedLanugageBlock = NULL;
char** gCurrentTranslations = NULL;

View File

@ -1,10 +1,11 @@
#include "dynamic_asset_loader.h"
#include "graphics/profile_task.h"
#include "memory.h"
#include "rom.h"
#include "../graphics/profile_task.h"
#include "../build/assets/models/dynamic_model_list.h"
#include "../build/assets/models/dynamic_animated_model_list.h"
#include "codegen/assets/models/dynamic_model_list.h"
#include "codegen/assets/models/dynamic_animated_model_list.h"
Gfx* gLoadedModels[DYNAMIC_MODEL_COUNT];
u32 gModelPointerOffset[DYNAMIC_MODEL_COUNT];

View File

@ -9,8 +9,8 @@ local room_export = require('tools.level_scripts.room_export')
local animation = require('tools.level_scripts.animation')
local signals = require('tools.level_scripts.signals')
sk_definition_writer.add_header('"../build/assets/materials/static.h"')
sk_definition_writer.add_header('"../build/src/strings/strings.h"')
sk_definition_writer.add_header('"codegen/assets/materials/static.h"')
sk_definition_writer.add_header('"codegen/src/strings/strings.h"')
sk_definition_writer.add_header('"levels/level_definition.h"')
local portalable_surfaces = {

View File

@ -7,7 +7,7 @@ local animation = require('tools.level_scripts.animation')
local yaml_loader = require('tools.level_scripts.yaml_loader')
local util = require('tools.level_scripts.util')
sk_definition_writer.add_header('"../build/src/audio/clips.h"')
sk_definition_writer.add_header('"codegen/src/audio/clips.h"')
local function cutscene_index(cutscenes, name)
for _, cutscene in pairs(cutscenes) do