Refactor cmake (#721)

* some start of refactor

* Update SetFlags.cmake

* Update SetCmakeVar.cmake

* Update SetFlags.cmake

* Fix error int-convertion

* more refactor

* clean up include and source file

* fix link of lib

* fix a warning

* fix include in src/actors

* fix include in src/debug

* fix include in src/ending

* fix include in src/engine/actors

* fix include in src/engine/cameras

* fix include in src/engine/editor

* fix include in src/engine/objects

* fix include in src/engine/tracks

* fix include in src/port/ui

* fix include in src/racing

* fix include in src/engine/vehicles

* fix include in subfolder of src/engine

* fix include in src/engine

* fix include in src/enhancements

* fix include in src

* fix switch

* invert common and findlib

* Update SetFlags.cmake

* clean up some workflow

* some splification

* Update build.sh

* Update Game.h

* add header back

* Delete test_check.cmake

* continue

* Update common.cmake
This commit is contained in:
coco875
2026-07-23 02:02:58 +02:00
committed by GitHub
parent 022e0737d5
commit 4c24ae2bc2
237 changed files with 1222 additions and 1358 deletions
+1 -6
View File
@@ -94,14 +94,9 @@ jobs:
-v "${{ github.workspace }}:/project" \
spaghettikart-builder:latest \
bash -c "
cp vcpkg.json /tmp/vcpkg.json && \
cd /tmp && \
\${VCPKG_ROOT}/vcpkg install --triplet x64-linux && \
cd /project && \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux && \
-DENABLE_VCPKG=ON && \
cmake --build build --parallel && \
make -C torch type=release -j\$(nproc) && \
torch/cmake-build-release/torch pack assets build/spaghetti.o2r o2r
+1 -5
View File
@@ -18,13 +18,9 @@ jobs:
submodules: recursive
- name: Install dependencies
run: brew install ninja cmake
- name: Install vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Build
run: |
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DENABLE_VCPKG=ON
cmake --build build-cmake -j --config ${{ matrix.config }}
- name: Create Package
run: |
+5 -18
View File
@@ -96,13 +96,9 @@ jobs:
submodules: recursive
- name: Install dependencies
run: brew install ninja cmake
- name: Install vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Build
run: |
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DENABLE_VCPKG=ON
cmake --build build-cmake --config ${{ matrix.config }} -j3
- name: Download spaghetti.o2r
uses: actions/download-artifact@v4
@@ -139,13 +135,9 @@ jobs:
submodules: recursive
- name: Install dependencies
run: brew install ninja cmake
- name: Install vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Build
run: |
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DENABLE_VCPKG=ON
cmake --build build-cmake --config ${{ matrix.config }} -j3
- name: Download spaghetti.o2r
uses: actions/download-artifact@v4
@@ -413,14 +405,9 @@ jobs:
-v "${{ github.workspace }}:/project" \
spaghettikart-builder:latest \
bash -c "
cp vcpkg.json /tmp/vcpkg.json && \
cd /tmp && \
\${VCPKG_ROOT}/vcpkg install --triplet x64-linux && \
cd /project && \
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux && \
-DENABLE_VCPKG=ON && \
cmake --build build --parallel
"
@@ -525,7 +512,7 @@ jobs:
spaghettikart-x86:latest \
bash -c "
cd /project/build-x86 && \
cpack -G External || true
cpack -G External
"
- name: Create Package
@@ -533,7 +520,7 @@ jobs:
mkdir -p spaghetti-x86-${{ matrix.config }}
wget -O gamecontrollerdb.txt https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/master/gamecontrollerdb.txt
mv gamecontrollerdb.txt spaghetti-x86-${{ matrix.config }}/
cp build-x86/*.appimage spaghetti-x86-${{ matrix.config }}/spaghetti.appimage 2>/dev/null || true
cp build-x86/*.appimage spaghetti-x86-${{ matrix.config }}/spaghetti.appimage
- name: Publish packaged artifacts
uses: actions/upload-artifact@v4
+239 -730
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
foreach(REQUIRED_VARIABLE TORCH_EXECUTABLE SOURCE_DIR BINARY_DIR)
if(NOT DEFINED ${REQUIRED_VARIABLE})
message(FATAL_ERROR "${REQUIRED_VARIABLE} is required")
endif()
endforeach()
file(LOCK "${BINARY_DIR}/spaghetti-o2r.lock" GUARD PROCESS TIMEOUT 300)
execute_process(
COMMAND "${TORCH_EXECUTABLE}" pack assets spaghetti.o2r o2r
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE GENERATE_RESULT)
if(NOT GENERATE_RESULT EQUAL 0)
message(FATAL_ERROR "Torch failed to generate spaghetti.o2r")
endif()
execute_process(
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${SOURCE_DIR}/spaghetti.o2r" "${BINARY_DIR}/spaghetti.o2r"
RESULT_VARIABLE COPY_RESULT)
if(NOT COPY_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to stage spaghetti.o2r")
endif()
+48
View File
@@ -0,0 +1,48 @@
execute_process(
COMMAND git -c safe.directory=${CMAKE_SOURCE_DIR} describe --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION
RESULT_VARIABLE GIT_DESCRIBE_RESULT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_DESCRIBE_RESULT EQUAL 0 AND NOT PROJECT_VERSION STREQUAL "")
string(REPLACE "-" ";" PROJECT_VERSION_LIST "${PROJECT_VERSION}")
list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_PATCH)
string(REPLACE "." ";" PROJECT_VERSION_LIST "${PROJECT_VERSION_PATCH}")
list(LENGTH PROJECT_VERSION_LIST PROJECT_VERSION_LIST_LENGTH)
if (${PROJECT_VERSION_LIST_LENGTH} LESS 3)
set(PROJECT_VERSION_PATCH 0)
else()
list(GET PROJECT_VERSION_LIST 2 PROJECT_VERSION_PATCH)
endif()
else()
set(PROJECT_VERSION "Unknown")
execute_process(
COMMAND git -c safe.directory=${CMAKE_SOURCE_DIR} log --pretty=format:%h -1
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION_PATCH
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (DEFINED PROJECT_VERSION_PATCH AND NOT "${PROJECT_VERSION_PATCH}" STREQUAL "")
set(PROJECT_VERSION "${PROJECT_VERSION}-${PROJECT_VERSION_PATCH}")
endif()
set(PROJECT_VERSION_PATCH 0)
endif()
set(NATO_PHONETIC_ALPHABET
"Alfa" "Bravo" "Charlie" "Delta" "Echo" "Foxtrot" "Golf" "Hotel"
"India" "Juliett" "Kilo" "Lima" "Mike" "November" "Oscar" "Papa"
"Quebec" "Romeo" "Sierra" "Tango" "Uniform" "Victor" "Whiskey"
"Xray" "Yankee" "Zulu")
list(LENGTH NATO_PHONETIC_ALPHABET NATO_WORD_COUNT)
math(EXPR PATCH_INDEX "${PROJECT_VERSION_PATCH} % ${NATO_WORD_COUNT}")
list(GET NATO_PHONETIC_ALPHABET ${PATCH_INDEX} PROJECT_PATCH_WORD)
set(PROJECT_BUILD_NAME
"Bolognese ${PROJECT_PATCH_WORD}"
CACHE STRING "" FORCE)
set(PROJECT_TEAM "SpaghettiKart Team - HarbourMasters")
message("Spaghetti Kart version: ${PROJECT_VERSION} ${PROJECT_PATCH_WORD}")
+34
View File
@@ -0,0 +1,34 @@
if(APPLE)
enable_language(OBJCXX)
endif()
# Set the minimum version of CMake and the deployment target for macOS
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
# Set the C++ standard and enable the MSVC parallel build option
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
# Automatically select the game target (for Visual Studio, etc.)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT
${PROJECT_NAME})
# Add a custom module path to locate additional CMake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
################################################################################
# Set target arch type if empty. Visual studio solution generator provides it.
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(NOT CMAKE_VS_PLATFORM_NAME)
set(CMAKE_VS_PLATFORM_NAME "x64")
endif()
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
endif()
endif()
+150
View File
@@ -0,0 +1,150 @@
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /fp:fast)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:/w;/Od;/ZI>"
"$<$<CONFIG:Release>:/O2;/Oi;/Gy;/W3;/Zi>" /permissive- /MP
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT} ${DEFAULT_CXX_EXCEPTION_HANDLING})
target_link_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:/INCREMENTAL>"
"$<$<CONFIG:Release>:/OPT:REF;/OPT:ICF;/INCREMENTAL:NO;/FORCE:MULTIPLE>"
/MANIFEST:NO /DEBUG /SUBSYSTEM:WINDOWS)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Release>:/O2;/Oi;/Gy>"
/permissive-
/MP
/w
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT}
${DEFAULT_CXX_EXCEPTION_HANDLING})
target_link_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:/STACK:8777216>"
"$<$<CONFIG:Release>:/OPT:REF;/OPT:ICF;/INCREMENTAL:NO;/FORCE:MULTIPLE>"
/MANIFEST:NO /DEBUG /SUBSYSTEM:WINDOWS)
endif()
# Remove /RTC from msvc flags
foreach(fentry CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
string(REGEX REPLACE "/RTC(su|[1su])" "" ${fentry} "${${fentry}}")
endforeach()
else()
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Wno-error
-Wno-missing-field-initializers
-Wno-parentheses
-Wno-missing-braces
-ffast-math
-flto=auto
-pipe)
target_link_options(${PROJECT_NAME} PRIVATE -flto=auto)
set(C_FLAGS -Werror-implicit-function-declaration
-Wno-incompatible-pointer-types)
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:C>:${C_FLAGS}>")
set(CXX_FLAGS -fpermissive -fomit-frame-pointer)
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS}>")
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
check_c_compiler_flag("-Wno-error=int-conversion"
HAS_WNO_ERROR_INT_CONVERSION)
if(HAS_WNO_ERROR_INT_CONVERSION)
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:C>:-Wno-error=int-conversion>")
endif()
check_cxx_compiler_flag("-Wno-error=narrowing" HAS_WNO_ERROR_NARROWING)
if(HAS_WNO_ERROR_NARROWING)
target_compile_options(
${PROJECT_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-error=narrowing>")
endif()
check_cxx_compiler_flag("-Wno-error=changes-meaning"
HAS_WNO_ERROR_CHANGES_MEANING)
if(HAS_WNO_ERROR_CHANGES_MEANING)
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-error=changes-meaning>")
endif()
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:-g>" "$<$<CONFIG:Release>:-O3>"
"$<$<CONFIG:MinSizeRel>:-Os>" "$<$<CONFIG:RelWithDebInfo>:-O2;-g>")
check_cxx_compiler_flag("-pthread" HAS_PTHREAD)
if(HAS_PTHREAD AND NOT CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
target_compile_options(${PROJECT_NAME} PRIVATE -pthread)
target_link_options(${PROJECT_NAME} PRIVATE -pthread)
endif()
if(NOT APPLE
AND NOT CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch"
AND NOT CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
check_cxx_compiler_flag("-msse2 -mfpmath=sse" HAS_SSE2)
if(HAS_SSE2)
target_compile_options(${PROJECT_NAME} PRIVATE -msse2 -mfpmath=sse)
endif()
endif()
include(CheckLinkerFlag)
check_linker_flag("CXX" "-Wl,-export-dynamic" HAS_EXPORT_DYNAMIC)
if(HAS_EXPORT_DYNAMIC)
target_link_options(${PROJECT_NAME} PRIVATE -Wl,-export-dynamic)
endif()
endif()
# LTO breaks debug information with AppleClang and Ninja. Keep LTO for all
# other configurations and explicitly override it for macOS Debug builds.
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
target_compile_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:-fno-lto>")
target_link_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:-fno-lto>")
endif()
endif()
# Add compile definitions for the target
target_compile_definitions(${PROJECT_NAME} PRIVATE
NDEBUG
VERSION_US=1
"$<$<BOOL:${USE_OPENGLES}>:USE_OPENGLES>"
ENABLE_RUMBLE=1
F3DEX_GBI=1
_LANGUAGE_C
_USE_MATH_DEFINES
CIMGUI_DEFINE_ENUMS_AND_STRUCTS
NON_MATCHING=1
NON_EQUIVALENT=1
AVOID_UB=1
SPAGHETTI_VERSION="${PROJECT_VERSION}")
target_compile_definitions(${PROJECT_NAME} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:ENABLE_DX11>"
INCLUDE_GAME_PRINTF
NOMINMAX
UNICODE
_UNICODE
_CRT_SECURE_NO_WARNINGS
_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS
STORMLIB_NO_AUTO_LINK)
set(STORMLIB_NO_AUTO_LINK ON)
elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
target_compile_definitions(
${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=3 SPDLOG_NO_THREAD_ID
SPDLOG_NO_TLS STBI_NO_THREAD_LOCALS)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<BOOL:${BUILD_CROWD_CONTROL}>:ENABLE_CROWD_CONTROL>"
_CONSOLE _CRT_SECURE_NO_WARNINGS UNICODE _UNICODE)
endif()
+7
View File
@@ -0,0 +1,7 @@
if(NOT DEFINED SOURCE_DIR OR NOT DEFINED DESTINATION_DIR)
message(FATAL_ERROR "SOURCE_DIR and DESTINATION_DIR are required")
endif()
file(MAKE_DIRECTORY "${DESTINATION_DIR}")
file(COPY "${SOURCE_DIR}/config.yml" "${SOURCE_DIR}/yamls"
"${SOURCE_DIR}/meta" DESTINATION "${DESTINATION_DIR}")
+9 -12
View File
@@ -1,23 +1,20 @@
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_COMPONENTS_ALL "SpaghettiKart")
set(CPACK_COMPONENTS_ALL "${CPACK_PACKAGE_NAME}")
if (CPACK_GENERATOR STREQUAL "External")
list(APPEND CPACK_COMPONENTS_ALL "extractor" "appimage")
endif()
if (CPACK_GENERATOR MATCHES "DEB|RPM")
# https://unix.stackexchange.com/a/11552/254512
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ship/bin")#/${CMAKE_PROJECT_VERSION}")
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
elseif (CPACK_GENERATOR MATCHES "ZIP")
set(CPACK_PACKAGING_INSTALL_PREFIX "")
if(CPACK_GENERATOR MATCHES "DEB|RPM")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ship/bin")
elseif(CPACK_GENERATOR MATCHES "ZIP")
set(CPACK_PACKAGING_INSTALL_PREFIX "")
endif()
if (CPACK_GENERATOR MATCHES "External")
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
SET(CPACK_MONOLITHIC_INSTALL 1)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/bin")
if(CPACK_GENERATOR MATCHES "External")
set(CPACK_MONOLITHIC_INSTALL ON)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/bin")
endif()
if (CPACK_GENERATOR MATCHES "Bundle")
@@ -26,4 +23,4 @@ if (CPACK_GENERATOR MATCHES "Bundle")
set(CPACK_BUNDLE_ICON "macosx/SpaghettiKart.icns")
# set(CPACK_BUNDLE_STARTUP_COMMAND "macosx/SpaghettiKart-macos.sh")
set(CPACK_BUNDLE_APPLE_CERT_APP "-")
endif()
endif()
+41
View File
@@ -0,0 +1,41 @@
if(WIN32)
find_package(Ogg CONFIG REQUIRED)
find_package(Vorbis CONFIG REQUIRED)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
set(ADDITIONAL_LIBRARY_DEPENDENCIES -lglad SDL2::SDL2)
elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
set(ADDITIONAL_LIBRARY_DEPENDENCIES "$<$<CONFIG:Debug>:-Wl,--wrap=abort>")
target_include_directories(${PROJECT_NAME} PRIVATE
${DEVKITPRO}/portlibs/wiiu/include/)
else()
find_package(Ogg REQUIRED)
find_package(Vorbis REQUIRED)
endif()
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
set(ADDITIONAL_LIBRARY_DEPENDENCIES Ogg::ogg Vorbis::vorbis
Vorbis::vorbisenc Vorbis::vorbisfile)
endif()
if(UNIX AND NOT APPLE)
if(USE_OPENGLES)
find_library(GLESv2_LIBRARY GLESv2 REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE ${GLESv2_LIBRARY})
else()
find_package(OpenGL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL)
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
find_package(SDL2)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
if(NOT USE_OPENGLES)
target_include_directories(${PROJECT_NAME} PRIVATE ${GLEW_INCLUDE_DIRS})
endif()
target_link_libraries(${PROJECT_NAME}
PRIVATE torch ${ADDITIONAL_LIBRARY_DEPENDENCIES})
+65
View File
@@ -0,0 +1,65 @@
# =================== SSE2NEON ===================
set(SSE2NEON_DIR ${CMAKE_BINARY_DIR}/_deps/sse2neon)
file(
DOWNLOAD
"https://raw.githubusercontent.com/DLTcollab/sse2neon/refs/heads/master/sse2neon.h"
"${SSE2NEON_DIR}/sse2neon.h")
target_include_directories(${PROJECT_NAME} PRIVATE ${SSE2NEON_DIR})
# ================== SEMVER ===================
set(SEMVER_DIR ${CMAKE_BINARY_DIR}/_deps/semver)
file(
DOWNLOAD
"https://raw.githubusercontent.com/Neargye/semver/refs/tags/v1.0.0-rc/include/semver.hpp"
"${SEMVER_DIR}/semver.hpp")
target_include_directories(${PROJECT_NAME} PRIVATE ${SEMVER_DIR})
# =================== DRLibs ===================
FetchContent_Declare(
dr_libs
GIT_REPOSITORY https://github.com/mackron/dr_libs.git
GIT_TAG da35f9d6c7374a95353fd1df1d394d44ab66cf01)
FetchContent_MakeAvailable(dr_libs)
target_include_directories(${PROJECT_NAME} PRIVATE ${dr_libs_SOURCE_DIR})
# =================== tomlplusplus ===================
include(FetchContent)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0)
FetchContent_MakeAvailable(tomlplusplus)
target_link_libraries(${PROJECT_NAME} PRIVATE tomlplusplus::tomlplusplus)
# libultraship
# Removes MPQ/OTR support
set(EXCLUDE_MPQ_SUPPORT TRUE CACHE BOOL "")
set(ENABLE_EXP_AUTO_CONFIGURE_CONTROLLERS ON CACHE BOOL "")
target_compile_definitions(${PROJECT_NAME} PRIVATE EXCLUDE_MPQ_SUPPORT)
target_include_directories(
${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/include
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/include/libultraship)
add_subdirectory(libultraship ${CMAKE_BINARY_DIR}/libultraship)
add_dependencies(${PROJECT_NAME} libultraship)
target_link_libraries(${PROJECT_NAME} PRIVATE libultraship)
# Torch
option(USE_STANDALONE "Build as a standalone executable" OFF)
option(BUILD_STORMLIB "Build with StormLib support" OFF)
option(BUILD_SM64 "Build with Super Mario 64 support" OFF)
option(BUILD_MK64 "Build with Mario Kart 64 support" ON)
option(BUILD_SF64 "Build with Star Fox 64 support" OFF)
option(BUILD_FZERO "Build with F-Zero X support" OFF)
option(BUILD_MARIO_ARTIST "Build with Mario Artist support" OFF)
# Companion.cpp uses AudioManager unconditionally, so preserve Torch's ON
# default until its non-NAudio build is fixed upstream.
option(BUILD_NAUDIO "Build with NAudio support" ON)
add_subdirectory(torch)
+30
View File
@@ -0,0 +1,30 @@
include(cmake/automate-vcpkg.cmake)
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VCPKG_TRIPLET x64-windows-static)
set(VCPKG_TARGET_TRIPLET x64-windows-static)
else()
set(VCPKG_TRIPLET x86-windows-static)
set(VCPKG_TARGET_TRIPLET x86-windows-static)
endif()
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
elseif(APPLE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64")
set(VCPKG_TRIPLET arm64-osx)
set(VCPKG_TARGET_TRIPLET arm64-osx)
else()
set(VCPKG_TRIPLET x64-osx)
set(VCPKG_TARGET_TRIPLET x64-osx)
endif()
elseif(UNIX AND NOT APPLE)
set(VCPKG_TRIPLET x64-linux)
set(VCPKG_TARGET_TRIPLET x64-linux)
endif()
vcpkg_bootstrap()
# install package from vcpkg.json
vcpkg_install_packages()
-3
View File
@@ -1,3 +0,0 @@
# kept for future reference
#set(CVAR_VSYNC_ENABLED "${CVAR_PREFIX_SETTING}.VsyncEnabled")
include("libultraship/cmake/cvars.cmake")
+12 -10
View File
@@ -43,9 +43,7 @@ set(CPACK_DEB_COMPONENT_INSTALL YES)
set(CPACK_EXTERNAL_ENABLE_STAGING YES)
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${PROJECT_BINARY_DIR}/appimage-generate.cmake")
file(GENERATE
OUTPUT "${PROJECT_BINARY_DIR}/appimage-generate.cmake"
CONTENT [[
set(APPIMAGE_SCRIPT_TEMPLATE [[
include(CMakePrintHelpers)
cmake_print_variables(CPACK_TEMPORARY_DIRECTORY)
cmake_print_variables(CPACK_TOPLEVEL_DIRECTORY)
@@ -69,9 +67,10 @@ if (NOT LINUXDEPLOY_EXECUTABLE)
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CPACK_PACKAGE_DIRECTORY}/config.yml" "${CPACK_TEMPORARY_DIRECTORY}/usr/bin/config.yml"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CPACK_PACKAGE_DIRECTORY}/yamls/" "${CPACK_TEMPORARY_DIRECTORY}/usr/bin/yamls/"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CPACK_PACKAGE_DIRECTORY}/meta/" "${CPACK_TEMPORARY_DIRECTORY}/usr/bin/meta/"
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CPACK_PACKAGE_DIRECTORY}
-DDESTINATION_DIR=${CPACK_TEMPORARY_DIRECTORY}/usr/bin
-P @CMAKE_CURRENT_LIST_DIR@/StageRuntimeFiles.cmake
COMMAND
${CMAKE_COMMAND} -E env
OUTPUT=${CPACK_PACKAGE_FILE_NAME}.appimage
@@ -80,14 +79,17 @@ execute_process(
${LINUXDEPLOY_EXECUTABLE}
--appimage-extract-and-run
--appdir=${CPACK_TEMPORARY_DIRECTORY}
--executable=$<TARGET_FILE:Spaghettify>
$<$<BOOL:$<TARGET_PROPERTY:Spaghettify,APPIMAGE_DESKTOP_FILE>>:--desktop-file=$<TARGET_PROPERTY:Spaghettify,APPIMAGE_DESKTOP_FILE>>
$<$<BOOL:$<TARGET_PROPERTY:Spaghettify,APPIMAGE_ICON_FILE>>:--icon-file=$<TARGET_PROPERTY:Spaghettify,APPIMAGE_ICON_FILE>>
--executable=$<TARGET_FILE:@PROJECT_NAME@>
$<$<BOOL:$<TARGET_PROPERTY:@PROJECT_NAME@,APPIMAGE_DESKTOP_FILE>>:--desktop-file=$<TARGET_PROPERTY:@PROJECT_NAME@,APPIMAGE_DESKTOP_FILE>>
$<$<BOOL:$<TARGET_PROPERTY:@PROJECT_NAME@,APPIMAGE_ICON_FILE>>:--icon-file=$<TARGET_PROPERTY:@PROJECT_NAME@,APPIMAGE_ICON_FILE>>
--output=appimage
--verbosity=2
)
]])
string(CONFIGURE "${APPIMAGE_SCRIPT_TEMPLATE}" APPIMAGE_SCRIPT @ONLY)
file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/appimage-generate.cmake"
CONTENT "${APPIMAGE_SCRIPT}")
endif()
include(CPack)
include(CPack)
-19
View File
@@ -1,19 +0,0 @@
set(LUS_BTN_A KbScancode::LUS_KB_SHIFT)
set(LUS_BTN_B KbScancode::LUS_KB_CONTROL)
set(LUS_BTN_L KbScancode::LUS_KB_Q)
set(LUS_BTN_R KbScancode::LUS_KB_SPACE)
set(LUS_BTN_Z KbScancode::LUS_KB_Z)
set(LUS_BTN_START KbScancode::LUS_KB_ENTER)
set(LUS_BTN_STICKUP KbScancode::LUS_KB_ARROWKEY_UP)
set(LUS_BTN_STICKDOWN KbScancode::LUS_KB_ARROWKEY_DOWN)
set(LUS_BTN_STICKLEFT KbScancode::LUS_KB_ARROWKEY_LEFT)
set(LUS_BTN_STICKRIGHT KbScancode::LUS_KB_ARROWKEY_RIGHT)
set(LUS_BTN_CUP KbScancode::LUS_KB_T)
set(LUS_BTN_CDOWN KbScancode::LUS_KB_G)
set(LUS_BTN_CLEFT KbScancode::LUS_KB_F)
set(LUS_BTN_CRIGHT KbScancode::LUS_KB_H)
set(LUS_BTN_DUP KbScancode::LUS_KB_NUMPAD8)
set(LUS_BTN_DDOWN KbScancode::LUS_KB_NUMPAD2)
set(LUS_BTN_DLEFT KbScancode::LUS_KB_NUMPAD4)
set(LUS_BTN_DRIGHT KbScancode::LUS_KB_NUMPAD6)
include("libultraship/cmake/cvars.cmake")
-7
View File
@@ -1,8 +1,6 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV VCPKG_ROOT=/opt/vcpkg
ENV PATH="${VCPKG_ROOT}:${PATH}"
# Install base dependencies
RUN apt-get update -y && apt-get -y upgrade && \
@@ -44,9 +42,4 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v${DOCKER_CMAKE_VERS
./cmake-${DOCKER_CMAKE_VERSION}-linux-x86_64.sh --prefix=/usr/local --skip-license && \
rm cmake-${DOCKER_CMAKE_VERSION}-linux-x86_64.sh
# Install vcpkg
RUN git clone https://github.com/microsoft/vcpkg.git ${VCPKG_ROOT} && \
cd ${VCPKG_ROOT} && \
./bootstrap-vcpkg.sh -disableMetrics
WORKDIR /project
-2
View File
@@ -3,8 +3,6 @@
FROM --platform=linux/386 debian:bookworm
ENV DEBIAN_FRONTEND=noninteractive
ENV VCPKG_ROOT=/opt/vcpkg
ENV PATH="${VCPKG_ROOT}:${PATH}"
# Install base dependencies
RUN apt-get update -y && apt-get -y upgrade && \
+28 -22
View File
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -euo pipefail
# Unified build script for SpaghettiKart
#
@@ -22,6 +22,19 @@ GROUP_ID=$(id -g)
cd "$PROJECT_DIR"
case "$BUILD_TYPE" in
Debug|Release|RelWithDebInfo|MinSizeRel) ;;
*)
echo "Unsupported build type: ${BUILD_TYPE}" >&2
exit 1
;;
esac
if [[ -n "$PACKAGE" && "$PACKAGE" != "appimage" ]]; then
echo "Unsupported package type: ${PACKAGE}" >&2
exit 1
fi
build_arch() {
local arch=$1
local build_type=$2
@@ -30,7 +43,6 @@ build_arch() {
local image_name="spaghettikart-${arch}"
local dockerfile=""
local platform=""
local triplet=""
echo "========================================"
echo "Building ${arch} ${build_type}"
@@ -40,12 +52,10 @@ build_arch() {
if [ "$arch" = "x86" ]; then
dockerfile="script/Dockerfile.x86"
platform="--platform linux/386"
triplet="x86-linux"
# Ensure QEMU is set up for i386 emulation
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes 2>/dev/null || true
else
dockerfile="script/Dockerfile"
triplet="x64-linux"
fi
# Build Docker image
@@ -62,9 +72,9 @@ build_arch() {
fi
# Build package command if requested
local package_cmd=""
local package_cmd=":"
if [ "$package" = "appimage" ]; then
package_cmd="&& cd ${build_dir} && cpack -G External"
package_cmd="cd ${build_dir} && cpack -G External"
fi
# Run build in Docker
@@ -81,15 +91,17 @@ build_arch() {
-e GROUP_ID="${GROUP_ID}" \
"${image_name}" \
bash -c "
set -e
cmake -B ${build_dir} -G Ninja \
-DCMAKE_BUILD_TYPE=${build_type} && \
cmake --build ${build_dir} --parallel && \
cp -f spaghetti.o2r ${build_dir}/ 2>/dev/null || true && \
cp -f mk64.o2r ${build_dir}/ 2>/dev/null || true ${package_cmd} && \
chown -R ${USER_ID}:${GROUP_ID} /project/${build_dir} 2>/dev/null || true
(cp -f spaghetti.o2r ${build_dir}/ 2>/dev/null || true) && \
(cp -f mk64.o2r ${build_dir}/ 2>/dev/null || true) && \
${package_cmd} && \
(chown -R ${USER_ID}:${GROUP_ID} /project/${build_dir} 2>/dev/null || true)
"
else
# x64: Use vcpkg for static linking
# x64: Let the CMake integration bootstrap and configure vcpkg.
docker run --rm \
${platform} \
-v "$(pwd):/project" \
@@ -98,21 +110,15 @@ build_arch() {
-e GROUP_ID="${GROUP_ID}" \
"${image_name}" \
bash -c "
# Install vcpkg dependencies
if [ -f vcpkg.json ]; then
cp vcpkg.json /tmp/vcpkg.json && \
cd /tmp && \
\${VCPKG_ROOT}/vcpkg install --triplet ${triplet} 2>/dev/null || true && \
cd /project
fi && \
set -e
cmake -B ${build_dir} -G Ninja \
-DCMAKE_BUILD_TYPE=${build_type} \
-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=${triplet} && \
-DENABLE_VCPKG=ON && \
cmake --build ${build_dir} --parallel && \
cp -f spaghetti.o2r ${build_dir}/ 2>/dev/null || true && \
cp -f mk64.o2r ${build_dir}/ 2>/dev/null || true ${package_cmd} && \
chown -R ${USER_ID}:${GROUP_ID} /project/${build_dir} 2>/dev/null || true
(cp -f spaghetti.o2r ${build_dir}/ 2>/dev/null || true) && \
(cp -f mk64.o2r ${build_dir}/ 2>/dev/null || true) && \
${package_cmd} && \
(chown -R ${USER_ID}:${GROUP_ID} /project/${build_dir} 2>/dev/null || true)
"
fi
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <code_800029B0.h>
#include <libultra/gbi.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <code_800029B0.h>
#include <defines.h>
#include <main.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
/**
+2 -2
View File
@@ -1,8 +1,8 @@
#include <actors.h>
#include <racing/actors.h>
#include <waypoints.h>
#include <defines.h>
#include <main.h>
#include <actors_extended.h>
#include <racing/actors_extended.h>
#include <code_800029B0.h>
#include "port/Game.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <defines.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <defines.h>
#include <assets/models/tracks/toads_turnpike/toads_turnpike_offsets.h>
+1 -1
View File
@@ -1,5 +1,5 @@
#include <camera.h>
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <libultra/gbi.h>
#include <assets/models/tracks/moo_moo_farm/moo_moo_farm_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <code_800029B0.h>
#include <libultra/gbi.h>
#include <main.h>
+4 -4
View File
@@ -1,9 +1,9 @@
#include "actors_extended.h"
#include "collision.h"
#include "racing/actors_extended.h"
#include "racing/collision.h"
#include "defines.h"
#include "external.h"
#include "audio/external.h"
#include "sounds.h"
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
/**
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <assets/models/tracks/choco_mountain/choco_mountain_data.h>
#include "port/interpolation/FrameInterpolation.h"
+2 -2
View File
@@ -1,5 +1,5 @@
#include "math_util.h"
#include <actors.h>
#include "racing/math_util.h"
#include <racing/actors.h>
#include <code_800029B0.h>
#include <main.h>
#include <assets/models/tracks/choco_mountain/choco_mountain_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <assets/textures/common_data.h>
+2 -2
View File
@@ -1,8 +1,8 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <code_800029B0.h>
#include <defines.h>
#include "collision.h"
#include "racing/collision.h"
#include "port/Game.h"
/**
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <macros.h>
#include "port/interpolation/FrameInterpolation.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the item box under the hot air balloon object.
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include "assets/textures/other_textures.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <defines.h>
#include <waypoints.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <assets/models/tracks/mario_raceway/mario_raceway_data.h>
#include "port/interpolation/FrameInterpolation.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the Mario sign actor.
+1 -1
View File
@@ -3,7 +3,7 @@
#include <actor_types.h>
#include "camera.h"
#include "main.h"
#include "actors.h"
#include "racing/actors.h"
#include "courses/all_course_data.h"
#include <assets/models/tracks/dks_jungle_parkway/dks_jungle_parkway_data.h>
#include <libultra/gbi.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <assets/models/tracks/koopa_troopa_beach/koopa_troopa_beach_data.h>
#include "port/interpolation/FrameInterpolation.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <libultra/gbi.h>
#include <assets/models/tracks/mario_raceway/mario_raceway_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the piranha plant actor.
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include "assets/models/tracks/kalimari_desert/kalimari_desert_data.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the railroad crossing actor.
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <defines.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <main.h>
#include <defines.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <assets/models/tracks/kalimari_desert/kalimari_desert_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the train engine actor.
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <assets/models/common_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
#include <libultra/gbi.h>
#include <main.h>
#include <assets/models/tracks/wario_stadium/wario_stadium_data.h>
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the Wario sign actor.
+1 -1
View File
@@ -1,5 +1,5 @@
#include <camera.h>
#include <actors.h>
#include <racing/actors.h>
#include <defines.h>
#include <main.h>
#include "port/interpolation/FrameInterpolation.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include <actors.h>
#include <racing/actors.h>
/**
* @brief Updates the Yoshi egg actor.
+1 -1
View File
@@ -1,7 +1,7 @@
#include <libultraship.h>
#include <macros.h>
#include <mk64.h>
#include "math_util.h"
#include "racing/math_util.h"
#include "animation.h"
#include "memory.h"
#include <main.h>
+1 -1
View File
@@ -12,7 +12,7 @@
#include "racing/memory.h"
#include "waypoints.h"
#include "render_player.h"
#include "collision.h"
#include "racing/collision.h"
#include "code_80057C60.h"
#include "code_80005FD0.h"
#include "main.h"
+7 -6
View File
@@ -4,22 +4,23 @@
#include <stubs.h>
#include "code_800029B0.h"
#include "TrackBrowser.h"
#include "engine/TrackBrowser.h"
#include "memory.h"
#include "waypoints.h"
#include "actors.h"
#include "racing/actors.h"
#include "actor_types.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "audio/external.h"
#include <defines.h>
#include "collision.h"
#include "racing/collision.h"
#include "memory.h"
#include "menu_items.h"
#include "skybox_and_splitscreen.h"
#include "racing/skybox_and_splitscreen.h"
#include "code_8006E9C0.h"
#include "spawn_players.h"
#include "replays.h"
#include "render_courses.h"
#include "racing/render_courses.h"
#include "racing/memory.h"
#include "main.h"
#include "courses/all_course_data.h"
#include "courses/all_course_packed.h"
+4 -4
View File
@@ -6,17 +6,17 @@
#include <align_asset_macro.h>
#include "code_80005FD0.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "code_800029B0.h"
#include "racing/memory.h"
#include "waypoints.h"
#include "camera.h"
#include "actors.h"
#include "actors_extended.h"
#include "racing/actors.h"
#include "racing/actors_extended.h"
#include "render_player.h"
#include "player_controller.h"
#include "update_objects.h"
#include "collision.h"
#include "racing/collision.h"
#include <actor_types.h>
#include "vehicles.h"
#include "render_objects.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#include <libultraship.h>
#include <macros.h>
#include <mk64.h>
#include "math_util.h"
#include "racing/math_util.h"
#include <common_structs.h>
#include "player_controller.h"
#include "effects.h"
+3 -3
View File
@@ -12,11 +12,11 @@
#include "camera.h"
#include "code_80057C60.h"
#include "main.h"
#include "actors.h"
#include "racing/actors.h"
#include "code_800029B0.h"
#include "racing/memory.h"
#include <defines.h>
#include "math_util.h"
#include "racing/math_util.h"
#include "math_util_2.h"
#include "code_80005FD0.h"
#include "render_player.h"
@@ -26,7 +26,7 @@
#include "code_80086E70.h"
#include "effects.h"
#include <assets/models/data_800E8700.h>
#include "skybox_and_splitscreen.h"
#include "racing/skybox_and_splitscreen.h"
#include <assets/models/common_data.h>
#include "audio/external.h"
#include "objects.h"
+2 -2
View File
@@ -6,11 +6,11 @@
#include "code_80086E70.h"
#include "camera.h"
#include "objects.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "math_util_2.h"
#include "racing/memory.h"
#include "update_objects.h"
#include "collision.h"
#include "racing/collision.h"
#include "audio/external.h"
#include "main.h"
#include "code_80057C60.h"
+2 -2
View File
@@ -3,8 +3,8 @@
#include "code_800029B0.h"
#include "code_80091440.h"
#include "camera.h"
#include "math_util.h"
#include "collision.h"
#include "racing/math_util.h"
#include "racing/collision.h"
void func_800914A0(void) {
D_80152308 = gPlayerOne->unk_006 + 7;
+1 -1
View File
@@ -7,7 +7,7 @@
#include "menu_items.h"
#include "memory.h"
#include "main.h"
#include "math_util.h"
#include "racing/math_util.h"
#include <stdlib.h>
Lights1 D_800E8680 = gdSPDefLights1(31, 31, 31, 255, 255, 255, 40, 40, 20);
+13 -13
View File
@@ -6,10 +6,10 @@
#define _VARIABLES_H_
// #include <actors_extended.h> does not work
#include <actors.h>
#include <racing/actors.h>
#include <camera.h>
#include <camera_junk.h>
#include <ceremony_and_credits.h>
#include <ending/camera_junk.h>
#include <ending/ceremony_and_credits.h>
#include <code_800029B0.h>
#include <animation.h>
#include <code_80005FD0.h>
@@ -25,26 +25,26 @@
#include <menu_items.h>
#include <code_800AF9B0.h>
#include <save.h>
#include <code_80280000.h>
#include <podium_ceremony_actors.h>
#include <code_80281780.h>
#include <code_80281C40.h>
#include <collision.h>
#include <ending/code_80280000.h>
#include <ending/podium_ceremony_actors.h>
#include <ending/code_80281780.h>
#include <ending/code_80281C40.h>
#include <racing/collision.h>
#include <assets/other/common_data.h>
#include <credits.h>
#include <ending/credits.h>
#include <assets/models/data_segment2.h>
#include <buffers.h>
#include <render_objects.h>
#include <kart_dma.h>
#include <main.h>
#include <math_util_2.h>
#include <math_util.h>
#include <racing/math_util.h>
#include <memory.h>
#include <menus.h>
#include <profiler.h>
#include <race_logic.h>
#include <render_courses.h>
#include <skybox_and_splitscreen.h>
#include <racing/race_logic.h>
#include <racing/render_courses.h>
#include <racing/skybox_and_splitscreen.h>
#include <spawn_players.h>
#include <replays.h>
#include <textures.h>
+1 -1
View File
@@ -5,7 +5,7 @@
#include <defines.h>
#include <sounds.h>
#include "code_800029B0.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "kart_attributes.h"
#include "waypoints.h"
#include "code_80005FD0.h"
+1 -1
View File
@@ -4,7 +4,7 @@
#include "camera_junk.h"
#include "camera.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "ceremony_and_credits.h"
#include "main.h"
+1 -1
View File
@@ -8,7 +8,7 @@
#include <macros.h>
#include <segments.h>
#include <common_structs.h>
#include "math_util.h"
#include "racing/math_util.h"
#include "ceremony_and_credits.h"
#include "code_800029B0.h"
#include "code_80280000.h"
+5 -4
View File
@@ -9,10 +9,10 @@
#include <code_800029B0.h>
#include "camera.h"
#include "memory.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "code_80280000.h"
#include "code_80281780.h"
#include "skybox_and_splitscreen.h"
#include "racing/skybox_and_splitscreen.h"
#include "menu_items.h"
#include "code_8006E9C0.h"
#include "code_800029B0.h"
@@ -20,11 +20,12 @@
#include "podium_ceremony_actors.h"
#include "code_80281C40.h"
#include "code_80057C60.h"
#include "actors.h"
#include "render_courses.h"
#include "racing/actors.h"
#include "racing/render_courses.h"
#include "main.h"
#include "render_player.h"
#include "engine/TrackBrowser.h"
#include <racing/memory.h>
#include "engine/tracks/Track.h"
#include "engine/Matrix.h"
+4 -3
View File
@@ -10,17 +10,18 @@
#include "camera.h"
#include "camera_junk.h"
#include "spawn_players.h"
#include "skybox_and_splitscreen.h"
#include "racing/skybox_and_splitscreen.h"
#include "code_8006E9C0.h"
#include "podium_ceremony_actors.h"
#include "code_80005FD0.h"
#include "collision.h"
#include "racing/collision.h"
#include "code_80281C40.h"
#include "code_800029B0.h"
#include "menu_items.h"
#include "main.h"
#include "menus.h"
#include "render_courses.h"
#include "racing/render_courses.h"
#include "racing/memory.h"
#include <string.h>
#include "port/Game.h"
+2 -2
View File
@@ -3,9 +3,9 @@
#include "code_80281C40.h"
#include "main.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "models/tracks/royal_raceway/royal_raceway_displaylists.h"
#include "skybox_and_splitscreen.h"
#include "racing/skybox_and_splitscreen.h"
#include "render_objects.h"
#include "code_80057C60.h"
#include "menu_items.h"
+2 -1
View File
@@ -8,6 +8,7 @@
#include "main.h"
#include "memory.h"
#include <assets/models/common_data.h>
#include "racing/memory.h"
#include "render_player.h"
#include "render_objects.h"
#include "podium_ceremony_actors.h"
@@ -16,7 +17,7 @@
#include "code_80057C60.h"
#include "code_80005FD0.h"
#include "code_80281C40.h"
#include "math_util.h"
#include "racing/math_util.h"
#include <string.h>
#include "port/interpolation/FrameInterpolation.h"
+1 -1
View File
@@ -7,7 +7,7 @@
#include "engine/editor/Collision.h"
extern "C" {
#include "math_util.h"
#include "racing/math_util.h"
}
AActor::AActor() {}
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include <vector>
#include "Object.h"
#include "objects/Object.h"
#include "World.h"
+3 -3
View File
@@ -9,14 +9,14 @@
extern "C" {
#include "main.h"
#include "memory.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "courses/harbour/track.h"
#include "courses/harbour/powered.h"
#include "courses/harbour/ship2_model.h"
#include "courses/harbour/ship3_model.h"
#include "collision.h"
#include "racing/collision.h"
#include "menu_items.h"
#include "external.h"
#include "audio/external.h"
#include "menus.h"
extern Gfx ship1_spag1_mesh[];
}
+1 -1
View File
@@ -5,7 +5,7 @@
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "math_util_2.h"
}
+1 -1
View File
@@ -8,7 +8,7 @@
#include "engine/RandomItemTable.h"
extern "C" {
#include "render_courses.h"
#include "racing/render_courses.h"
}
RaceManager::RaceManager(World& world) : WorldContext(world) {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "port/Game.h"
extern "C" {
#include "math_util.h"
#include "racing/math_util.h"
}
RandomItemTable::RandomItemTable() {
+1 -1
View File
@@ -4,7 +4,7 @@
extern "C" {
#include "main.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "math_util_2.h"
}
+1 -1
View File
@@ -5,7 +5,7 @@
#include "port/interpolation/FrameInterpolation.h"
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "assets/models/tracks/bowsers_castle/bowsers_castle_data.h"
#include "assets/models/tracks/bowsers_castle/bowsers_castle_displaylists.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "engine/Actor.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
extern "C" {
#include "common_structs.h"
+3 -3
View File
@@ -8,9 +8,9 @@
extern "C" {
#include "macros.h"
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "actor_types.h"
#include "actors.h"
#include "racing/actors.h"
#include "assets/textures/other_textures.h"
extern f32 gKartHopInitialVelocityTable[];
extern f32 gKartGravityTable[];
@@ -209,4 +209,4 @@ void ACloud::DrawEditorProperties() {
if (ImGui::Button(ICON_FA_UNDO "##ResetSpeedB")) {
Gravity = 0.0f;
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
#include <libultraship.h>
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
extern "C" {
#include "camera.h"
+4 -4
View File
@@ -1,7 +1,7 @@
#include "FallingRock.h"
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include <assets/textures/tracks/choco_mountain/choco_mountain_data.h>
#include <assets/models/tracks/choco_mountain/choco_mountain_data.h>
#include "port/interpolation/FrameInterpolation.h"
@@ -9,13 +9,13 @@
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "actor_types.h"
#include "code_800029B0.h"
#include "collision.h"
#include "racing/collision.h"
#include "code_800029B0.h"
#include "external.h"
#include "audio/external.h"
}
size_t AFallingRock::_count = 0;
+1 -1
View File
@@ -3,7 +3,7 @@
#include <libultraship.h>
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/SpawnParams.h"
#include "engine/CoreMath.h"
+4 -4
View File
@@ -1,10 +1,10 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "Finishline.h"
#include "engine/Actor.h"
#include "World.h"
#include "engine/World.h"
#include "assets/models/common_data.h"
#include "src/port/Game.h"
#include "port/interpolation/FrameInterpolation.h"
@@ -12,9 +12,9 @@
extern "C" {
#include "macros.h"
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "actor_types.h"
#include "actors.h"
#include "racing/actors.h"
extern f32 gKartHopInitialVelocityTable[];
extern f32 gKartGravityTable[];
}
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <libultraship.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
+3 -3
View File
@@ -3,15 +3,15 @@
#include <libultra/gbi.h>
#include <assets/models/tracks/mario_raceway/mario_raceway_data.h>
#include "port/interpolation/FrameInterpolation.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "actor_types.h"
#include "code_800029B0.h"
#include "collision.h"
#include "racing/collision.h"
}
size_t AMarioSign::_count = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include "engine/Actor.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/World.h"
#include "engine/registry/RegisterContent.h"
+3 -3
View File
@@ -1,13 +1,13 @@
#include "Ship.h"
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "port/Game.h"
#include "Matrix.h"
#include "engine/Matrix.h"
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "courses/harbour/ghostship_model.h"
#include "courses/harbour/ship2_model.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
+2 -2
View File
@@ -1,11 +1,11 @@
#include "SpaghettiShip.h"
#include <libultra/gbi.h>
#include "Matrix.h"
#include "engine/Matrix.h"
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "courses/harbour/ship_model.h"
}
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "engine/World.h"
+2 -2
View File
@@ -1,12 +1,12 @@
#include "Starship.h"
#include <libultra/gbi.h>
#include "Matrix.h"
#include "engine/Matrix.h"
#include "port/Game.h"
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "courses/harbour/starship_model.h"
}
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include <libultra/gbi.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "engine/World.h"
+1 -1
View File
@@ -14,7 +14,7 @@ extern "C" {
#include "menu_items.h"
#include "assets/models/data_segment2.h"
#include "render_player.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "assets/textures/texture_data_2.h"
#include "render_objects.h"
#include "common_structs.h"
+2 -2
View File
@@ -4,9 +4,9 @@
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "actors.h"
#include "racing/actors.h"
}
ATree::ATree(Vec3f pos, Gfx* displaylist, f32 drawDistance, f32 minDrawDistance, const char* tlut = nullptr) {
+2 -2
View File
@@ -6,11 +6,11 @@
extern "C" {
#include "common_structs.h"
#include "math_util.h"
#include "racing/math_util.h"
#include "main.h"
#include "actor_types.h"
#include "code_800029B0.h"
#include "collision.h"
#include "racing/collision.h"
}
size_t AWarioSign::_count = 0;
+1 -1
View File
@@ -3,7 +3,7 @@
#include <libultraship.h>
#include "engine/registry/RegisterContent.h"
#include "engine/Actor.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
class AWarioSign : public AActor {
public:
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include <libultraship.h>
#include "CoreMath.h"
#include "engine/CoreMath.h"
extern "C" {
#include "camera.h"
+3 -3
View File
@@ -11,11 +11,11 @@ extern "C" {
#include "main.h"
#include "camera.h"
#include "code_800029B0.h"
#include "ceremony_and_credits.h"
#include "ending/ceremony_and_credits.h"
#include "common_structs.h"
#include "spawn_players.h"
#include "math_util.h"
#include "external.h"
#include "racing/math_util.h"
#include "audio/external.h"
}
TourCamera::TourCamera(FVector pos, s16 rot, u32 mode) : GameCamera() {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <libultraship.h>
#include "GameCamera.h"
#include "CoreMath.h"
#include "engine/CoreMath.h"
extern "C" {
#include "camera.h"

Some files were not shown because too many files have changed in this diff Show More