mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-26 12:01:43 +00:00
Merge remote-tracking branch 'upstream/dev' into pty
This commit is contained in:
commit
1f184c360b
238 changed files with 4141 additions and 2669 deletions
57
.github/workflows/build-coop.yaml
vendored
57
.github/workflows/build-coop.yaml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
cd tools
|
||||
g++ -std=c++17 -o hash_file hash_file.cpp
|
||||
echo "::notice ::$(./hash_file ../build/us_pc/sm64coopdx)"
|
||||
|
||||
|
||||
- name: Zip the game
|
||||
run: |
|
||||
cd ./build/us_pc
|
||||
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
with:
|
||||
name: sm64coopdx-linux
|
||||
path: ./build/us_pc/sm64coopdx_Linux.zip
|
||||
|
||||
|
||||
build-steamos:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[build]') }}
|
||||
runs-on: ubuntu-22.04
|
||||
|
|
@ -58,7 +58,7 @@ jobs:
|
|||
cd tools
|
||||
g++ -std=c++17 -o hash_file hash_file.cpp
|
||||
echo "::notice ::$(./hash_file ../build/us_pc/sm64coopdx)"
|
||||
|
||||
|
||||
- name: Zip the game
|
||||
run: |
|
||||
cd ./build/us_pc
|
||||
|
|
@ -108,7 +108,7 @@ jobs:
|
|||
cd tools
|
||||
g++ -std=c++17 -o hash_file.exe hash_file.cpp
|
||||
echo "::notice ::$(./hash_file.exe ../build/us_pc/sm64coopdx.exe)"
|
||||
|
||||
|
||||
- name: Zip the game
|
||||
run: |
|
||||
cd ./build/us_pc
|
||||
|
|
@ -158,7 +158,7 @@ jobs:
|
|||
cd tools
|
||||
g++ -std=c++17 -o hash_file.exe hash_file.cpp
|
||||
echo "::notice ::$(./hash_file.exe ../build/us_pc/sm64coopdx.exe)"
|
||||
|
||||
|
||||
- name: Zip the game
|
||||
run: |
|
||||
cd ./build/us_pc
|
||||
|
|
@ -172,17 +172,36 @@ jobs:
|
|||
|
||||
build-macos-arm:
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[build]') }}
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-26
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install make mingw-w64 sdl2 pkg-config glew glfw3 coreutils
|
||||
brew install make mingw-w64 pkg-config glfw3 coreutils
|
||||
|
||||
- name: Compile glew
|
||||
run: |
|
||||
export MACOSX_DEPLOYMENT_TARGET=11
|
||||
curl -L -o glew.tar.gz https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz
|
||||
tar -xzf glew.tar.gz
|
||||
cd glew-2.2.0
|
||||
make SYSTEM=darwin CC="clang -arch arm64 -mmacosx-version-min=11" GLEW_PREFIX=/opt/homebrew GLEW_DEST=/opt/homebrew
|
||||
make install GLEW_PREFIX=/opt/homebrew GLEW_DEST=/opt/homebrew
|
||||
|
||||
- name: Compile SDL2
|
||||
run: |
|
||||
curl -L -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.tar.gz
|
||||
tar -xzf SDL2.tar.gz
|
||||
cd SDL2-2.30.9
|
||||
./configure --prefix=/opt/homebrew CC="clang -arch arm64 -mmacosx-version-min=11"
|
||||
make -j$(sysctl -n hw.ncpu)
|
||||
make install
|
||||
|
||||
- name: Build the game
|
||||
run: |
|
||||
export PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||
gmake OSX_BUILD=1 -j$(sysctl -n hw.ncpu)
|
||||
|
||||
- name: Code sign the app (Ad-Hoc)
|
||||
|
|
@ -199,7 +218,7 @@ jobs:
|
|||
run: |
|
||||
cd ./build/us_pc
|
||||
zip -r sm64coopdx_macOS_ARM.zip sm64coopdx.app
|
||||
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
|
@ -215,7 +234,25 @@ jobs:
|
|||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install make mingw-w64 gcc@9 sdl2 pkg-config glew glfw3 coreutils
|
||||
brew install make mingw-w64 gcc@9 pkg-config glfw3 coreutils
|
||||
|
||||
- name: Compile glew
|
||||
run: |
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||
curl -L -o glew.tar.gz https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz
|
||||
tar -xzf glew.tar.gz
|
||||
cd glew-2.2.0
|
||||
make SYSTEM=darwin CC="clang -arch x86_64 -mmacosx-version-min=10.15"
|
||||
make install
|
||||
|
||||
- name: Compile SDL2
|
||||
run: |
|
||||
curl -L -o SDL2.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.tar.gz
|
||||
tar -xzf SDL2.tar.gz
|
||||
cd SDL2-2.30.9
|
||||
./configure --prefix=/usr/local CC="clang -arch x86_64 -mmacosx-version-min=10.15"
|
||||
make -j$(sysctl -n hw.ncpu)
|
||||
make install
|
||||
|
||||
- name: Build the game
|
||||
run: |
|
||||
|
|
@ -235,7 +272,7 @@ jobs:
|
|||
run: |
|
||||
cd ./build/us_pc
|
||||
zip -r sm64coopdx_macOS_Intel.zip sm64coopdx.app
|
||||
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
|
|
|||
31
Makefile
31
Makefile
|
|
@ -64,12 +64,7 @@ ICON ?= 1
|
|||
# Use .app (for macOS)
|
||||
USE_APP ?= 1
|
||||
# Minimum macOS Version
|
||||
# If our arch is arm, set to macOS 14
|
||||
ifeq ($(shell arch),arm64)
|
||||
MIN_MACOS_VERSION ?= 14
|
||||
else
|
||||
MIN_MACOS_VERSION ?= 10.15
|
||||
endif
|
||||
MIN_MACOS_VERSION ?= 11
|
||||
# Make some small adjustments for handheld devices
|
||||
HANDHELD ?= 0
|
||||
|
||||
|
|
@ -1575,15 +1570,15 @@ endif
|
|||
# with no prerequisites, .SECONDARY causes no intermediate target to be removed
|
||||
.SECONDARY:
|
||||
|
||||
# Handle end of macOS compilation
|
||||
APP_DIR = ./sm64coopdx.app
|
||||
APP_CONTENTS_DIR = $(APP_DIR)/Contents
|
||||
APP_MACOS_DIR = $(APP_CONTENTS_DIR)/MacOS
|
||||
APP_RESOURCES_DIR = $(APP_CONTENTS_DIR)/Resources
|
||||
|
||||
|
||||
ifeq ($(OSX_BUILD),1)
|
||||
GLEW_LIB := $(shell find $(BREW_PREFIX)/Cellar/glew | grep libGLEW.2.2.0 | sort -n | uniq)
|
||||
SDL2_LIB := $(shell find $(BREW_PREFIX)/Cellar/sdl2 | grep libSDL2- | sort -n | uniq)
|
||||
GLEW_LIB := $(shell find $(BREW_PREFIX)/lib/ | grep libGLEW.2.2.0 | sort -n | uniq)
|
||||
SDL2_LIB := $(shell find $(BREW_PREFIX)/lib/ | grep libSDL2- | sort -n | uniq)
|
||||
endif
|
||||
|
||||
all:
|
||||
|
|
@ -1605,14 +1600,20 @@ all:
|
|||
cp build/us_pc/libcoopnet.dylib $(APP_MACOS_DIR); \
|
||||
cp build/us_pc/libjuice.1.6.2.dylib $(APP_MACOS_DIR); \
|
||||
cp $(SDL2_LIB) $(APP_MACOS_DIR)/libSDL2.dylib; \
|
||||
install_name_tool -change $(BREW_PREFIX)/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx; > /dev/null 2>&1 \
|
||||
install_name_tool -id @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/libSDL2.dylib; > /dev/null 2>&1 \
|
||||
install_name_tool -change $(BREW_PREFIX)/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \
|
||||
install_name_tool -change $(BREW_PREFIX)/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \
|
||||
install_name_tool -id @executable_path/libSDL2.dylib $(APP_MACOS_DIR)/libSDL2.dylib > /dev/null 2>&1; \
|
||||
codesign --force --deep --sign - $(APP_MACOS_DIR)/libSDL2.dylib; \
|
||||
cp $(GLEW_LIB) $(APP_MACOS_DIR)/libGLEW.dylib; \
|
||||
install_name_tool -change $(BREW_PREFIX)/opt/glew/lib/libGLEW.2.2.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx; > /dev/null 2>&1 \
|
||||
install_name_tool -id @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/libGLEW.dylib; > /dev/null 2>&1 \
|
||||
install_name_tool -change $(BREW_PREFIX)/lib/libGLEW.2.2.0.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \
|
||||
install_name_tool -change $(BREW_PREFIX)/opt/glew/lib/libGLEW.2.2.0.dylib @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/sm64coopdx > /dev/null 2>&1; \
|
||||
install_name_tool -id @executable_path/libGLEW.dylib $(APP_MACOS_DIR)/libGLEW.dylib > /dev/null 2>&1; \
|
||||
codesign --force --deep --sign - $(APP_MACOS_DIR)/libGLEW.dylib; \
|
||||
cp res/icon.icns $(APP_RESOURCES_DIR)/icon.icns; \
|
||||
mkdir res/build; \
|
||||
xcrun actool res/icon.icon --compile res/build --app-icon icon --output-partial-info-plist res/build/Info.plist --minimum-deployment-target $(MIN_MACOS_VERSION) --platform macosx > /dev/null 2>&1; \
|
||||
mv res/build/Assets.car $(APP_RESOURCES_DIR)/; \
|
||||
cp res/icon.icns $(APP_RESOURCES_DIR)/; \
|
||||
rm -rf res/build; \
|
||||
echo "APPL????" > $(APP_CONTENTS_DIR)/PkgInfo; \
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' > $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
|
|
@ -1623,7 +1624,7 @@ all:
|
|||
echo ' <key>CFBundleIconFile</key>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <string>icon</string>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <key>CFBundleIconName</key>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <string>AppIcon</string>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <string>icon</string>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <key>CFBundleDisplayName</key>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <string>sm64coopdx</string>' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
echo ' <!-- Add other keys and values here -->' >> $(APP_CONTENTS_DIR)/Info.plist; \
|
||||
|
|
|
|||
|
|
@ -535,6 +535,8 @@ def def_constant(fname, processed_constant, skip_constant):
|
|||
continue
|
||||
if '"' in c[1]:
|
||||
s += '\n--- @type string\n'
|
||||
elif "." in c[1]:
|
||||
s += '\n--- @type number\n'
|
||||
else:
|
||||
s += '\n--- @type integer\n'
|
||||
s += '%s = %s\n' % (c[0], c[1])
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ in_files = [
|
|||
"src/audio/seqplayer.h",
|
||||
"src/engine/lighting_engine.h",
|
||||
"src/pc/network/sync_object.h",
|
||||
"src/audio/load.h",
|
||||
]
|
||||
|
||||
override_allowed_functions = {
|
||||
|
|
@ -99,6 +100,7 @@ override_allowed_functions = {
|
|||
"src/game/ingame_menu.h": [ "set_min_dialog_width", "set_dialog_override_pos", "reset_dialog_override_pos", "set_dialog_override_color", "reset_dialog_override_color", "set_menu_mode", "create_dialog_box", "create_dialog_box_with_var", "create_dialog_inverted_box", "create_dialog_box_with_response", "reset_dialog_render_state", "set_dialog_box_state", "handle_special_dialog_text" ],
|
||||
"src/audio/seqplayer.h": [ "sequence_player_set_tempo", "sequence_player_set_tempo_acc", "sequence_player_set_transposition", "sequence_player_get_tempo", "sequence_player_get_tempo_acc", "sequence_player_get_transposition", "sequence_player_get_volume", "sequence_player_get_fade_volume", "sequence_player_get_mute_volume_scale" ],
|
||||
"src/pc/network/sync_object.h": [ "sync_object_is_initialized", "sync_object_is_owned_locally", "sync_object_get_object" ],
|
||||
"src/audio/load.h": [ "set_sound_bank_override" ],
|
||||
}
|
||||
|
||||
override_disallowed_functions = {
|
||||
|
|
@ -120,14 +122,14 @@ override_disallowed_functions = {
|
|||
"src/game/sound_init.h": [ "_loop_", "thread4_", "set_sound_mode" ],
|
||||
"src/pc/network/network_utils.h": [ "network_get_player_text_color[^_]" ],
|
||||
"src/pc/network/network_player.h": [ "_init", "_connected[^_]", "_shutdown", "_disconnected", "_update", "construct_player_popup", "network_player_name_valid" ],
|
||||
"src/game/object_helpers.c": [ "spawn_obj", "^bhv_", "abs[fi]", "^bit_shift", "_debug$", "^stub_", "_set_model", "cur_obj_set_direction_table", "cur_obj_progress_direction_table" ],
|
||||
"src/game/obj_behaviors.c": [ "debug_", "turn_obj_away_from_surface" ],
|
||||
"src/game/object_helpers.c": [ "spawn_obj", "^bhv_", "geo_", "abs[fi]", "^bit_shift", "_debug$", "^stub_", "_set_model", "cur_obj_set_direction_table", "cur_obj_progress_direction_table" ],
|
||||
"src/game/obj_behaviors.c": [ "debug_", "geo_", "turn_obj_away_from_surface"],
|
||||
"src/game/obj_behaviors_2.c": [ "wiggler_jumped_on_attack_handler", "huge_goomba_weakly_attacked" ],
|
||||
"src/game/spawn_sound.h": [ "exec_anim_sound_state" ],
|
||||
"src/game/level_info.h": [ "_name_table", "convert_string_" ],
|
||||
"src/pc/lua/utils/smlua_obj_utils.h": [ "spawn_object_remember_field" ],
|
||||
"src/game/camera.h": [ "update_camera", "init_camera", "stub_camera", "^reset_camera", "move_point_along_spline", "romhack_camera_init_settings", "romhack_camera_reset_settings" ],
|
||||
"src/game/behavior_actions.h": [ "bhv_dust_smoke_loop", "bhv_init_room" ],
|
||||
"src/game/camera.h": [ "geo_", "update_camera", "init_camera", "stub_camera", "^reset_camera", "move_point_along_spline", "romhack_camera_init_settings", "romhack_camera_reset_settings" ],
|
||||
"src/game/behavior_actions.h": [ "bhv_dust_smoke_loop", "bhv_init_room", "geo_" ],
|
||||
"src/pc/lua/utils/smlua_audio_utils.h": [ "smlua_audio_utils_override", "audio_custom_shutdown", "smlua_audio_custom_deinit", "audio_sample_destroy_pending_copies", "audio_custom_update_volume" ],
|
||||
"src/pc/lua/utils/smlua_level_utils.h": [ "smlua_level_util_reset" ],
|
||||
"src/pc/lua/utils/smlua_text_utils.h": [ "smlua_text_utils_init", "smlua_text_utils_shutdown", "smlua_text_utils_dialog_get_unmodified"],
|
||||
|
|
@ -825,7 +827,7 @@ def build_param(fid, param, i):
|
|||
lot = translate_type_to_lot(ptype)
|
||||
s = ' %s %s = (%s)smlua_to_cobject(L, %d, %s);' % (ptype, pid, ptype, i, lot)
|
||||
|
||||
if '???' in lot or "GRAPHNODE" in lot:
|
||||
if '???' in lot:
|
||||
s = '//' + s + ' <--- UNIMPLEMENTED'
|
||||
else:
|
||||
s = ' ' + s
|
||||
|
|
@ -949,7 +951,7 @@ def build_function(function, do_extern):
|
|||
sparam = build_param(fid, param, i)
|
||||
param_var, param_value = sparam.split('=')
|
||||
param_type = param_var.replace(pid, '').strip()
|
||||
s += ' %s = (%s) NULL;\n' % (param_var.strip(), param_type)
|
||||
s += ' %s = (%s) %s;\n' % (param_var.strip(), param_type, "NULL" if '*' in param_type else "0")
|
||||
s += ' if (top >= %d) {\n' % (i)
|
||||
s += ' %s = %s\n' % (pid, param_value.strip())
|
||||
s += ' if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %%u for function \'%%s\'", %d, "%s"); return 0; }\n' % (i, fid)
|
||||
|
|
@ -1340,7 +1342,7 @@ def doc_function(fname, function):
|
|||
s += '- None\n'
|
||||
|
||||
s += '\n### Returns\n'
|
||||
if rtype != None:
|
||||
if len(rvalues) > 0:
|
||||
for _, ptype, plink in rvalues:
|
||||
if plink:
|
||||
s += '- [%s](%s)\n' % (ptype, plink)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ SMLUA_CALL_EVENT_HOOKS_SET_HOOK_RESULT = """
|
|||
SMLUA_CALL_EVENT_HOOKS_CALLBACK = """
|
||||
// call the callback
|
||||
if (0 != smlua_call_hook(L, {n_inputs}, {n_outputs}, 0, hook->mod[i], hook->modFile[i])) {{
|
||||
LOG_LUA("Failed to call the callback for hook %s", sLuaHookedEventTypeName[{hook_type}]);
|
||||
LOG_LUA("Failed to call the callback for hook %s - '%s/%s'", sLuaHookedEventTypeName[{hook_type}], hook->mod[i]->relativePath, hook->modFile[i]->relativePath);
|
||||
continue;
|
||||
}}{set_hook_result}
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -306,6 +306,49 @@ IN_OUT_BOUNCE = function (x) return x < 0.5 and (1 - OUT_BOUNCE(1 - 2 * x)) / 2
|
|||
---@return number
|
||||
OUT_IN_BOUNCE = function (x) return x < 0.5 and 0.5 * OUT_BOUNCE(x * 2) or 0.5 + 0.5 * IN_BOUNCE(2 * x - 1) end
|
||||
|
||||
--- @alias EasingFunction
|
||||
--- | `IN_SINE`
|
||||
--- | `OUT_SINE`
|
||||
--- | `IN_OUT_SINE`
|
||||
--- | `OUT_IN_SINE`
|
||||
--- | `IN_QUAD`
|
||||
--- | `OUT_QUAD`
|
||||
--- | `IN_OUT_QUAD`
|
||||
--- | `OUT_IN_QUAD`
|
||||
--- | `IN_CUBIC`
|
||||
--- | `OUT_CUBIC`
|
||||
--- | `IN_OUT_CUBIC`
|
||||
--- | `OUT_IN_CUBIC`
|
||||
--- | `IN_QUART`
|
||||
--- | `OUT_QUART`
|
||||
--- | `IN_OUT_QUART`
|
||||
--- | `OUT_IN_QUART`
|
||||
--- | `IN_QUINT`
|
||||
--- | `OUT_QUINT`
|
||||
--- | `IN_OUT_QUINT`
|
||||
--- | `OUT_IN_QUINT`
|
||||
--- | `IN_EXPO`
|
||||
--- | `OUT_EXPO`
|
||||
--- | `IN_OUT_EXPO`
|
||||
--- | `OUT_IN_EXPO`
|
||||
--- | `IN_CIRC`
|
||||
--- | `OUT_CIRC`
|
||||
--- | `IN_OUT_CIRC`
|
||||
--- | `OUT_IN_CIRC`
|
||||
--- | `IN_BACK`
|
||||
--- | `OUT_BACK`
|
||||
--- | `IN_OUT_BACK`
|
||||
--- | `OUT_IN_BACK`
|
||||
--- | `IN_ELASTIC`
|
||||
--- | `OUT_ELASTIC`
|
||||
--- | `IN_OUT_ELASTIC`
|
||||
--- | `OUT_IN_ELASTIC`
|
||||
--- | `IN_BOUNCE`
|
||||
--- | `OUT_BOUNCE`
|
||||
--- | `IN_OUT_BOUNCE`
|
||||
--- | `OUT_IN_BOUNCE`
|
||||
--- | fun(x: number): number
|
||||
|
||||
--------------------
|
||||
-- math functions --
|
||||
--------------------
|
||||
|
|
@ -385,7 +428,7 @@ function math.round(x)
|
|||
return x > 0 and __math_floor(x + 0.5) or __math_ceil(x - 0.5)
|
||||
end
|
||||
|
||||
--- @param t function | number
|
||||
--- @param t EasingFunction | number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param x number
|
||||
|
|
|
|||
|
|
@ -308,6 +308,49 @@ IN_OUT_BOUNCE = function (x) return x < 0.5 and (1 - OUT_BOUNCE(1 - 2 * x)) / 2
|
|||
---@return number
|
||||
OUT_IN_BOUNCE = function (x) return x < 0.5 and 0.5 * OUT_BOUNCE(x * 2) or 0.5 + 0.5 * IN_BOUNCE(2 * x - 1) end
|
||||
|
||||
--- @alias EasingFunction
|
||||
--- | `IN_SINE`
|
||||
--- | `OUT_SINE`
|
||||
--- | `IN_OUT_SINE`
|
||||
--- | `OUT_IN_SINE`
|
||||
--- | `IN_QUAD`
|
||||
--- | `OUT_QUAD`
|
||||
--- | `IN_OUT_QUAD`
|
||||
--- | `OUT_IN_QUAD`
|
||||
--- | `IN_CUBIC`
|
||||
--- | `OUT_CUBIC`
|
||||
--- | `IN_OUT_CUBIC`
|
||||
--- | `OUT_IN_CUBIC`
|
||||
--- | `IN_QUART`
|
||||
--- | `OUT_QUART`
|
||||
--- | `IN_OUT_QUART`
|
||||
--- | `OUT_IN_QUART`
|
||||
--- | `IN_QUINT`
|
||||
--- | `OUT_QUINT`
|
||||
--- | `IN_OUT_QUINT`
|
||||
--- | `OUT_IN_QUINT`
|
||||
--- | `IN_EXPO`
|
||||
--- | `OUT_EXPO`
|
||||
--- | `IN_OUT_EXPO`
|
||||
--- | `OUT_IN_EXPO`
|
||||
--- | `IN_CIRC`
|
||||
--- | `OUT_CIRC`
|
||||
--- | `IN_OUT_CIRC`
|
||||
--- | `OUT_IN_CIRC`
|
||||
--- | `IN_BACK`
|
||||
--- | `OUT_BACK`
|
||||
--- | `IN_OUT_BACK`
|
||||
--- | `OUT_IN_BACK`
|
||||
--- | `IN_ELASTIC`
|
||||
--- | `OUT_ELASTIC`
|
||||
--- | `IN_OUT_ELASTIC`
|
||||
--- | `OUT_IN_ELASTIC`
|
||||
--- | `IN_BOUNCE`
|
||||
--- | `OUT_BOUNCE`
|
||||
--- | `IN_OUT_BOUNCE`
|
||||
--- | `OUT_IN_BOUNCE`
|
||||
--- | fun(x: number): number
|
||||
|
||||
--------------------
|
||||
-- math functions --
|
||||
--------------------
|
||||
|
|
@ -387,7 +430,7 @@ function math.round(x)
|
|||
return x > 0 and __math_floor(x + 0.5) or __math_ceil(x - 0.5)
|
||||
end
|
||||
|
||||
--- @param t function | number
|
||||
--- @param t EasingFunction | number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param x number
|
||||
|
|
@ -2717,6 +2760,42 @@ CONSOLE_MESSAGE_ERROR = 2 --- @type ConsoleMessageLevel
|
|||
--- | `CONSOLE_MESSAGE_WARNING`
|
||||
--- | `CONSOLE_MESSAGE_ERROR`
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_X_LEFT = 0.0
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_X_CENTER = 0.5
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_X_RIGHT = 1.0
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_Y_TOP = 0.0
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_Y_CENTER = 0.5
|
||||
|
||||
--- @type number
|
||||
ROTATION_PIVOT_Y_BOTTOM = 1.0
|
||||
|
||||
--- @type number
|
||||
TEXT_HALIGN_LEFT = 0.0
|
||||
|
||||
--- @type number
|
||||
TEXT_HALIGN_CENTER = 0.5
|
||||
|
||||
--- @type number
|
||||
TEXT_HALIGN_RIGHT = 1.0
|
||||
|
||||
--- @type number
|
||||
TEXT_VALIGN_TOP = 0.0
|
||||
|
||||
--- @type number
|
||||
TEXT_VALIGN_CENTER = 0.5
|
||||
|
||||
--- @type number
|
||||
TEXT_VALIGN_BOTTOM = 1.0
|
||||
|
||||
RESOLUTION_DJUI = 0 --- @type HudUtilsResolution
|
||||
RESOLUTION_N64 = 1 --- @type HudUtilsResolution
|
||||
RESOLUTION_COUNT = 2 --- @type HudUtilsResolution
|
||||
|
|
@ -2735,16 +2814,18 @@ FILTER_COUNT = 2 --- @type HudUtilsFilter
|
|||
--- | `FILTER_LINEAR`
|
||||
--- | `FILTER_COUNT`
|
||||
|
||||
FONT_NORMAL = 0 --- @type DjuiFontType
|
||||
FONT_MENU = 1 --- @type DjuiFontType
|
||||
FONT_HUD = 2 --- @type DjuiFontType
|
||||
FONT_ALIASED = 3 --- @type DjuiFontType
|
||||
FONT_CUSTOM_HUD = 4 --- @type DjuiFontType
|
||||
FONT_RECOLOR_HUD = 5 --- @type DjuiFontType
|
||||
FONT_SPECIAL = 6 --- @type DjuiFontType
|
||||
FONT_COUNT = 7 --- @type DjuiFontType
|
||||
FONT_LEGACY = -1 --- @type DjuiFontType
|
||||
FONT_NORMAL = 0 --- @type DjuiFontType
|
||||
FONT_MENU = 1 --- @type DjuiFontType
|
||||
FONT_HUD = 2 --- @type DjuiFontType
|
||||
FONT_ALIASED = 3 --- @type DjuiFontType
|
||||
FONT_CUSTOM_HUD = 4 --- @type DjuiFontType
|
||||
FONT_RECOLOR_HUD = 5 --- @type DjuiFontType
|
||||
FONT_SPECIAL = 6 --- @type DjuiFontType
|
||||
FONT_COUNT = 7 --- @type DjuiFontType
|
||||
|
||||
--- @alias DjuiFontType
|
||||
--- | `FONT_LEGACY`
|
||||
--- | `FONT_NORMAL`
|
||||
--- | `FONT_MENU`
|
||||
--- | `FONT_HUD`
|
||||
|
|
@ -3276,7 +3357,7 @@ PVP_ATTACK_KNOCKBACK_TIMER_DEFAULT = 10
|
|||
PVP_ATTACK_KNOCKBACK_TIMER_OVERRIDE = -5
|
||||
|
||||
--- @type integer
|
||||
PVP_ATTACK_OVERRIDE_VANILLA_INVINCIBILITY = 0x0000FFFF
|
||||
PVP_ATTACK_KNOCKBACK_ACTION_ARG = 0x10000
|
||||
|
||||
--- @type integer
|
||||
INT_STATUS_ATTACK_MASK = 0x000000FF
|
||||
|
|
@ -3635,7 +3716,7 @@ HUD_DISPLAY_DEFAULT = HUD_DISPLAY_FLAG_LIVES | HUD_DISPLAY_FLAG_CO
|
|||
--- | `HUD_DISPLAY_DEFAULT`
|
||||
|
||||
--- @type integer
|
||||
LE_MAX_LIGHTS = 512
|
||||
LE_MAX_LIGHTS = 1024
|
||||
|
||||
LE_MODE_AFFECT_ALL_SHADED_AND_COLORED = 0 --- @type LEMode
|
||||
LE_MODE_AFFECT_ALL_SHADED = 1 --- @type LEMode
|
||||
|
|
@ -8126,7 +8207,13 @@ HOOK_MARIO_OVERRIDE_FLOOR_CLASS = 56 --- @type LuaHookedEventType
|
|||
HOOK_ON_ADD_SURFACE = 57 --- @type LuaHookedEventType
|
||||
HOOK_ON_CLEAR_AREAS = 58 --- @type LuaHookedEventType
|
||||
HOOK_ON_PACKET_BYTESTRING_RECEIVE = 59 --- @type LuaHookedEventType
|
||||
HOOK_MAX = 60 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_WALL_COLLISION = 60 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_CEIL = 61 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_FLOOR = 62 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_WATER_LEVEL = 63 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_POISON_GAS_LEVEL = 64 --- @type LuaHookedEventType
|
||||
HOOK_ON_FIND_SURFACE_ON_RAY = 65 --- @type LuaHookedEventType
|
||||
HOOK_MAX = 66 --- @type LuaHookedEventType
|
||||
|
||||
--- @alias LuaHookedEventType
|
||||
--- | `HOOK_UPDATE`
|
||||
|
|
@ -8189,8 +8276,17 @@ HOOK_MAX = 60 --- @type LuaHookedEventType
|
|||
--- | `HOOK_ON_ADD_SURFACE`
|
||||
--- | `HOOK_ON_CLEAR_AREAS`
|
||||
--- | `HOOK_ON_PACKET_BYTESTRING_RECEIVE`
|
||||
--- | `HOOK_ON_FIND_WALL_COLLISION`
|
||||
--- | `HOOK_ON_FIND_CEIL`
|
||||
--- | `HOOK_ON_FIND_FLOOR`
|
||||
--- | `HOOK_ON_FIND_WATER_LEVEL`
|
||||
--- | `HOOK_ON_FIND_POISON_GAS_LEVEL`
|
||||
--- | `HOOK_ON_FIND_SURFACE_ON_RAY`
|
||||
--- | `HOOK_MAX`
|
||||
|
||||
--- @type integer
|
||||
MAX_HOOKED_BEHAVIORS = 1024
|
||||
|
||||
HUD_DISPLAY_LIVES = 0 --- @type HudDisplayValue
|
||||
HUD_DISPLAY_COINS = 1 --- @type HudDisplayValue
|
||||
HUD_DISPLAY_STARS = 2 --- @type HudDisplayValue
|
||||
|
|
@ -11170,7 +11266,7 @@ COOP_OBJ_FLAG_NON_SYNC = (1 << 2)
|
|||
COOP_OBJ_FLAG_INITIALIZED = (1 << 3)
|
||||
|
||||
--- @type string
|
||||
SM64COOPDX_VERSION = "v1.4.1"
|
||||
SM64COOPDX_VERSION = "v1.4.2"
|
||||
|
||||
--- @type string
|
||||
VERSION_TEXT = "v"
|
||||
|
|
|
|||
|
|
@ -3030,7 +3030,7 @@ end
|
|||
|
||||
--- @param name string
|
||||
--- @return BehaviorId
|
||||
--- gets a behavior ID from a behavior name
|
||||
--- Gets a behavior ID from a behavior name
|
||||
function get_id_from_behavior_name(name)
|
||||
-- ...
|
||||
end
|
||||
|
|
@ -3856,7 +3856,9 @@ function djui_hud_reset_color()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return HudUtilsRotation
|
||||
--- @return integer rotation
|
||||
--- @return number pivotX
|
||||
--- @return number pivotY
|
||||
--- Gets the current DJUI HUD rotation
|
||||
function djui_hud_get_rotation()
|
||||
-- ...
|
||||
|
|
@ -3881,6 +3883,29 @@ function djui_hud_set_rotation_interpolated(prevRotation, prevPivotX, prevPivotY
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return number textHAlign
|
||||
--- @return number textVAlign
|
||||
--- Gets the current DJUI HUD text alignment
|
||||
function djui_hud_get_text_alignment()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param textHAlign number
|
||||
--- @param textVAlign number
|
||||
--- Sets the current DJUI HUD text alignment
|
||||
function djui_hud_set_text_alignment(textHAlign, textVAlign)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param prevTextHAlign number
|
||||
--- @param prevTextVAlign number
|
||||
--- @param textHAlign number
|
||||
--- @param textVAlign number
|
||||
--- Sets the current DJUI HUD text alignment interpolated
|
||||
function djui_hud_set_text_alignment_interpolated(prevTextHAlign, prevTextVAlign, textHAlign, textVAlign)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return integer
|
||||
--- Gets the screen width in the current DJUI HUD resolution
|
||||
function djui_hud_get_screen_width()
|
||||
|
|
@ -5103,6 +5128,12 @@ function le_set_ambient_color(r, g, b)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param count integer
|
||||
--- Sets the max amount of lights that can affect a vertex
|
||||
function le_set_max_lights_per_vertex(count)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param pos Vec3f
|
||||
--- @param out Color
|
||||
--- @param lightIntensityScalar number
|
||||
|
|
@ -5234,6 +5265,12 @@ function le_set_light_use_surface_normals(id, useSurfaceNormals)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param bank integer
|
||||
--- Overrides the soundbank, set to -1 to reset
|
||||
function set_sound_bank_override(bank)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param m MarioState
|
||||
--- @return integer
|
||||
--- Checks if Mario's current animation has reached its final frame (i.e., the last valid frame in the animation). Useful for deciding when to transition out of an animation-driven action
|
||||
|
|
@ -10171,6 +10208,12 @@ function smlua_audio_utils_replace_sequence(sequenceId, bankId, defaultVolume, m
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return integer
|
||||
--- Allocates a new sequence ID
|
||||
function smlua_audio_utils_allocate_sequence()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param filename string
|
||||
--- @return ModAudio
|
||||
--- Loads an `audio` stream by `filename` (with extension)
|
||||
|
|
@ -11516,6 +11559,12 @@ function get_dialog_response()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @return integer
|
||||
--- Gets the active time stop flags, used to freeze specific objects during cutscenes
|
||||
function get_time_stop_flags()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return string
|
||||
--- Gets the local discord ID if it isn't disabled, otherwise "0" is returned
|
||||
function get_local_discord_id()
|
||||
|
|
@ -11604,6 +11653,14 @@ function get_active_mod()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param mod Mod
|
||||
--- @param subDirectory? string
|
||||
--- @return table
|
||||
--- Gets all files a mod contains
|
||||
function get_mod_files(mod, subDirectory)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param title string
|
||||
--- Sets the window title to a custom title
|
||||
function set_window_title(title)
|
||||
|
|
@ -11622,35 +11679,42 @@ function get_os_name()
|
|||
end
|
||||
|
||||
--- @return GraphNodeRoot
|
||||
--- Gets the current GraphNodeRoot
|
||||
--- Gets the current root node being processed
|
||||
function geo_get_current_root()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return GraphNodeMasterList
|
||||
--- Gets the current GraphNodeMasterList
|
||||
--- Gets the current master list node being processed
|
||||
function geo_get_current_master_list()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return GraphNodePerspective
|
||||
--- Gets the current GraphNodePerspective
|
||||
--- Gets the current perspective node being processed
|
||||
function geo_get_current_perspective()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return GraphNodeCamera
|
||||
--- Gets the current GraphNodeCamera
|
||||
--- Gets the current camera node being processed
|
||||
function geo_get_current_camera()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @return GraphNodeHeldObject
|
||||
--- Gets the current GraphNodeHeldObject
|
||||
--- Gets the current held object node being processed
|
||||
function geo_get_current_held_object()
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param node GraphNode
|
||||
--- @param obj GraphNodeObject
|
||||
--- Skips graph node interpolation for a frame
|
||||
function geo_skip_interpolation(node, obj)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param tex Pointer_Texture
|
||||
--- @return table
|
||||
--- Converts a texture's pixels to a Lua table. Returns nil if failed. Otherwise, returns a 1-indexed table of RGBA pixels
|
||||
|
|
@ -12062,6 +12126,18 @@ function set_whirlpools(x, y, z, strength, area, index)
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param o Object
|
||||
--- Skips object interpolation for a frame
|
||||
function obj_skip_interpolation(o)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param o Object
|
||||
--- Skips animation interpolation for a frame
|
||||
function obj_anim_skip_interpolation(o)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- Resets every modified dialog back to vanilla
|
||||
function smlua_text_utils_reset_all()
|
||||
-- ...
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function update_chat_command_description(command, description)
|
|||
end
|
||||
|
||||
--- @param hookEventType LuaHookedEventType When a function should run
|
||||
--- @param func fun(...: any): any The function to run
|
||||
--- @param func fun(...: any): any?, any? The function to run
|
||||
--- Different hooks can pass in different parameters and have different return values. Be sure to read the hooks guide for more information.
|
||||
function hook_event(hookEventType, func)
|
||||
-- ...
|
||||
|
|
|
|||
|
|
@ -955,14 +955,6 @@
|
|||
--- @field public translation Vec3s
|
||||
--- @field public rotation Vec3s
|
||||
|
||||
--- @class HudUtilsRotation
|
||||
--- @field public rotation number
|
||||
--- @field public rotationDiff number
|
||||
--- @field public prevPivotX number
|
||||
--- @field public prevPivotY number
|
||||
--- @field public pivotX number
|
||||
--- @field public pivotY number
|
||||
|
||||
--- @class InstantWarp
|
||||
--- @field public id integer
|
||||
--- @field public area integer
|
||||
|
|
|
|||
|
|
@ -597,5 +597,11 @@ enum BehaviorId get_id_from_behavior_name(const char* name) {
|
|||
return i;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < gHookedBehaviorsCount; i++) {
|
||||
struct LuaHookedBehavior *hooked = &gHookedBehaviors[i];
|
||||
if (hooked->bhvName && !strcmp(name, hooked->bhvName)) {
|
||||
return hooked->overrideId;
|
||||
}
|
||||
}
|
||||
return id_bhv_max_count;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2449,6 +2449,48 @@ static void ParseBehaviorScriptSymbol(GfxData *aGfxData, DataNode<BehaviorScript
|
|||
PrintDataError(" ERROR: Unknown behavior symbol: %s", _Symbol.begin());
|
||||
}
|
||||
|
||||
static bool DynOS_Bhv_CheckCommands(const BehaviorScript *aBhv, const Array<BehaviorScript> &aCommands) {
|
||||
u8 bhvCommand = (*aBhv >> 24) & 0xFF;
|
||||
for (const auto &commandToCheck : aCommands) {
|
||||
if (bhvCommand == ((commandToCheck >> 24) & 0xFF)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool DynOS_Bhv_Validate(GfxData *aGfxData, const DataNode<BehaviorScript> *aNode) {
|
||||
|
||||
// 1st command must be BEGIN
|
||||
if (!DynOS_Bhv_CheckCommands(aNode->mData + 0, { BEGIN(0) })) {
|
||||
PrintDataError(" ERROR: Validation failed for behavior %s: First command of the script must be BEGIN.", aNode->mName.begin());
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2nd command must be ID
|
||||
if (!DynOS_Bhv_CheckCommands(aNode->mData + 1, { ID(0) })) {
|
||||
PrintDataError(" ERROR: Validation failed for behavior %s: Second command of the script must be ID.", aNode->mName.begin());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Last command must be a terminating command
|
||||
if (!DynOS_Bhv_CheckCommands(aNode->mData + aNode->mSize - 1, {
|
||||
CALL(0),
|
||||
RETURN(),
|
||||
GOTO(0),
|
||||
END_LOOP(),
|
||||
BREAK(),
|
||||
DEACTIVATE(),
|
||||
CALL_EXT(0),
|
||||
GOTO_EXT(0),
|
||||
})) {
|
||||
PrintDataError(" ERROR: Validation failed for behavior %s: Last command of the script must be one of:\n CALL, RETURN, GOTO, END_LOOP, BREAK, DEACTIVATE", aNode->mName.begin());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DataNode<BehaviorScript> *DynOS_Bhv_Parse(GfxData *aGfxData, DataNode<BehaviorScript> *aNode, bool aDisplayPercent) {
|
||||
if (aNode->mData) return aNode;
|
||||
|
||||
|
|
@ -2460,9 +2502,13 @@ DataNode<BehaviorScript> *DynOS_Bhv_Parse(GfxData *aGfxData, DataNode<BehaviorSc
|
|||
ParseBehaviorScriptSymbol(aGfxData, aNode, _Head, _TokenIndex, _SwitchNodes);
|
||||
if (aDisplayPercent && aGfxData->mErrorCount == 0) { PrintNoNewLine("%3d%%\b\b\b\b", (s32) (_TokenIndex * 100) / aNode->mTokens.Count()); }
|
||||
}
|
||||
if (aDisplayPercent && aGfxData->mErrorCount == 0) { Print("100%%"); }
|
||||
aNode->mSize = (u32)(_Head - aNode->mData);
|
||||
aNode->mLoadIndex = aGfxData->mLoadIndex++;
|
||||
|
||||
// Validate behavior script
|
||||
DynOS_Bhv_Validate(aGfxData, aNode);
|
||||
|
||||
if (aDisplayPercent && aGfxData->mErrorCount == 0) { Print("100%%"); }
|
||||
return aNode;
|
||||
}
|
||||
|
||||
|
|
@ -2592,6 +2638,12 @@ static DataNode<BehaviorScript> *DynOS_Bhv_Load(BinFile *aFile, GfxData *aGfxDat
|
|||
}
|
||||
}
|
||||
|
||||
// Validate it
|
||||
if (!DynOS_Bhv_Validate(aGfxData, _Node)) {
|
||||
Delete(_Node);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Add it
|
||||
if (aGfxData != NULL) {
|
||||
aGfxData->mBehaviorScripts.Add(_Node);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ extern "C" {
|
|||
#include "behavior_data.h"
|
||||
#include "pc/lua/smlua_hooks.h"
|
||||
|
||||
s8 geo_get_processing_mario_index(void);
|
||||
s8 geo_get_processing_mario_index(struct Object *obj);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -77,7 +77,7 @@ void DynOS_Anim_Swap(void *aPtr) {
|
|||
|
||||
// Animation index
|
||||
s32 _AnimIndex = -1;
|
||||
s8 index = geo_get_processing_mario_index();
|
||||
s8 index = geo_get_processing_mario_index(_Object);
|
||||
if (index != -1) {
|
||||
_AnimIndex = RetrieveCurrentMarioAnimationIndex(index);
|
||||
|
||||
|
|
|
|||
|
|
@ -1149,6 +1149,18 @@
|
|||
<br />
|
||||
|
||||
## [djui_hud_utils.h](#djui_hud_utils.h)
|
||||
- ROTATION_PIVOT_X_LEFT
|
||||
- ROTATION_PIVOT_X_CENTER
|
||||
- ROTATION_PIVOT_X_RIGHT
|
||||
- ROTATION_PIVOT_Y_TOP
|
||||
- ROTATION_PIVOT_Y_CENTER
|
||||
- ROTATION_PIVOT_Y_BOTTOM
|
||||
- TEXT_HALIGN_LEFT
|
||||
- TEXT_HALIGN_CENTER
|
||||
- TEXT_HALIGN_RIGHT
|
||||
- TEXT_VALIGN_TOP
|
||||
- TEXT_VALIGN_CENTER
|
||||
- TEXT_VALIGN_BOTTOM
|
||||
|
||||
### [enum HudUtilsResolution](#HudUtilsResolution)
|
||||
| Identifier | Value |
|
||||
|
|
@ -1167,6 +1179,7 @@
|
|||
### [enum DjuiFontType](#DjuiFontType)
|
||||
| Identifier | Value |
|
||||
| :--------- | :---- |
|
||||
| FONT_LEGACY | -1 |
|
||||
| FONT_NORMAL | 0 |
|
||||
| FONT_MENU | 1 |
|
||||
| FONT_HUD | 2 |
|
||||
|
|
@ -1459,7 +1472,7 @@
|
|||
- ATTACK_FROM_BELOW
|
||||
- PVP_ATTACK_KNOCKBACK_TIMER_DEFAULT
|
||||
- PVP_ATTACK_KNOCKBACK_TIMER_OVERRIDE
|
||||
- PVP_ATTACK_OVERRIDE_VANILLA_INVINCIBILITY
|
||||
- PVP_ATTACK_KNOCKBACK_ACTION_ARG
|
||||
- INT_STATUS_ATTACK_MASK
|
||||
- INT_STATUS_HOOT_GRABBED_BY_MARIO
|
||||
- INT_STATUS_MARIO_UNK1
|
||||
|
|
@ -3524,7 +3537,14 @@
|
|||
| HOOK_ON_ADD_SURFACE | 57 |
|
||||
| HOOK_ON_CLEAR_AREAS | 58 |
|
||||
| HOOK_ON_PACKET_BYTESTRING_RECEIVE | 59 |
|
||||
| HOOK_MAX | 60 |
|
||||
| HOOK_ON_FIND_WALL_COLLISION | 60 |
|
||||
| HOOK_ON_FIND_CEIL | 61 |
|
||||
| HOOK_ON_FIND_FLOOR | 62 |
|
||||
| HOOK_ON_FIND_WATER_LEVEL | 63 |
|
||||
| HOOK_ON_FIND_POISON_GAS_LEVEL | 64 |
|
||||
| HOOK_ON_FIND_SURFACE_ON_RAY | 65 |
|
||||
| HOOK_MAX | 66 |
|
||||
- MAX_HOOKED_BEHAVIORS
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ Gets a behavior name from a behavior ID (bhvMyGreatMODCustom004)
|
|||
## [get_id_from_behavior_name](#get_id_from_behavior_name)
|
||||
|
||||
### Description
|
||||
gets a behavior ID from a behavior name
|
||||
Gets a behavior ID from a behavior name
|
||||
|
||||
### Lua Example
|
||||
`local enumValue = get_id_from_behavior_name(name)`
|
||||
|
|
@ -1312,7 +1312,8 @@ Calculates and returns the pitch and yaw angles from one 3D position (`from`) to
|
|||
| to | [Vec3f](structs.md#Vec3f) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `integer`
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`void calculate_angles(Vec3f from, Vec3f to, RET s16 *pitch, RET s16 *yaw);`
|
||||
|
|
@ -1585,7 +1586,7 @@ Applies a roll-based shake effect to the camera. Simulates rotational disturbanc
|
|||
| roll | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`void shake_camera_roll(INOUT s16 *roll);`
|
||||
|
|
@ -2825,7 +2826,7 @@ Gets the current DJUI HUD font
|
|||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`u8 djui_hud_get_font(void);`
|
||||
`s8 djui_hud_get_font(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
@ -2928,16 +2929,18 @@ Resets the current DJUI HUD color
|
|||
Gets the current DJUI HUD rotation
|
||||
|
||||
### Lua Example
|
||||
`local hudUtilsRotationValue = djui_hud_get_rotation()`
|
||||
`local rotation, pivotX, pivotY = djui_hud_get_rotation()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- [HudUtilsRotation](structs.md#HudUtilsRotation)
|
||||
- `integer`
|
||||
- `number`
|
||||
- `number`
|
||||
|
||||
### C Prototype
|
||||
`struct HudUtilsRotation* djui_hud_get_rotation(void);`
|
||||
`void djui_hud_get_rotation(RET s16 *rotation, RET f32 *pivotX, RET f32 *pivotY);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
@ -2990,7 +2993,79 @@ Sets the current DJUI HUD rotation interpolated
|
|||
- None
|
||||
|
||||
### C Prototype
|
||||
`void djui_hud_set_rotation_interpolated(s32 prevRotation, f32 prevPivotX, f32 prevPivotY, s32 rotation, f32 pivotX, f32 pivotY);`
|
||||
`void djui_hud_set_rotation_interpolated(s16 prevRotation, f32 prevPivotX, f32 prevPivotY, s16 rotation, f32 pivotX, f32 pivotY);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [djui_hud_get_text_alignment](#djui_hud_get_text_alignment)
|
||||
|
||||
### Description
|
||||
Gets the current DJUI HUD text alignment
|
||||
|
||||
### Lua Example
|
||||
`local textHAlign, textVAlign = djui_hud_get_text_alignment()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `number`
|
||||
- `number`
|
||||
|
||||
### C Prototype
|
||||
`void djui_hud_get_text_alignment(RET f32 *textHAlign, RET f32 *textVAlign);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [djui_hud_set_text_alignment](#djui_hud_set_text_alignment)
|
||||
|
||||
### Description
|
||||
Sets the current DJUI HUD text alignment
|
||||
|
||||
### Lua Example
|
||||
`djui_hud_set_text_alignment(textHAlign, textVAlign)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| textHAlign | `number` |
|
||||
| textVAlign | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void djui_hud_set_text_alignment(f32 textHAlign, f32 textVAlign);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [djui_hud_set_text_alignment_interpolated](#djui_hud_set_text_alignment_interpolated)
|
||||
|
||||
### Description
|
||||
Sets the current DJUI HUD text alignment interpolated
|
||||
|
||||
### Lua Example
|
||||
`djui_hud_set_text_alignment_interpolated(prevTextHAlign, prevTextVAlign, textHAlign, textVAlign)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| prevTextHAlign | `number` |
|
||||
| prevTextVAlign | `number` |
|
||||
| textHAlign | `number` |
|
||||
| textVAlign | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void djui_hud_set_text_alignment_interpolated(f32 prevTextHAlign, f32 prevTextVAlign, f32 textHAlign, f32 textVAlign);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,29 @@ Sets the lighting engine ambient color
|
|||
|
||||
<br />
|
||||
|
||||
## [le_set_max_lights_per_vertex](#le_set_max_lights_per_vertex)
|
||||
|
||||
### Description
|
||||
Sets the max amount of lights that can affect a vertex
|
||||
|
||||
### Lua Example
|
||||
`le_set_max_lights_per_vertex(count)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| count | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void le_set_max_lights_per_vertex(u8 count);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [le_calculate_lighting_color](#le_calculate_lighting_color)
|
||||
|
||||
### Description
|
||||
|
|
@ -560,6 +583,35 @@ Sets whether a lighting engine point light will use a surface's normals to deter
|
|||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from load.h
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
## [set_sound_bank_override](#set_sound_bank_override)
|
||||
|
||||
### Description
|
||||
Overrides the soundbank, set to -1 to reset
|
||||
|
||||
### Lua Example
|
||||
`set_sound_bank_override(bank)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| bank | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void set_sound_bank_override(s32 bank);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from mario.h
|
||||
|
||||
|
|
@ -5082,7 +5134,9 @@ Calculates the distance between two points in 3D space (`from` and `to`), as wel
|
|||
| to | [Vec3f](structs.md#Vec3f) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `number`
|
||||
- `integer`
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`void vec3f_get_dist_and_angle(Vec3f from, Vec3f to, RET f32 *dist, RET s16 *pitch, RET s16 *yaw);`
|
||||
|
|
|
|||
|
|
@ -2945,7 +2945,7 @@ Determines an object's forward speed multiplier.
|
|||
| floor_nY | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `number`
|
||||
|
||||
### C Prototype
|
||||
`void calc_obj_friction(RET f32 *objFriction, f32 floor_nY);`
|
||||
|
|
@ -4419,7 +4419,7 @@ Begin by increasing the current object's scale by `scaleVel`, and slowly decreas
|
|||
| blinkLength | `integer` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`void obj_update_blinking(INOUT s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength);`
|
||||
|
|
@ -4743,7 +4743,8 @@ Treats far home as Mario. Returns the distance and angle to the nearest player
|
|||
| threshold | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `integer`
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`void treat_far_home_as_mario(f32 threshold, RET s32* distanceToPlayer, RET s32* angleToPlayer);`
|
||||
|
|
|
|||
|
|
@ -1963,7 +1963,7 @@ Marks an object to be unloaded at the end of the frame
|
|||
| dragStrength | `number` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
- `number`
|
||||
|
||||
### C Prototype
|
||||
`void apply_drag_to_value(INOUT f32 *value, f32 dragStrength);`
|
||||
|
|
@ -5616,6 +5616,27 @@ Replaces the sequence corresponding to `sequenceId` with one called `m64Name`.m6
|
|||
|
||||
<br />
|
||||
|
||||
## [smlua_audio_utils_allocate_sequence](#smlua_audio_utils_allocate_sequence)
|
||||
|
||||
### Description
|
||||
Allocates a new sequence ID
|
||||
|
||||
### Lua Example
|
||||
`local integerValue = smlua_audio_utils_allocate_sequence()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`u8 smlua_audio_utils_allocate_sequence(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [audio_stream_load](#audio_stream_load)
|
||||
|
||||
### Description
|
||||
|
|
|
|||
|
|
@ -1775,6 +1775,27 @@ Gets the choice selected inside of a dialog box (0-1)
|
|||
|
||||
<br />
|
||||
|
||||
## [get_time_stop_flags](#get_time_stop_flags)
|
||||
|
||||
### Description
|
||||
Gets the active time stop flags, used to freeze specific objects during cutscenes
|
||||
|
||||
### Lua Example
|
||||
`local integerValue = get_time_stop_flags()`
|
||||
|
||||
### Parameters
|
||||
- None
|
||||
|
||||
### Returns
|
||||
- `integer`
|
||||
|
||||
### C Prototype
|
||||
`u32 get_time_stop_flags(void);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [get_local_discord_id](#get_local_discord_id)
|
||||
|
||||
### Description
|
||||
|
|
@ -2086,6 +2107,30 @@ Gets the mod currently being processed
|
|||
|
||||
<br />
|
||||
|
||||
## [get_mod_files](#get_mod_files)
|
||||
|
||||
### Description
|
||||
Gets all files a mod contains
|
||||
|
||||
### Lua Example
|
||||
`local tableValue = get_mod_files(mod, subDirectory)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| mod | [Mod](structs.md#Mod) |
|
||||
| subDirectory | `string` |
|
||||
|
||||
### Returns
|
||||
- `table`
|
||||
|
||||
### C Prototype
|
||||
`LuaTable get_mod_files(struct Mod* mod, OPTIONAL const char* subDirectory);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [set_window_title](#set_window_title)
|
||||
|
||||
### Description
|
||||
|
|
@ -2154,7 +2199,7 @@ Gets the name of the operating system the game is running on
|
|||
## [geo_get_current_root](#geo_get_current_root)
|
||||
|
||||
### Description
|
||||
Gets the current GraphNodeRoot
|
||||
Gets the current root node being processed
|
||||
|
||||
### Lua Example
|
||||
`local graphNodeRootValue = geo_get_current_root()`
|
||||
|
|
@ -2175,7 +2220,7 @@ Gets the current GraphNodeRoot
|
|||
## [geo_get_current_master_list](#geo_get_current_master_list)
|
||||
|
||||
### Description
|
||||
Gets the current GraphNodeMasterList
|
||||
Gets the current master list node being processed
|
||||
|
||||
### Lua Example
|
||||
`local graphNodeMasterListValue = geo_get_current_master_list()`
|
||||
|
|
@ -2196,7 +2241,7 @@ Gets the current GraphNodeMasterList
|
|||
## [geo_get_current_perspective](#geo_get_current_perspective)
|
||||
|
||||
### Description
|
||||
Gets the current GraphNodePerspective
|
||||
Gets the current perspective node being processed
|
||||
|
||||
### Lua Example
|
||||
`local graphNodePerspectiveValue = geo_get_current_perspective()`
|
||||
|
|
@ -2217,7 +2262,7 @@ Gets the current GraphNodePerspective
|
|||
## [geo_get_current_camera](#geo_get_current_camera)
|
||||
|
||||
### Description
|
||||
Gets the current GraphNodeCamera
|
||||
Gets the current camera node being processed
|
||||
|
||||
### Lua Example
|
||||
`local graphNodeCameraValue = geo_get_current_camera()`
|
||||
|
|
@ -2238,7 +2283,7 @@ Gets the current GraphNodeCamera
|
|||
## [geo_get_current_held_object](#geo_get_current_held_object)
|
||||
|
||||
### Description
|
||||
Gets the current GraphNodeHeldObject
|
||||
Gets the current held object node being processed
|
||||
|
||||
### Lua Example
|
||||
`local graphNodeHeldObjectValue = geo_get_current_held_object()`
|
||||
|
|
@ -2256,6 +2301,30 @@ Gets the current GraphNodeHeldObject
|
|||
|
||||
<br />
|
||||
|
||||
## [geo_skip_interpolation](#geo_skip_interpolation)
|
||||
|
||||
### Description
|
||||
Skips graph node interpolation for a frame
|
||||
|
||||
### Lua Example
|
||||
`geo_skip_interpolation(node, obj)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| node | [GraphNode](structs.md#GraphNode) |
|
||||
| obj | [GraphNodeObject](structs.md#GraphNodeObject) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void geo_skip_interpolation(struct GraphNode *node, struct GraphNodeObject *obj);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [texture_to_lua_table](#texture_to_lua_table)
|
||||
|
||||
### Description
|
||||
|
|
@ -3531,6 +3600,52 @@ Sets the parameters of one of the two whirlpools (0-indexed) in an area
|
|||
|
||||
<br />
|
||||
|
||||
## [obj_skip_interpolation](#obj_skip_interpolation)
|
||||
|
||||
### Description
|
||||
Skips object interpolation for a frame
|
||||
|
||||
### Lua Example
|
||||
`obj_skip_interpolation(o)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| o | [Object](structs.md#Object) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void obj_skip_interpolation(struct Object *o);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [obj_anim_skip_interpolation](#obj_anim_skip_interpolation)
|
||||
|
||||
### Description
|
||||
Skips animation interpolation for a frame
|
||||
|
||||
### Lua Example
|
||||
`obj_anim_skip_interpolation(o)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| o | [Object](structs.md#Object) |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void obj_anim_skip_interpolation(struct Object *o);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
---
|
||||
# functions from smlua_text_utils.h
|
||||
|
||||
|
|
|
|||
|
|
@ -763,6 +763,9 @@
|
|||
- [djui_hud_get_rotation](functions-3.md#djui_hud_get_rotation)
|
||||
- [djui_hud_set_rotation](functions-3.md#djui_hud_set_rotation)
|
||||
- [djui_hud_set_rotation_interpolated](functions-3.md#djui_hud_set_rotation_interpolated)
|
||||
- [djui_hud_get_text_alignment](functions-3.md#djui_hud_get_text_alignment)
|
||||
- [djui_hud_set_text_alignment](functions-3.md#djui_hud_set_text_alignment)
|
||||
- [djui_hud_set_text_alignment_interpolated](functions-3.md#djui_hud_set_text_alignment_interpolated)
|
||||
- [djui_hud_get_screen_width](functions-3.md#djui_hud_get_screen_width)
|
||||
- [djui_hud_get_screen_height](functions-3.md#djui_hud_get_screen_height)
|
||||
- [djui_hud_get_mouse_x](functions-3.md#djui_hud_get_mouse_x)
|
||||
|
|
@ -976,6 +979,7 @@
|
|||
- [le_set_tone_mapping](functions-4.md#le_set_tone_mapping)
|
||||
- [le_get_ambient_color](functions-4.md#le_get_ambient_color)
|
||||
- [le_set_ambient_color](functions-4.md#le_set_ambient_color)
|
||||
- [le_set_max_lights_per_vertex](functions-4.md#le_set_max_lights_per_vertex)
|
||||
- [le_calculate_lighting_color](functions-4.md#le_calculate_lighting_color)
|
||||
- [le_calculate_lighting_color_with_normal](functions-4.md#le_calculate_lighting_color_with_normal)
|
||||
- [le_calculate_lighting_dir](functions-4.md#le_calculate_lighting_dir)
|
||||
|
|
@ -996,6 +1000,11 @@
|
|||
|
||||
<br />
|
||||
|
||||
- load.h
|
||||
- [set_sound_bank_override](functions-4.md#set_sound_bank_override)
|
||||
|
||||
<br />
|
||||
|
||||
- mario.h
|
||||
- [is_anim_at_end](functions-4.md#is_anim_at_end)
|
||||
- [is_anim_past_end](functions-4.md#is_anim_past_end)
|
||||
|
|
@ -1819,6 +1828,7 @@
|
|||
- smlua_audio_utils.h
|
||||
- [smlua_audio_utils_reset_all](functions-6.md#smlua_audio_utils_reset_all)
|
||||
- [smlua_audio_utils_replace_sequence](functions-6.md#smlua_audio_utils_replace_sequence)
|
||||
- [smlua_audio_utils_allocate_sequence](functions-6.md#smlua_audio_utils_allocate_sequence)
|
||||
- [audio_stream_load](functions-6.md#audio_stream_load)
|
||||
- [audio_stream_destroy](functions-6.md#audio_stream_destroy)
|
||||
- [audio_stream_play](functions-6.md#audio_stream_play)
|
||||
|
|
@ -2047,6 +2057,7 @@
|
|||
- [set_override_envfx](functions-7.md#set_override_envfx)
|
||||
- [get_global_timer](functions-7.md#get_global_timer)
|
||||
- [get_dialog_response](functions-7.md#get_dialog_response)
|
||||
- [get_time_stop_flags](functions-7.md#get_time_stop_flags)
|
||||
- [get_local_discord_id](functions-7.md#get_local_discord_id)
|
||||
- [get_coopnet_id](functions-7.md#get_coopnet_id)
|
||||
- [get_volume_master](functions-7.md#get_volume_master)
|
||||
|
|
@ -2061,6 +2072,7 @@
|
|||
- [set_environment_region](functions-7.md#set_environment_region)
|
||||
- [mod_file_exists](functions-7.md#mod_file_exists)
|
||||
- [get_active_mod](functions-7.md#get_active_mod)
|
||||
- [get_mod_files](functions-7.md#get_mod_files)
|
||||
- [set_window_title](functions-7.md#set_window_title)
|
||||
- [reset_window_title](functions-7.md#reset_window_title)
|
||||
- [get_os_name](functions-7.md#get_os_name)
|
||||
|
|
@ -2069,6 +2081,7 @@
|
|||
- [geo_get_current_perspective](functions-7.md#geo_get_current_perspective)
|
||||
- [geo_get_current_camera](functions-7.md#geo_get_current_camera)
|
||||
- [geo_get_current_held_object](functions-7.md#geo_get_current_held_object)
|
||||
- [geo_skip_interpolation](functions-7.md#geo_skip_interpolation)
|
||||
- [texture_to_lua_table](functions-7.md#texture_to_lua_table)
|
||||
- [get_texture_name](functions-7.md#get_texture_name)
|
||||
|
||||
|
|
@ -2130,6 +2143,8 @@
|
|||
- [obj_set_vel](functions-7.md#obj_set_vel)
|
||||
- [obj_move_xyz](functions-7.md#obj_move_xyz)
|
||||
- [set_whirlpools](functions-7.md#set_whirlpools)
|
||||
- [obj_skip_interpolation](functions-7.md#obj_skip_interpolation)
|
||||
- [obj_anim_skip_interpolation](functions-7.md#obj_anim_skip_interpolation)
|
||||
|
||||
<br />
|
||||
|
||||
|
|
|
|||
|
|
@ -151,6 +151,12 @@ The lua functions sent to `hook_event()` will be automatically called by SM64 wh
|
|||
| HOOK_MARIO_OVERRIDE_FLOOR_CLASS | Called when Mario's floor class logic updates, return a `SURFACE_CLASS_*` constant to override the type. | [MarioState](../structs.md#MarioState) mario, `integer` surfaceClass |
|
||||
| HOOK_ON_ADD_SURFACE | Called when collision surfaces are added. | [Surface](../structs.md#Surface) surface, `boolean` dynamic |
|
||||
| HOOK_ON_CLEAR_AREAS | Called when a level's areas are unloaded. | None |
|
||||
| HOOK_ON_FIND_WALL_COLLISION | Called after wall collision detection completes. You can modify the `colData` fields directly. Return a number to override `numCollisions` | `number` posX, `number` posY, `number` posZ, [WallCollisionData](../structs.md#WallCollisionData) colData |
|
||||
| HOOK_ON_FIND_CEIL | Called after ceiling detection completes. Return `height` to override height, or `height, surface` to override both | `number` posX, `number` posY, `number` posZ, [Surface](../structs.md#Surface) ceil, `number` height |
|
||||
| HOOK_ON_FIND_FLOOR | Called after floor detection completes. Return `height` to override height, or `height, surface` to override both | `number` posX, `number` posY, `number` posZ, [Surface](../structs.md#Surface) floor, `number` height |
|
||||
| HOOK_ON_FIND_WATER_LEVEL | Called after water level detection completes. Return a number to override the water level | `number` x, `number` z, `number` waterLevel |
|
||||
| HOOK_ON_FIND_POISON_GAS_LEVEL | Called after poison gas level detection completes. Return a number to override the gas level | `number` x, `number` z, `number` gasLevel |
|
||||
| HOOK_ON_FIND_SURFACE_ON_RAY | Called after ray-surface intersection completes. Return `surface` to override the hit surface, or `surface, hitPos` to override both | `Vec3f` orig, `Vec3f` dir, [Surface](../structs.md#Surface) hitSurface, `Vec3f` hitPos |
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
- [GraphNodeSwitchCase](#GraphNodeSwitchCase)
|
||||
- [GraphNodeTranslation](#GraphNodeTranslation)
|
||||
- [GraphNodeTranslationRotation](#GraphNodeTranslationRotation)
|
||||
- [HudUtilsRotation](#HudUtilsRotation)
|
||||
- [InstantWarp](#InstantWarp)
|
||||
- [LakituState](#LakituState)
|
||||
- [LevelValues](#LevelValues)
|
||||
|
|
@ -1427,21 +1426,6 @@
|
|||
|
||||
<br />
|
||||
|
||||
## [HudUtilsRotation](#HudUtilsRotation)
|
||||
|
||||
| Field | Type | Access |
|
||||
| ----- | ---- | ------ |
|
||||
| rotation | `number` | |
|
||||
| rotationDiff | `number` | |
|
||||
| prevPivotX | `number` | |
|
||||
| prevPivotY | `number` | |
|
||||
| pivotX | `number` | |
|
||||
| pivotY | `number` | |
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [InstantWarp](#InstantWarp)
|
||||
|
||||
| Field | Type | Access |
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ enum BehaviorId get_id_from_vanilla_behavior(const BehaviorScript* behavior);
|
|||
const BehaviorScript* get_behavior_from_id(enum BehaviorId id);
|
||||
/* |description|Gets a behavior name from a behavior ID (bhvMyGreatMODCustom004)|descriptionEnd| */
|
||||
const char* get_behavior_name_from_id(enum BehaviorId id);
|
||||
/* |description|gets a behavior ID from a behavior name|descriptionEnd| */
|
||||
/* |description|Gets a behavior ID from a behavior name|descriptionEnd| */
|
||||
enum BehaviorId get_id_from_behavior_name(const char* name);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ NAMETAGS_MISSING_PARAMETERS = "Fehlende Parameter: [OPTION]"
|
|||
SELF_KICK = "Du kannst dich nicht selbst kicken."
|
||||
SELF_BAN = "Du kannst dich nicht selbst bannen."
|
||||
SELF_MOD = "Du kannst dich nicht selbst zum Moderator machen."
|
||||
KICK_CONFIRM = "Bist du sicher, dass du '@' vom Server kicken möchtest?\nGib '\\#a0ffa0\\/bestätigen\\#fff982\\' ein, um fortzufahren."
|
||||
BAN_CONFIRM = "Bist du sicher, dass du '@' vom Server bannen möchtest?\nGib '\\#a0ffa0\\/bestätigen\\#fff982\\' ein, um fortzufahren."
|
||||
PERM_BAN_CONFIRM = "Bist du sicher, dass du '@' dauerhaft vom Server bannen möchtest?\nGib '\\#a0ffa0\\/bestätigen\\#fff982\\' ein, um fortzufahren."
|
||||
MOD_CONFIRM = "Bist du sicher, dass du '@' zum Moderator ernennen möchtest?\nGib '\\#a0ffa0\\/bestätigen\\#fff982\\' ein."
|
||||
KICK_CONFIRM = "Bist du sicher, dass du '@' vom Server kicken möchtest?\nGib '\\#a0ffa0\\/confirm\\#fff982\\' ein, um fortzufahren."
|
||||
BAN_CONFIRM = "Bist du sicher, dass du '@' vom Server bannen möchtest?\nGib '\\#a0ffa0\\/confirm\\#fff982\\' ein, um fortzufahren."
|
||||
PERM_BAN_CONFIRM = "Bist du sicher, dass du '@' dauerhaft vom Server bannen möchtest?\nGib '\\#a0ffa0\\/confirm\\#fff982\\' ein, um fortzufahren."
|
||||
MOD_CONFIRM = "Bist du sicher, dass du '@' zum Moderator ernennen möchtest?\nGib '\\#a0ffa0\\/confirm\\#fff982\\' ein."
|
||||
PLAYERS_DESC = "/players - Zeige alle Spieler und ihre IDs."
|
||||
KICK_DESC = "/kick [NAME|ID] - Kicke einen Spieler vom Server."
|
||||
BAN_DESC = "/ban [NAME|ID] - Banne einen Spieler vom Server."
|
||||
|
|
|
|||
|
|
@ -1,61 +1,61 @@
|
|||
[NOTIF]
|
||||
CONNECTED = "@が接続しました"
|
||||
DISCONNECTED = "@が切断しました。"
|
||||
LEFT_THIS_LEVEL = "@がこのコースから出ました。"
|
||||
ENTERED_THIS_LEVEL = "@がこのコースに入りました。"
|
||||
ENTERED = "@が\n#に入りました。"
|
||||
SERVER_CLOSED = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ 部屋が閉じられました。"
|
||||
DISCORD_ERROR = "Discordエラーが発生しました。\n解決するには、\n1. ゲームを終了し、\n2. Discordを再起動してから、\n3. もう一度ゲームを開いてください。"
|
||||
CONNECTED = "@ が参加しました"
|
||||
DISCONNECTED = "@ が退出しました"
|
||||
LEFT_THIS_LEVEL = "@ がこのコースから出ました"
|
||||
ENTERED_THIS_LEVEL = "@ がこのコースに入りました"
|
||||
ENTERED = "@ が \n# に入りました"
|
||||
SERVER_CLOSED = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ ルームが閉じられました。"
|
||||
DISCORD_ERROR = "Discordエラーが発生しました。\n解決するには、\n1. ゲームを終了する\n2. Discordを再起動する\n3. もう一度ゲームを開く\nの手順で進めてください。"
|
||||
DISCORD_DETECT = "\\#ffa0a0\\エラー:\\#dcdcdc\\ Discordを検出できませんでした。\n\\#a0a0a0\\ゲームを終了し、Discordを再起動してから、もう一度お試しください。"
|
||||
DISCONNECT_FULL = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ ルームが満員です。"
|
||||
DISCONNECT_KICK = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ キックされました。"
|
||||
DISCONNECT_BAN = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ BANされました。"
|
||||
DISCONNECT_REJOIN = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ 再参加中です…"
|
||||
DISCONNECT_CLOSED = "\\#ffa0a0\\切断されました:\\#dcdcdc\\ ホストが切断しました。"
|
||||
DISCONNECT_BIG_MOD = "MODの量が多すぎます!\n切断しました。"
|
||||
DIED = "@がやられた!"
|
||||
DEBUG_FLY = "@がデバッグ飛行モードに入りました!"
|
||||
IMPORT_MOD_SUCCESS = "'@'\n\\#a0ffa0\\MODを読み込みました\\#dcdcdc\\"
|
||||
IMPORT_DYNOS_SUCCESS = "'@'\n\\#a0ffa0\\DynOSのパックを読み込みました\\#dcdcdc\\"
|
||||
IMPORT_PALETTE_SUCCESS = "'@'\n\\#a0ffa0\\パレットのプリセットを読み込みました\\#dcdcdc\\"
|
||||
IMPORT_FAIL = "'@'\n\\#ffa0a0\\読み込みに失敗しました。\\#dcdcdc\\"
|
||||
IMPORT_FAIL_INGAME = "\\#ffa0a0\\ゲーム中はMODを読み込めません"
|
||||
DISCONNECT_BIG_MOD = "このルームはMODの量が多すぎます。\n切断しました。"
|
||||
DIED = "@がやられた"
|
||||
DEBUG_FLY = "@がデバッグ飛行モードに入った"
|
||||
IMPORT_MOD_SUCCESS = "\\#a0ffa0\\MODをインポートしました:\n\\#dcdcdc\\@"
|
||||
IMPORT_DYNOS_SUCCESS = "\\#a0ffa0\\DynOSパックをインポートしました:\n\\#dcdcdc\\@"
|
||||
IMPORT_PALETTE_SUCCESS = "\\#a0ffa0\\パレットプリセットをインポートしました:\n\\#dcdcdc\\@"
|
||||
IMPORT_FAIL = "\\#ffa0a0\\インポートに失敗しました:\n\\#dcdcdc\\@"
|
||||
IMPORT_FAIL_INGAME = "\\#ffa0a0\\ゲーム中はMODをインポートできません"
|
||||
COOPNET_CONNECTION_FAILED = "\\#ffa0a0\\CoopNetに接続できませんでした!"
|
||||
COOPNET_DISCONNECTED = "\\#ffa0a0\\CoopNetとの接続が途絶えました!"
|
||||
COOPNET_DISCONNECTED = "\\#ffa0a0\\CoopNetとの接続が失われました!"
|
||||
LOBBY_NOT_FOUND = "\\#ffa0a0\\エラー:\\#dcdcdc\\ ルームがすでに閉じられています!"
|
||||
LOBBY_JOIN_FAILED = "\\#ffa0a0\\ルームに参加できませんでした。"
|
||||
LOBBY_PASSWORD_INCORRECT = "\\#ffa0a0\\パスワードが間違っています。"
|
||||
COOPNET_VERSION = "\\#ffa0a0\\あなたのバージョンはCoopNetに対応していません。アップデートしましょう!"
|
||||
PEER_FAILED = "\\#ffa0a0\\'@'への接続に失敗しました。"
|
||||
LOBBY_JOIN_FAILED = "\\#ffa0a0\\ルームへの参加に失敗しました!"
|
||||
LOBBY_PASSWORD_INCORRECT = "\\#ffa0a0\\パスワードが間違っています!"
|
||||
COOPNET_VERSION = "\\#ffa0a0\\あなたのゲームバージョンはCoopNetに対応していません。アップデートしましょう!"
|
||||
PEER_FAILED = "\\#ffa0a0\\プレイヤー @ への接続に失敗しました。"
|
||||
UNKNOWN = "未知"
|
||||
LOBBY_HOST = "部屋主"
|
||||
LOBBY_HOST = "ルームのホスト"
|
||||
UPDATE_AVAILABLE = "アップデートが利用可能です!"
|
||||
LATEST_VERSION = "最新バージョン"
|
||||
LATEST_VERSION = "最新のバージョン"
|
||||
YOUR_VERSION = "あなたのバージョン"
|
||||
|
||||
[CHAT]
|
||||
KICKING = "'@'をキックしました!"
|
||||
BANNING = "'@'をBANしました!"
|
||||
KICKING = "@ をキックしました!"
|
||||
BANNING = "@ をBANしました!"
|
||||
SERVER_ONLY = "このコマンドはホストのみが実行できます。"
|
||||
PERM_BANNING = "'@'を永久BANしました!"
|
||||
ADD_MODERATOR = "'@'をモデレーターにしました!"
|
||||
PLAYERS = "プレイヤー"
|
||||
PERM_BANNING = "@ を永久BANしました!"
|
||||
ADD_MODERATOR = "@ をモデレーターにしました!"
|
||||
PLAYERS = "ルーム内のプレイヤー"
|
||||
NO_PERMS = "このコマンドを実行する権限がありません。"
|
||||
PLAYER_NOT_FOUND = "プレイヤーが見つかりませんでした。"
|
||||
NAMETAGS_MISSING_PARAMETERS = "引数が不足しています: [OPTION]が必要です。"
|
||||
NAMETAGS_MISSING_PARAMETERS = "引数が不足しています: [OPTION] が必要です。"
|
||||
SELF_KICK = "自分自身はキックできません。"
|
||||
SELF_BAN = "自分自身はBANできません。"
|
||||
SELF_MOD = "自分自身をモデレーターにすることはできません。"
|
||||
KICK_CONFIRM = "本当に'@'を強制退出させますか?\n実行するには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
BAN_CONFIRM = "本当に'@'をBANしますか?\nBANするには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
PERM_BAN_CONFIRM = "本当に'@'を永久BANしますか?\nBANするには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
MOD_CONFIRM = "本当に'@'をモデレーターにしますか?\n'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
PLAYERS_DESC = "/players - プレイヤー名とID一覧を表示します。"
|
||||
KICK_DESC = "/kick [NAME|ID] - プレイヤーを現在のルームからキックします。"
|
||||
BAN_DESC = "/ban [NAME|ID] - プレイヤーを現在のルームからBANします。"
|
||||
PERM_BAN_DESC = "/permban [NAME|ID] - プレイヤーをあなたが今後ホストするすべてのルームからBANします。"
|
||||
MOD_DESC = "/moderator [NAME|ID] - プレイヤーに/kick、/ban、/permbanのようなコマンドの使用を許可します。"
|
||||
NAMETAGS_DESC = "/nametags [show-tag|show-health] - あなたの体力やネームタグの表示を変更します。"
|
||||
KICK_CONFIRM = "本当に @ をキックしますか?\n実行するには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
BAN_CONFIRM = "本当に @ をBANしますか?\nBANするには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
PERM_BAN_CONFIRM = "本当に @ を永久BANしますか?\nBANするには'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
MOD_CONFIRM = "本当に @ をモデレーターにしますか?\n'\\#a0ffa0\\/confirm\\#fff982\\' と入力して確定します。"
|
||||
PLAYERS_DESC = "/players - ルーム内のプレイヤー名とIDの一覧を表示します。"
|
||||
KICK_DESC = "/kick [プレイヤー名|ID] - 指定したプレイヤーを現在のルームからキックします。"
|
||||
BAN_DESC = "/ban [プレイヤー名|ID] - 指定したプレイヤーを現在のルームからBANします。"
|
||||
PERM_BAN_DESC = "/permban [プレイヤー名|ID] - 指定したプレイヤーをあなたが今後ホストするすべてのルームからBANします。"
|
||||
MOD_DESC = "/moderator [プレイヤー名|ID] - 指定したプレイヤーに/kick、/ban、/permbanのようなコマンドの使用を許可します。"
|
||||
NAMETAGS_DESC = "/nametags [show-tag|show-health] - あなたのネームタグ/体力の表示を変更します。"
|
||||
UNRECOGNIZED = "未知のコマンドです。"
|
||||
MOD_GRANTED = "\\#fff982\\あなたはモデレーターになりました。"
|
||||
|
||||
|
|
@ -70,8 +70,8 @@ CAMERA = "CAMERA"
|
|||
FREE_CAMERA = "フリーカメラ"
|
||||
ANALOG_CAMERA = "アナログカメラ"
|
||||
FREE_CAMERA_TITLE = "FREE CAMERA"
|
||||
FREE_CAMERA_L_CENTERING = "Lセンタリング"
|
||||
FREE_CAMERA_USE_DPAD = "DPad の動作"
|
||||
FREE_CAMERA_L_CENTERING = "Lボタンで前を向く"
|
||||
FREE_CAMERA_USE_DPAD = "十字キー操作"
|
||||
FREE_CAMERA_COLLISION = "カメラの衝突"
|
||||
ROMHACK_CAMERA_TITLE = "ROMHACK\nCAMERA"
|
||||
ROMHACK_CAMERA = "ロムハックカメラ"
|
||||
|
|
@ -79,26 +79,25 @@ ROMHACK_CAMERA_AUTOMATIC = "自動"
|
|||
ROMHACK_CAMERA_ON = "オン"
|
||||
ROMHACK_CAMERA_OFF = "オフ"
|
||||
ROMHACK_CAMERA_IN_BOWSER = "クッパ戦で使用"
|
||||
ROMHACK_CAMERA_COLLISION = "カメラの衝突"
|
||||
ROMHACK_CAMERA_L_CENTERING = "Lセンタリング"
|
||||
ROMHACK_CAMERA_USE_DPAD = "DPad の動作"
|
||||
ROMHACK_CAMERA_SLOW_FALL = "スローフォール"
|
||||
CAMERA_TOXIC_GAS = "有毒ガスの調整"
|
||||
ROMHACK_CAMERA_COLLISION = "カメラの当たり判定"
|
||||
ROMHACK_CAMERA_L_CENTERING = "Lボタンで前を向く"
|
||||
ROMHACK_CAMERA_USE_DPAD = "十字キー操作"
|
||||
ROMHACK_CAMERA_SLOW_FALL = "低速落下"
|
||||
CAMERA_TOXIC_GAS = "有毒ガス内での調整"
|
||||
MOUSE_LOOK = "マウスでの操作"
|
||||
INVERT_X = "X方向のカメラ反転"
|
||||
INVERT_Y = "Y方向のカメラ反転"
|
||||
X_SENSITIVITY = "X方向の感度"
|
||||
Y_SENSITIVITY = "Y方向の感度"
|
||||
AGGRESSION = "かたさ"
|
||||
PAN_LEVEL = "カメラのずれ"
|
||||
DECELERATION = "カメラ減速"
|
||||
ROMHACK_CAMERA_OFF = "オフ"
|
||||
AGGRESSION = "カメラの追従性"
|
||||
PAN_LEVEL = "カメラの水平速度"
|
||||
DECELERATION = "カメラ減速の強さ"
|
||||
|
||||
[CONTROLS]
|
||||
CONTROLS = "CONTROLS"
|
||||
|
||||
N64_BINDS = "ニンテンドウ64の入力"
|
||||
EXTRA_BINDS = "追加の入力"
|
||||
N64_BINDS = "ニンテンドウ64のボタン割り当て"
|
||||
EXTRA_BINDS = "追加のボタン割り当て"
|
||||
BACKGROUND_GAMEPAD = "バックグラウンドでのコントローラー認識"
|
||||
DISABLE_GAMEPADS = "コントローラーを無効化"
|
||||
GAMEPAD = "コントローラー"
|
||||
|
|
@ -106,28 +105,28 @@ DEADZONE = "デッドゾーン"
|
|||
RUMBLE_STRENGTH = "振動の強さ"
|
||||
|
||||
CHAT = "チャット"
|
||||
PLAYERS = "プレイヤーリストの表示"
|
||||
PLAYERS = "プレイヤーリスト"
|
||||
D_UP = "十字キー 上"
|
||||
D_DOWN = "十字キー 下"
|
||||
D_LEFT = "十字キー 左"
|
||||
D_RIGHT = "十字キー 右"
|
||||
X = "X"
|
||||
Y = "Y"
|
||||
X = "Xボタン"
|
||||
Y = "Yボタン"
|
||||
CONSOLE = "コンソール"
|
||||
PREV = "前のページ"
|
||||
NEXT = "次のページ"
|
||||
DISCONNECT = "切断"
|
||||
DISCONNECT = "ゲームから切断"
|
||||
|
||||
UP = "上"
|
||||
DOWN = "下"
|
||||
LEFT = "左"
|
||||
RIGHT = "右"
|
||||
A = "A"
|
||||
B = "B"
|
||||
START = "スタート"
|
||||
L = "L"
|
||||
R = "R"
|
||||
Z = "Z"
|
||||
UP = "3Dスティック 上"
|
||||
DOWN = "3Dスティック 下"
|
||||
LEFT = "3Dスティック 左"
|
||||
RIGHT = "3Dスティック 右"
|
||||
A = "Aボタン"
|
||||
B = "Bボタン"
|
||||
START = "STARTボタン"
|
||||
L = "Lトリガー"
|
||||
R = "Rトリガー"
|
||||
Z = "Zトリガー"
|
||||
C_UP = "Cボタン 上"
|
||||
C_DOWN = "Cボタン 下"
|
||||
C_LEFT = "Cボタン 左"
|
||||
|
|
@ -135,7 +134,7 @@ C_RIGHT = "Cボタン 右"
|
|||
|
||||
ANALOG_STICK_OPTIONS = "アナログスティックのオプション"
|
||||
|
||||
ROTATE_LEFT = "左スティックを90度回転させる"
|
||||
ROTATE_LEFT = "左スティックを90度回転"
|
||||
INVERT_LEFT_X = "左スティックX軸の反転"
|
||||
INVERT_LEFT_Y = "左スティックY軸の反転"
|
||||
ROTATE_RIGHT = "右スティックを90度回転"
|
||||
|
|
@ -153,7 +152,7 @@ AUTO = "自動"
|
|||
MANUAL = "手動"
|
||||
UNCAPPED = "無制限"
|
||||
FRAME_LIMIT = "FPSの制限"
|
||||
FAST = "速い"
|
||||
FAST = "高速"
|
||||
ACCURATE = "正確"
|
||||
INTERPOLATION = "補間"
|
||||
NEAREST = "ニアレスト"
|
||||
|
|
@ -196,24 +195,24 @@ LOCAL_PLAYER_MODEL_ONLY = "ローカルのキャラモデルに限定"
|
|||
|
||||
[HOST_MESSAGE]
|
||||
INFO_TITLE = "INFO"
|
||||
WARN_DISCORD = "招待したいフレンドを右クリックしてn'\\#d0d0ff\\ゲームに招待\\#dcdcdc\\'.\n\nを押すと招待できます。サーバー内のチャンネルにも、チャット横の\\#d0d0ff\\プラス\\#dcdcdc\\マークから招待メッセージを送信できます。\n\nゲーム アクティビティを\\#ffa0a0\\必ず\\#dcdcdc\\有効にしてください。\n\n\nオフラインに設定していると、招待の送信を\\#ffa0a0\\妨げる\\#dcdcdc\\可能性があります。"
|
||||
WARN_DISCORD2 = "\\#ffa0a0\\エラー:\\#dcdcdc\\Discordを検出できませんでした。\n\\#a0a0a0\\ゲームを終了し、Discordを再起動してから、もう一度お試しください。"
|
||||
WARN_SOCKET = "ファイアウォール設定が正しく設定されている事をご確認ください。\n直接接続には、ルータのポート転送でIPv4インバウンド接続を受信するように設定する\\#ffa0a0\\必要\\#dcdcdc\\があります。\n\nUDPポート'%d'番を開放してください。IPv6にも対応しています。"
|
||||
WARN_DISCORD = "招待したいフレンドを右クリックしてn'\\#d0d0ff\\ゲームに招待\\#dcdcdc\\'.\n\nを押すと招待できます。サーバー内のチャンネルにも、チャット入力欄の横にある\\#d0d0ff\\+\\#dcdcdc\\マークから招待メッセージを送信できます。\n\nDiscordのユーザー設定からゲーム アクティビティを\\#ffa0a0\\必ず\\#dcdcdc\\有効にしてください。\n\n\nステータスをオフラインに設定していると、招待の送信が\\#ffa0a0\\妨げられる\\#dcdcdc\\可能性があります。"
|
||||
WARN_DISCORD2 = "\\#ffa0a0\\エラー:\\#dcdcdc\\Discordを検出できませんでした。\n\\#a0a0a0\\ゲームを終了してDiscordを再起動してから、もう一度お試しください。"
|
||||
WARN_SOCKET = "ファイアウォールの設定が正しく完了していることを確認してください。\nダイレクト接続には\\#ffa0a0\\あなた自身が\\#dcdcdc\\ルーターでIPv4の接続を受け入れるようにポートフォワーディング設定を行う必要があります。\n\nUDPポート'\\#d0d0ff\\%d\\#dcdcdc\\'を解放してください。IPv6も使用可能です。"
|
||||
HOST = "ルームを作る"
|
||||
|
||||
[HOST_MODS]
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "カテゴリ一覧"
|
||||
WARNING = "\\#ffffa0\\<注意>\\#dcdcdc\\ MOD数が10個以上になっています。ラグや不安定を防ぐため、いくつか無効にしてください"
|
||||
NO_MODS_FOUND = "MODが見つかりませんでした。"
|
||||
WARNING = "\\#ffffa0\\<注意>\\#dcdcdc\\ MODの数が10個以上になっています。ラグや不安定を防ぐため、いくつか無効にしてください。"
|
||||
NO_MODS_FOUND = "MODは見つかりませんでした。"
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "すべて"
|
||||
MISC = "その他"
|
||||
ROMHACKS = "ハックロム"
|
||||
GAMEMODES = "ゲームモード"
|
||||
MOVESETS = "ムーブセット"
|
||||
CHARACTER_SELECT = "キャラクター選択"
|
||||
ROMHACKS = "ロムハック系"
|
||||
GAMEMODES = "ゲームモード系"
|
||||
MOVESETS = "ムーブセット系"
|
||||
CHARACTER_SELECT = "追加キャラクター系"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SAVE"
|
||||
|
|
@ -222,7 +221,7 @@ CONFIRM = "本当に消しますか?"
|
|||
ERASE = "消す"
|
||||
EDIT = "編集"
|
||||
EDIT_TITLE = "EDIT"
|
||||
EDIT_NAME = "ファイル名を変更:"
|
||||
EDIT_NAME = "マリオ @のおなまえ変更:"
|
||||
|
||||
[HOST_SETTINGS]
|
||||
SETTINGS = "SETTINGS"
|
||||
|
|
@ -235,7 +234,7 @@ NORMAL = "普通"
|
|||
TOO_MUCH = "最強"
|
||||
KNOCKBACK_STRENGTH = "ノックバックの強さ"
|
||||
CLASSIC_PVP = "クラシック"
|
||||
REVAMPED_PVP = "改良"
|
||||
REVAMPED_PVP = "改良型"
|
||||
PVP_MODE = "PvPモード"
|
||||
LEAVE_LEVEL = "コースを出る"
|
||||
STAY_IN_LEVEL = "コースに留まる"
|
||||
|
|
@ -243,14 +242,14 @@ NONSTOP = "ノンストップ"
|
|||
ON_STAR_COLLECTION = "スター取得時の動作"
|
||||
SKIP_INTRO_CUTSCENE = "イントロをスキップ"
|
||||
ENABLE_CHEATS = "チートを有効にする"
|
||||
BUBBLE_ON_DEATH = "やられた時にシャボンで復活"
|
||||
BUBBLE_ON_DEATH = "ミス時にシャボンで復活"
|
||||
NAMETAGS = "ネームタグを有効にする"
|
||||
MOD_DEV_MODE = "MOD開発モード"
|
||||
BOUNCY_BOUNDS_ON_CAP = "オン(制限付き)"
|
||||
BOUNCY_BOUNDS_ON_CAP = "オン(速度制限)"
|
||||
BOUNCY_BOUNDS_ON = "オン"
|
||||
BOUNCY_BOUNDS_OFF = "オフ"
|
||||
BOUNCY_LEVEL_BOUNDS = "コース境界での跳ね返り"
|
||||
AMOUNT_OF_PLAYERS = "最大人数"
|
||||
AMOUNT_OF_PLAYERS = "最大ルーム人数"
|
||||
PAUSE_ANYWHERE = "どこでもポーズ"
|
||||
|
||||
[HOST]
|
||||
|
|
@ -275,7 +274,7 @@ JOINING = "JOINING"
|
|||
[JOIN]
|
||||
JOIN_TITLE = "JOIN"
|
||||
JOIN_DISCORD = "\\#d0d0ff\\Discord\\#dcdcdc\\ロビーへの参加:\n\nゲームを開いたまま、招待メッセージの参加ボタンを押してください。\n\n「ゲームは終了しました」と表示されている場合は、招待を送信した人の名前をクリックして更新してください。"
|
||||
JOIN_SOCKET = "\\#d0d0ff\\ダイレクト接続\\#dcdcdc\\のIPとポートを入力してください:"
|
||||
JOIN_SOCKET = "\\#d0d0ff\\ダイレクト接続先\\#dcdcdc\\のIPアドレスとポート番号を入力してください:"
|
||||
JOIN = "参加する"
|
||||
PUBLIC_LOBBIES = "公開ルーム"
|
||||
PRIVATE_LOBBIES = "非公開ルーム"
|
||||
|
|
@ -283,14 +282,14 @@ DIRECT = "ダイレクト接続"
|
|||
|
||||
[RULES]
|
||||
RULES_TITLE = "RULES"
|
||||
RULE_1 = "1. 13歳以上であること。"
|
||||
RULE_2 = "2. 不快な言葉、中傷、攻撃的な言葉を使わないこと。"
|
||||
RULE_3 = "3. 非公式ビルドを使わないこと。"
|
||||
RULE_4 = "4. ゲームをエクスプロイトする外部ツールを使用しないこと。"
|
||||
RULE_5 = "5. 作者の許可なく、非公開MODを公開しないこと。"
|
||||
RULE_6 = "6. 全てのNSFWコンテンツは禁止です。"
|
||||
SUBJECT_TO_CHANGE = "ルールはアップデートで変更される可能性があります。"
|
||||
NOTICE = "公開ルームではルールをお守りください。"
|
||||
RULE_1 = "1. CoopNetの利用は13歳以上に限ります。"
|
||||
RULE_2 = "2. ハラスメント(嫌がらせ)、ヘイトスピーチ、差別用語、その他攻撃的な言動は禁止です。"
|
||||
RULE_3 = "3. CoopNetでは改造(改ざん)されていない正規のsm64coopdxのみが使用可能です。"
|
||||
RULE_4 = "4. ゲームの脆弱性を悪用するための外部ツールの使用は禁止です。"
|
||||
RULE_5 = "5. 作者の許可なく、未公開MODでルームをホストしないでください。"
|
||||
RULE_6 = "6. ポルノやフェティッシュなコンテンツは一切禁止されています。これにはMOD、キャラクター、成人向けロールプレイなどが含まれますが、これらに限定されません。"
|
||||
SUBJECT_TO_CHANGE = "これらのルールは今後のアップデートで変更される可能性があります。"
|
||||
NOTICE = "公開ルームでプレイするためにCoopNetへ接続した時点で、あなたはこれらのルールを遵守することに同意したものとみなされます。"
|
||||
RULES = "ルールを見る"
|
||||
|
||||
[MAIN]
|
||||
|
|
@ -307,27 +306,27 @@ LEVEL = "コース"
|
|||
STAFF_ROLL = "スタッフロール"
|
||||
MUSIC = "BGM"
|
||||
RANDOM_STAGE = "ランダムなステージ"
|
||||
PLAY_VANILLA_DEMOS = "バニラゲームのデモを再生"
|
||||
PLAY_VANILLA_DEMOS = "オリジナルゲームのデモを再生"
|
||||
|
||||
[MISC]
|
||||
DEBUG_TITLE = "DEBUG"
|
||||
FIXED_COLLISIONS = "修正された当たり判定"
|
||||
LUA_PROFILER = "Luaのプロファイラー"
|
||||
CTX_PROFILER = "Ctxのプロファイラー"
|
||||
DEBUG_PRINT = "デバッグ情報の表示"
|
||||
DEBUG_INFO = "デバッグの情報"
|
||||
DEBUG_ERRORS = "デバッグのエラー"
|
||||
DEBUG_PRINT = "デバッグログの表示"
|
||||
DEBUG_INFO = "デバッグ情報の表示"
|
||||
DEBUG_ERRORS = "デバッグエラーの表示"
|
||||
MISC_TITLE = "MISC"
|
||||
PAUSE_IN_SINGLEPLAYER = "ソロプレイでの一時停止"
|
||||
PAUSE_IN_SINGLEPLAYER = "1人プレイ中にポーズで一時停止を有効化"
|
||||
DISABLE_POPUPS = "ポップアップを無効にする"
|
||||
USE_STANDARD_KEY_BINDINGS_CHAT = "初期のチャット操作"
|
||||
USE_STANDARD_KEY_BINDINGS_CHAT = "旧式チャット操作"
|
||||
MENU_OPTIONS = "メニューの設定"
|
||||
INFORMATION = "情報"
|
||||
DEBUG = "デバッグ"
|
||||
LANGUAGE = "言語"
|
||||
COOP_COMPATIBILITY = "sm64ex-coopとの互換性を有効にする"
|
||||
R_BUTTON = "Rボタン - 設定"
|
||||
L_BUTTON = "Lボタン - アクティブなMODを再読み込み"
|
||||
L_BUTTON = "Lボタン - 有効化されたMODを再読み込み"
|
||||
|
||||
[INFORMATION]
|
||||
INFORMATION_TITLE = "INFO"
|
||||
|
|
@ -371,7 +370,7 @@ PLAYER_TITLE = "PLAYER"
|
|||
OVERALLS = "オーバーオール"
|
||||
SHIRT = "シャツ"
|
||||
GLOVES = "手袋"
|
||||
SHOES = "くつ"
|
||||
SHOES = "クツ"
|
||||
HAIR = "髪"
|
||||
SKIN = "肌"
|
||||
CAP = "帽子"
|
||||
|
|
@ -408,8 +407,8 @@ MASTER_VOLUME = "主音量"
|
|||
MUSIC_VOLUME = "BGM音量"
|
||||
SFX_VOLUME = "SE音量"
|
||||
ENV_VOLUME = "環境音量"
|
||||
FADEOUT = "遠い音のフェードアウト"
|
||||
MUTE_FOCUS_LOSS = "非フォーカス時にミュート"
|
||||
FADEOUT = "音の距離減衰"
|
||||
MUTE_FOCUS_LOSS = "非フォーカス時に音をミュート"
|
||||
|
||||
[LANGUAGE]
|
||||
LANGUAGE = "LANGUAGE"
|
||||
|
|
@ -428,12 +427,11 @@ Spanish = "スペイン語 (Español)"
|
|||
[LOBBIES]
|
||||
PUBLIC_LOBBIES = "PUBLIC ROOMS"
|
||||
PRIVATE_LOBBIES = "PRIVATE ROOMS"
|
||||
REFRESH = "更新"
|
||||
REFRESH = "更新する"
|
||||
REFRESHING = "更新中…"
|
||||
ENTER_PASSWORD = "部屋のパスワードを入力してください:"
|
||||
ENTER_PASSWORD = "ルームのパスワードを入力してください:"
|
||||
SEARCH = "検索"
|
||||
NONE_FOUND = "部屋が見つかりませんでした"
|
||||
NO_LOBBIES_FOUND = "ロビーは見つからなかった。"
|
||||
NO_LOBBIES_FOUND = "ルームが見つかりませんでした。"
|
||||
|
||||
[CHANGELOG]
|
||||
CHANGELOG_TITLE = "CHANGELOG"
|
||||
|
|
|
|||
Binary file not shown.
BIN
mods/sm74/actors/mad_toad_geo.bin
Normal file
BIN
mods/sm74/actors/mad_toad_geo.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -52,6 +52,9 @@ function check_mario_attacking(obj, mario)
|
|||
if mario.action == ACT_WALL_KICK_AIR then
|
||||
return 2
|
||||
end
|
||||
if (mario.action & ACT_FLAG_CUSTOM_ACTION ~= 0) and (mario.action & ACT_FLAG_ATTACKING ~= 0) then
|
||||
return 2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -121,4 +124,4 @@ function object_drop_to_floor(obj)
|
|||
local floorHeight = find_floor_height(x, y + 200, z)
|
||||
obj.oPosY = floorHeight
|
||||
obj.oMoveFlags = (obj.oMoveFlags | OBJ_MOVE_ON_GROUND)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
BIN
mods/star-road/textures/cannon_lid_seg8_texture_08004058.tex
Normal file
BIN
mods/star-road/textures/cannon_lid_seg8_texture_08004058.tex
Normal file
Binary file not shown.
BIN
res/icon.icns
BIN
res/icon.icns
Binary file not shown.
BIN
res/icon.icon/Assets/icon.png
Normal file
BIN
res/icon.icon/Assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
35
res/icon.icon/icon.json
Normal file
35
res/icon.icon/icon.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"fill" : "automatic",
|
||||
"groups" : [
|
||||
{
|
||||
"layers" : [
|
||||
{
|
||||
"image-name" : "icon.png",
|
||||
"name" : "icon",
|
||||
"position" : {
|
||||
"scale" : 3.5,
|
||||
"translation-in-points" : [
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"shadow" : {
|
||||
"kind" : "neutral",
|
||||
"opacity" : 0.5
|
||||
},
|
||||
"specular" : false,
|
||||
"translucency" : {
|
||||
"enabled" : false,
|
||||
"value" : 0.5
|
||||
}
|
||||
}
|
||||
],
|
||||
"supported-platforms" : {
|
||||
"circles" : [
|
||||
"watchOS"
|
||||
],
|
||||
"squares" : "shared"
|
||||
}
|
||||
}
|
||||
|
|
@ -1694,6 +1694,9 @@ static void update_game_sound(void) {
|
|||
break;
|
||||
case SOUND_BANK_ACTION:
|
||||
case SOUND_BANK_MARIO_VOICE:
|
||||
case SOUND_BANK_LUIGI_VOICE:
|
||||
case SOUND_BANK_WARIO_VOICE:
|
||||
case SOUND_BANK_TOAD_VOICE:
|
||||
#if defined(VERSION_EU) || defined(VERSION_SH)
|
||||
queue_audio_cmd_s8(AUDIO_CMD_ARGS(AUDIO_CMD_REVERB, SEQ_PLAYER_SFX, channelIndex, 0),
|
||||
get_sound_reverb(bank, soundIndex, channelIndex));
|
||||
|
|
|
|||
|
|
@ -1481,6 +1481,13 @@ u8 get_missing_bank(u32 seqId, s32 *nonNullCount, s32 *nullCount) {
|
|||
#endif
|
||||
|
||||
#ifndef VERSION_SH
|
||||
|
||||
s32 gOverrideBank = -1;
|
||||
|
||||
void set_sound_bank_override(s32 bank) {
|
||||
gOverrideBank = bank;
|
||||
}
|
||||
|
||||
struct AudioBank *load_banks_immediate(s32 seqId, u8 *arg1) {
|
||||
void *ret = NULL;
|
||||
u32 bankId = 0;
|
||||
|
|
@ -1498,6 +1505,10 @@ struct AudioBank *load_banks_immediate(s32 seqId, u8 *arg1) {
|
|||
bankId = gAlBankSets[offset - 1];
|
||||
#endif
|
||||
|
||||
if (gOverrideBank > 0) {
|
||||
bankId = gOverrideBank;
|
||||
}
|
||||
|
||||
if (IS_BANK_LOAD_COMPLETE(bankId) == TRUE) {
|
||||
#ifdef VERSION_EU
|
||||
ret = get_bank_or_seq(&gBankLoadedPool, 2, bankId);
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ extern s32 gMinAiBufferLength;
|
|||
extern s16 gTempoInternalToExternal;
|
||||
extern s8 gAudioUpdatesPerFrame; // = 4
|
||||
extern s8 gSoundMode;
|
||||
extern s32 gOverrideBank;
|
||||
|
||||
#ifdef VERSION_SH
|
||||
extern OSMesgQueue gUnkQueue1;
|
||||
|
|
@ -95,6 +96,9 @@ void preload_sequence(u32 seqId, u8 preloadMask);
|
|||
#endif
|
||||
void load_sequence(u32 player, u32 seqId, s32 loadAsync);
|
||||
|
||||
/* |description|Overrides the soundbank, set to -1 to reset|descriptionEnd| */
|
||||
void set_sound_bank_override(s32 bank);
|
||||
|
||||
#ifdef VERSION_SH
|
||||
void func_sh_802f3158(s32 index, s32 arg1, s32 arg2, OSMesgQueue *retQueue);
|
||||
u8 *func_sh_802f3220(u32 index, u32 *a1);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ struct SequenceChannel *allocate_sequence_channel(void) {
|
|||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOG_ERROR("RAN OUT OF SEQUENCE CHANNELS FOR ALLOCATION!");
|
||||
return &gSequenceChannelNone;
|
||||
}
|
||||
|
|
@ -281,7 +281,7 @@ void sequence_player_init_channels_extended(struct SequencePlayer* seqPlayer, u6
|
|||
if (!seqPlayer) { return; }
|
||||
u64 channelBits = channelBitsLower;
|
||||
LOG_DEBUG("Enabling channels (extended) with corresponding bits %llX", channelBits);
|
||||
|
||||
|
||||
for (u32 i = 0; i < CHANNELS_MAX; i++) {
|
||||
if (i == sizeof(u64) * 8) {
|
||||
channelBits = channelBitsUpper;
|
||||
|
|
@ -350,9 +350,9 @@ void sequence_player_disable_channels_extended(struct SequencePlayer* seqPlayer,
|
|||
|
||||
void sequence_player_disable_all_channels(struct SequencePlayer *seqPlayer) {
|
||||
if (!seqPlayer) { return; }
|
||||
|
||||
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
eu_stubbed_printf_0("SUBTRACK DIM\n");
|
||||
for (u32 i = 0; i < CHANNELS_MAX; i++) {
|
||||
struct SequenceChannel *seqChannel = seqPlayer->channels[i];
|
||||
|
|
@ -371,16 +371,16 @@ void sequence_player_disable_all_channels(struct SequencePlayer *seqPlayer) {
|
|||
seqPlayer->channels[i] = &gSequenceChannelNone;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex, void *script) {
|
||||
if (!seqPlayer) { return; }
|
||||
if (channelIndex >= CHANNELS_MAX) { return; }
|
||||
|
||||
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
struct SequenceChannel *seqChannel = seqPlayer->channels[channelIndex];
|
||||
s32 i;
|
||||
if (IS_SEQUENCE_CHANNEL_VALID(seqChannel) == FALSE) {
|
||||
|
|
@ -409,19 +409,19 @@ void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex,
|
|||
seq_channel_layer_free(seqChannel, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOG_DEBUG("Enabled sequence channel %d with script entry of %p", channelIndex, script);
|
||||
}
|
||||
|
||||
|
||||
MUTEX_UNLOCK(gAudioThread);
|
||||
}
|
||||
|
||||
void sequence_player_disable(struct SequencePlayer *seqPlayer) {
|
||||
if (!seqPlayer) { return; }
|
||||
MUTEX_LOCK(gAudioThread);
|
||||
|
||||
|
||||
LOG_DEBUG("Disabling sequence player %p", seqPlayer);
|
||||
|
||||
|
||||
sequence_player_disable_all_channels(seqPlayer);
|
||||
note_pool_clear(&seqPlayer->notePool);
|
||||
seqPlayer->finished = TRUE;
|
||||
|
|
@ -1620,7 +1620,7 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume
|
|||
}
|
||||
|
||||
void set_instrument(struct SequenceChannel *seqChannel, u8 instId) {
|
||||
if (instId >= 0x80) {
|
||||
if (instId >= 0x80 && instId <= 0x83) {
|
||||
seqChannel->instOrWave = instId;
|
||||
seqChannel->instrument = NULL;
|
||||
} else if (instId == 0x7f) {
|
||||
|
|
|
|||
|
|
@ -797,7 +797,22 @@ static s32 bhv_cmd_load_collision_data(void) {
|
|||
// Command 0x2D: Sets the home position of the object to its current position.
|
||||
// Usage: SET_HOME()
|
||||
static s32 bhv_cmd_set_home(void) {
|
||||
if (!(gCurrentObject->coopFlags & (COOP_OBJ_FLAG_LUA | COOP_OBJ_FLAG_NETWORK))) {
|
||||
// COOP: only set home via behavior for the following cases
|
||||
if (
|
||||
// if the object wasn't created via Lua
|
||||
!(gCurrentObject->coopFlags & COOP_OBJ_FLAG_LUA)
|
||||
// if the object wasn't created via network
|
||||
// OR
|
||||
// the object has never had its home set via behavior AND its home is default (e.g. (0, 0, 0))
|
||||
// (this case handles an object that needs its home set via behavior after being spawned by another player)
|
||||
&& (
|
||||
!(gCurrentObject->coopFlags & COOP_OBJ_FLAG_NETWORK)
|
||||
|| (
|
||||
!gCurrentObject->setHome
|
||||
&& gCurrentObject->oHomeX == 0.0f && gCurrentObject->oHomeY == 0.0f && gCurrentObject->oHomeZ == 0.0f
|
||||
)
|
||||
)
|
||||
) {
|
||||
gCurrentObject->oHomeX = gCurrentObject->oPosX;
|
||||
gCurrentObject->oHomeY = gCurrentObject->oPosY;
|
||||
gCurrentObject->oHomeZ = gCurrentObject->oPosZ;
|
||||
|
|
@ -988,7 +1003,7 @@ static s32 bhv_cmd_call_native_ext(void) {
|
|||
|
||||
const char *funcStr = dynos_behavior_get_token(behavior, BHV_CMD_GET_U32(1));
|
||||
if (!funcStr) {
|
||||
LOG_LUA("Could not retrieve function name from behavior command. Do you have an unclosed behavior script?");
|
||||
LOG_LUA("Could not retrieve function name from behavior command.");
|
||||
gCurBhvCommand += 2;
|
||||
return BHV_PROC_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ struct GraphNodeBackground *init_graph_node_background(struct DynamicPool *pool,
|
|||
: (backgroundFunc && background >= BACKGROUND_CUSTOM);
|
||||
|
||||
if (invalidBackground) {
|
||||
LOG_ERROR("invalid background id");
|
||||
LOG_ERROR("invalid background id %d", background);
|
||||
background = BACKGROUND_HAUNTED;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,382 +0,0 @@
|
|||
#include "lighting_engine.h"
|
||||
#include "math_util.h"
|
||||
|
||||
struct LELight
|
||||
{
|
||||
f32 posX;
|
||||
f32 posY;
|
||||
f32 posZ;
|
||||
u8 colorR;
|
||||
u8 colorG;
|
||||
u8 colorB;
|
||||
f32 radius;
|
||||
f32 intensity;
|
||||
bool added;
|
||||
bool useSurfaceNormals;
|
||||
};
|
||||
|
||||
Color gLEAmbientColor = { 127, 127, 127 };
|
||||
static struct LELight sLights[LE_MAX_LIGHTS] = { 0 };
|
||||
static enum LEMode sMode = LE_MODE_AFFECT_ALL_SHADED_AND_COLORED;
|
||||
static enum LEToneMapping sToneMapping = LE_TONE_MAPPING_WEIGHTED;
|
||||
static bool sEnabled = false;
|
||||
|
||||
static inline void color_set(Color color, u8 r, u8 g, u8 b) {
|
||||
color[0] = r;
|
||||
color[1] = g;
|
||||
color[2] = b;
|
||||
}
|
||||
|
||||
static inline void color_copy(Color dest, Color src) {
|
||||
dest[0] = src[0];
|
||||
dest[1] = src[1];
|
||||
dest[2] = src[2];
|
||||
}
|
||||
|
||||
bool le_is_enabled(void) {
|
||||
// this is needed because we don't want to make vanilla darker,
|
||||
// and we don't want to set the ambient color to { 255, 255, 255 }
|
||||
// because then no one could see the effect of their lights
|
||||
return sEnabled;
|
||||
}
|
||||
|
||||
void le_set_mode(enum LEMode mode) {
|
||||
sMode = mode;
|
||||
}
|
||||
|
||||
enum LEMode le_get_mode(void) {
|
||||
return sMode;
|
||||
}
|
||||
|
||||
void le_set_tone_mapping(enum LEToneMapping toneMapping) {
|
||||
sToneMapping = toneMapping;
|
||||
}
|
||||
|
||||
void le_get_ambient_color(VEC_OUT Color out) {
|
||||
color_copy(out, gLEAmbientColor);
|
||||
}
|
||||
|
||||
void le_set_ambient_color(u8 r, u8 g, u8 b) {
|
||||
color_set(gLEAmbientColor, r, g, b);
|
||||
sEnabled = true;
|
||||
}
|
||||
|
||||
static inline void le_tone_map_total_weighted(Color out, Color inAmbient, Vec3f inColor, float weight) {
|
||||
out[0] = clamp((inAmbient[0] + inColor[0]) / weight, 0, 255);
|
||||
out[1] = clamp((inAmbient[1] + inColor[1]) / weight, 0, 255);
|
||||
out[2] = clamp((inAmbient[2] + inColor[2]) / weight, 0, 255);
|
||||
}
|
||||
|
||||
static inline void le_tone_map_weighted(Color out, Color inAmbient, Vec3f inColor, float weight) {
|
||||
out[0] = clamp(inAmbient[0] + (inColor[0] / weight), 0, 255);
|
||||
out[1] = clamp(inAmbient[1] + (inColor[1] / weight), 0, 255);
|
||||
out[2] = clamp(inAmbient[2] + (inColor[2] / weight), 0, 255);
|
||||
}
|
||||
|
||||
static inline void le_tone_map_clamp(Color out, Color inAmbient, Vec3f inColor) {
|
||||
out[0] = clamp(inAmbient[0] + inColor[0], 0, 255);
|
||||
out[1] = clamp(inAmbient[1] + inColor[1], 0, 255);
|
||||
out[2] = clamp(inAmbient[2] + inColor[2], 0, 255);
|
||||
}
|
||||
|
||||
static inline void le_tone_map_reinhard(Color out, Color inAmbient, Vec3f inColor) {
|
||||
inColor[0] += inAmbient[0];
|
||||
inColor[1] += inAmbient[1];
|
||||
inColor[2] += inAmbient[2];
|
||||
|
||||
out[0] = clamp((inColor[0] / (inColor[0] + 255.0f)) * 255.0f, 0, 255);
|
||||
out[1] = clamp((inColor[1] / (inColor[1] + 255.0f)) * 255.0f, 0, 255);
|
||||
out[2] = clamp((inColor[2] / (inColor[2] + 255.0f)) * 255.0f, 0, 255);
|
||||
}
|
||||
|
||||
static inline void le_tone_map(Color out, Color inAmbient, Vec3f inColor, float weight) {
|
||||
switch (sToneMapping) {
|
||||
case LE_TONE_MAPPING_TOTAL_WEIGHTED: le_tone_map_total_weighted(out, inAmbient, inColor, weight); break;
|
||||
case LE_TONE_MAPPING_WEIGHTED: le_tone_map_weighted(out, inAmbient, inColor, weight); break;
|
||||
case LE_TONE_MAPPING_CLAMP: le_tone_map_clamp(out, inAmbient, inColor); break;
|
||||
case LE_TONE_MAPPING_REINHARD: le_tone_map_reinhard(out, inAmbient, inColor); break;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void le_calculate_light_contribution(struct LELight* light, Vec3f pos, Vec3f normal, f32 lightIntensityScalar, Vec3f out_color, f32* weight) {
|
||||
// skip 'inactive' lights
|
||||
if (light->intensity <= 0 || light->radius <= 0) { return; }
|
||||
|
||||
// vector to light
|
||||
f32 diffX = light->posX - pos[0];
|
||||
f32 diffY = light->posY - pos[1];
|
||||
f32 diffZ = light->posZ - pos[2];
|
||||
|
||||
// squared distance check
|
||||
f32 dist2 = (diffX * diffX) + (diffY * diffY) + (diffZ * diffZ);
|
||||
f32 radius2 = light->radius * light->radius;
|
||||
if (dist2 > radius2 || dist2 <= 0) { return; }
|
||||
|
||||
// attenuation & intensity
|
||||
f32 att = 1.0f - (dist2 / radius2);
|
||||
f32 brightness = att * light->intensity * lightIntensityScalar;
|
||||
|
||||
// normalize diff
|
||||
f32 invLen = 1.0f / sqrtf(dist2);
|
||||
diffX *= invLen;
|
||||
diffY *= invLen;
|
||||
diffZ *= invLen;
|
||||
|
||||
if (light->useSurfaceNormals && normal) {
|
||||
// lambert term
|
||||
f32 nl = (normal[0] * diffX) + (normal[1] * diffY) + (normal[2] * diffZ);
|
||||
if (nl <= 0.0f) { return; }
|
||||
|
||||
// modulate by normal
|
||||
brightness *= nl;
|
||||
}
|
||||
|
||||
// accumulate
|
||||
out_color[0] += light->colorR * brightness;
|
||||
out_color[1] += light->colorG * brightness;
|
||||
out_color[2] += light->colorB * brightness;
|
||||
*weight += brightness;
|
||||
}
|
||||
|
||||
void le_calculate_vertex_lighting(Vtx_t* v, Vec3f pos, Color out) {
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
struct LELight* light = &sLights[i];
|
||||
if (!light->added) { continue; }
|
||||
|
||||
le_calculate_light_contribution(light, pos, NULL, 1.0f, color, &weight);
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
Color vtxAmbient = {
|
||||
v->cn[0] * (gLEAmbientColor[0] / 255.0f),
|
||||
v->cn[1] * (gLEAmbientColor[1] / 255.0f),
|
||||
v->cn[2] * (gLEAmbientColor[2] / 255.0f),
|
||||
};
|
||||
le_tone_map(out, vtxAmbient, color, weight);
|
||||
}
|
||||
|
||||
void le_calculate_lighting_color(Vec3f pos, Color out, f32 lightIntensityScalar) {
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
struct LELight* light = &sLights[i];
|
||||
if (!light->added) { continue; }
|
||||
|
||||
le_calculate_light_contribution(light, pos, NULL, lightIntensityScalar, color, &weight);
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
le_tone_map(out, gLEAmbientColor, color, weight);
|
||||
}
|
||||
|
||||
void le_calculate_lighting_color_with_normal(Vec3f pos, Vec3f normal, Color out, f32 lightIntensityScalar) {
|
||||
// normalize normal
|
||||
if (normal) { vec3f_normalize(normal); }
|
||||
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
struct LELight* light = &sLights[i];
|
||||
if (!light->added) { continue; }
|
||||
|
||||
le_calculate_light_contribution(light, pos, normal, lightIntensityScalar, color, &weight);
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
le_tone_map(out, gLEAmbientColor, color, weight);
|
||||
}
|
||||
|
||||
void le_calculate_lighting_dir(Vec3f pos, Vec3f out) {
|
||||
Vec3f lightingDir = { 0, 0, 0 };
|
||||
s16 count = 1;
|
||||
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
struct LELight* light = &sLights[i];
|
||||
if (!light->added) { continue; }
|
||||
|
||||
f32 diffX = light->posX - pos[0];
|
||||
f32 diffY = light->posY - pos[1];
|
||||
f32 diffZ = light->posZ - pos[2];
|
||||
f32 dist = (diffX * diffX) + (diffY * diffY) + (diffZ * diffZ);
|
||||
f32 radius = light->radius * light->radius;
|
||||
if (dist > radius) { continue; }
|
||||
|
||||
Vec3f dir = {
|
||||
pos[0] - light->posX,
|
||||
pos[1] - light->posY,
|
||||
pos[2] - light->posZ,
|
||||
};
|
||||
vec3f_normalize(dir);
|
||||
|
||||
f32 intensity = (1 - (dist / radius)) * light->intensity;
|
||||
lightingDir[0] += dir[0] * intensity;
|
||||
lightingDir[1] += dir[1] * intensity;
|
||||
lightingDir[2] += dir[2] * intensity;
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
out[0] = lightingDir[0] / (f32)(count);
|
||||
out[1] = lightingDir[1] / (f32)(count);
|
||||
out[2] = lightingDir[2] / (f32)(count);
|
||||
vec3f_normalize(out);
|
||||
}
|
||||
|
||||
s16 le_add_light(f32 x, f32 y, f32 z, u8 r, u8 g, u8 b, f32 radius, f32 intensity) {
|
||||
struct LELight* newLight = NULL;
|
||||
s16 lightID = -1;
|
||||
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
struct LELight* light = &sLights[i];
|
||||
if (!light->added) {
|
||||
newLight = light;
|
||||
lightID = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (newLight == NULL) { return -1; }
|
||||
|
||||
newLight->posX = x;
|
||||
newLight->posY = y;
|
||||
newLight->posZ = z;
|
||||
newLight->colorR = r;
|
||||
newLight->colorG = g;
|
||||
newLight->colorB = b;
|
||||
newLight->radius = radius;
|
||||
newLight->intensity = intensity;
|
||||
newLight->added = true;
|
||||
newLight->useSurfaceNormals = true;
|
||||
|
||||
sEnabled = true;
|
||||
return lightID;
|
||||
}
|
||||
|
||||
void le_remove_light(s16 id) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
memset(&sLights[id], 0, sizeof(struct LELight));
|
||||
}
|
||||
|
||||
s16 le_get_light_count(void) {
|
||||
s16 count = 0;
|
||||
for (s16 i = 0; i < LE_MAX_LIGHTS; i++) {
|
||||
if (sLights[i].added) { count++; }
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
bool le_light_exists(s16 id) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return false; }
|
||||
return sLights[id].added;
|
||||
}
|
||||
|
||||
void le_get_light_pos(s16 id, VEC_OUT Vec3f out) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
vec3f_set(out, light->posX, light->posY, light->posZ);
|
||||
}
|
||||
|
||||
void le_set_light_pos(s16 id, f32 x, f32 y, f32 z) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
light->posX = x;
|
||||
light->posY = y;
|
||||
light->posZ = z;
|
||||
}
|
||||
|
||||
void le_get_light_color(s16 id, VEC_OUT Color out) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
color_set(out, light->colorR, light->colorG, light->colorB);
|
||||
}
|
||||
|
||||
void le_set_light_color(s16 id, u8 r, u8 g, u8 b) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
light->colorR = r;
|
||||
light->colorG = g;
|
||||
light->colorB = b;
|
||||
}
|
||||
|
||||
f32 le_get_light_radius(s16 id) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return 0.0f; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return 0.0f; }
|
||||
return light->radius;
|
||||
}
|
||||
|
||||
void le_set_light_radius(s16 id, f32 radius) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
light->radius = radius;
|
||||
}
|
||||
|
||||
f32 le_get_light_intensity(s16 id) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return 0.0f; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return 0.0f; }
|
||||
return light->intensity;
|
||||
}
|
||||
|
||||
void le_set_light_intensity(s16 id, f32 intensity) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
light->intensity = intensity;
|
||||
}
|
||||
|
||||
bool le_get_light_use_surface_normals(s16 id) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return false; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return false; }
|
||||
return light->useSurfaceNormals;
|
||||
}
|
||||
|
||||
void le_set_light_use_surface_normals(s16 id, bool useSurfaceNormals) {
|
||||
if (id < 0 || id >= LE_MAX_LIGHTS) { return; }
|
||||
|
||||
struct LELight* light = &sLights[id];
|
||||
if (!light->added) { return; }
|
||||
light->useSurfaceNormals = useSurfaceNormals;
|
||||
}
|
||||
|
||||
void le_clear(void) {
|
||||
memset(&sLights, 0, sizeof(struct LELight) * LE_MAX_LIGHTS);
|
||||
|
||||
gLEAmbientColor[0] = 127;
|
||||
gLEAmbientColor[1] = 127;
|
||||
gLEAmbientColor[2] = 127;
|
||||
}
|
||||
|
||||
void le_shutdown(void) {
|
||||
sEnabled = false;
|
||||
sMode = LE_MODE_AFFECT_ALL_SHADED_AND_COLORED;
|
||||
sToneMapping = LE_TONE_MAPPING_WEIGHTED;
|
||||
le_clear();
|
||||
}
|
||||
444
src/engine/lighting_engine.cpp
Normal file
444
src/engine/lighting_engine.cpp
Normal file
|
|
@ -0,0 +1,444 @@
|
|||
#include "lighting_engine.h"
|
||||
extern "C" {
|
||||
#include "math_util.h"
|
||||
#include "pc/lua/smlua.h"
|
||||
}
|
||||
#undef clamp
|
||||
#undef min
|
||||
#undef max
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#ifdef __SSE__
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
|
||||
#define C_FIELD extern "C"
|
||||
|
||||
struct LELight
|
||||
{
|
||||
s16 id;
|
||||
Vec3f pos;
|
||||
Color color;
|
||||
f32 radius;
|
||||
f32 intensity;
|
||||
bool useSurfaceNormals;
|
||||
};
|
||||
|
||||
Color gLEAmbientColor = { 127, 127, 127 };
|
||||
static std::vector<LELight> sLightPool;
|
||||
static std::vector<LELight*> sActiveLights;
|
||||
static s16 sLightID = -1;
|
||||
static enum LEMode sMode = LE_MODE_AFFECT_ALL_SHADED_AND_COLORED;
|
||||
static enum LEToneMapping sToneMapping = LE_TONE_MAPPING_WEIGHTED;
|
||||
static bool sEnabled = false;
|
||||
static u8 sMaxLightsPerVertex = 4;
|
||||
|
||||
static inline f32 rsqrt(f32 value) {
|
||||
#ifdef __SSE__
|
||||
return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(value)));
|
||||
#else
|
||||
return 1.0f / sqrtf(value);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void color_set(Color color, u8 r, u8 g, u8 b) {
|
||||
color[0] = r;
|
||||
color[1] = g;
|
||||
color[2] = b;
|
||||
}
|
||||
|
||||
static inline void color_copy(Color dest, Color src) {
|
||||
dest[0] = src[0];
|
||||
dest[1] = src[1];
|
||||
dest[2] = src[2];
|
||||
}
|
||||
|
||||
static inline u8 clamp_u8(f32 value) {
|
||||
s32 v = (s32)value;
|
||||
v = v < 0 ? 0 : v;
|
||||
v = v > 255 ? 255 : v;
|
||||
return (u8)v;
|
||||
}
|
||||
|
||||
C_FIELD bool le_is_enabled(void) {
|
||||
// this is needed because we don't want to make vanilla darker,
|
||||
// and we don't want to set the ambient color to { 255, 255, 255 }
|
||||
// because then no one could see the effect of their lights
|
||||
return sEnabled;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_mode(enum LEMode mode) {
|
||||
sMode = mode;
|
||||
}
|
||||
|
||||
C_FIELD enum LEMode le_get_mode(void) {
|
||||
return sMode;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_tone_mapping(enum LEToneMapping toneMapping) {
|
||||
sToneMapping = toneMapping;
|
||||
}
|
||||
|
||||
C_FIELD void le_get_ambient_color(VEC_OUT Color out) {
|
||||
color_copy(out, gLEAmbientColor);
|
||||
}
|
||||
|
||||
C_FIELD void le_set_ambient_color(u8 r, u8 g, u8 b) {
|
||||
color_set(gLEAmbientColor, r, g, b);
|
||||
sEnabled = true;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_max_lights_per_vertex(u8 count) {
|
||||
sMaxLightsPerVertex = count;
|
||||
}
|
||||
|
||||
static inline void le_tone_map_total_weighted(Color out, Color inAmbient, Vec3f inColor, f32 weight) {
|
||||
out[0] = clamp_u8((inAmbient[0] + inColor[0]) / weight);
|
||||
out[1] = clamp_u8((inAmbient[1] + inColor[1]) / weight);
|
||||
out[2] = clamp_u8((inAmbient[2] + inColor[2]) / weight);
|
||||
}
|
||||
|
||||
static inline void le_tone_map_weighted(Color out, Color inAmbient, Vec3f inColor, f32 weight) {
|
||||
out[0] = clamp_u8(inAmbient[0] + (inColor[0] / weight));
|
||||
out[1] = clamp_u8(inAmbient[1] + (inColor[1] / weight));
|
||||
out[2] = clamp_u8(inAmbient[2] + (inColor[2] / weight));
|
||||
}
|
||||
|
||||
static inline void le_tone_map_clamp(Color out, Color inAmbient, Vec3f inColor) {
|
||||
out[0] = clamp_u8(inAmbient[0] + inColor[0]);
|
||||
out[1] = clamp_u8(inAmbient[1] + inColor[1]);
|
||||
out[2] = clamp_u8(inAmbient[2] + inColor[2]);
|
||||
}
|
||||
|
||||
static inline void le_tone_map_reinhard(Color out, Color inAmbient, Vec3f inColor) {
|
||||
inColor[0] += inAmbient[0];
|
||||
inColor[1] += inAmbient[1];
|
||||
inColor[2] += inAmbient[2];
|
||||
|
||||
out[0] = clamp_u8((inColor[0] / (inColor[0] + 255.0f)) * 255.0f);
|
||||
out[1] = clamp_u8((inColor[1] / (inColor[1] + 255.0f)) * 255.0f);
|
||||
out[2] = clamp_u8((inColor[2] / (inColor[2] + 255.0f)) * 255.0f);
|
||||
}
|
||||
|
||||
static void le_tone_map(Color out, Color inAmbient, Vec3f inColor, f32 weight) {
|
||||
switch (sToneMapping) {
|
||||
case LE_TONE_MAPPING_TOTAL_WEIGHTED: le_tone_map_total_weighted(out, inAmbient, inColor, weight); break;
|
||||
case LE_TONE_MAPPING_WEIGHTED: le_tone_map_weighted(out, inAmbient, inColor, weight); break;
|
||||
case LE_TONE_MAPPING_CLAMP: le_tone_map_clamp(out, inAmbient, inColor); break;
|
||||
case LE_TONE_MAPPING_REINHARD: le_tone_map_reinhard(out, inAmbient, inColor); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void le_update_active_lights() {
|
||||
sActiveLights.clear();
|
||||
for (auto& light : sLightPool) {
|
||||
if (light.intensity > 0.0f && light.radius > 0.0f) {
|
||||
sActiveLights.push_back(&light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline OPTIMIZE_O3 void le_calculate_light_contribution(const LELight& light, Vec3f pos, Vec3f normal, f32 lightIntensityScalar, Vec3f outColor, f32& weight, u8& contribution) {
|
||||
// vector to light
|
||||
f32 diffX = light.pos[0] - pos[0];
|
||||
f32 diffY = light.pos[1] - pos[1];
|
||||
f32 diffZ = light.pos[2] - pos[2];
|
||||
|
||||
// squared distance check
|
||||
f32 dist2 = (diffX * diffX) + (diffY * diffY) + (diffZ * diffZ);
|
||||
f32 radius2 = light.radius * light.radius;
|
||||
if (dist2 > radius2 || dist2 <= 0) { return; }
|
||||
|
||||
// attenuation & intensity
|
||||
f32 att = 1.0f - (dist2 / radius2);
|
||||
f32 brightness = att * light.intensity * lightIntensityScalar;
|
||||
|
||||
if (light.useSurfaceNormals && normal) {
|
||||
// normalize diff
|
||||
f32 invLen = rsqrt(dist2);
|
||||
diffX *= invLen;
|
||||
diffY *= invLen;
|
||||
diffZ *= invLen;
|
||||
|
||||
// lambert term
|
||||
f32 nl = (normal[0] * diffX) + (normal[1] * diffY) + (normal[2] * diffZ);
|
||||
if (nl <= 0.0f) { return; }
|
||||
|
||||
// modulate by normal
|
||||
brightness *= nl;
|
||||
}
|
||||
|
||||
// accumulate
|
||||
outColor[0] += light.color[0] * brightness;
|
||||
outColor[1] += light.color[1] * brightness;
|
||||
outColor[2] += light.color[2] * brightness;
|
||||
weight += brightness;
|
||||
contribution++;
|
||||
}
|
||||
|
||||
C_FIELD OPTIMIZE_O3 void le_calculate_vertex_lighting(const Vtx_t* v, Vec3f pos, VEC_OUT Color out) {
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
u8 contribution = 0;
|
||||
for (LELight* light : sActiveLights) {
|
||||
le_calculate_light_contribution(*light, pos, NULL, 1.0f, color, weight, contribution);
|
||||
if (contribution == sMaxLightsPerVertex) { break; }
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
Color vtxAmbient = {
|
||||
(u8)(v->cn[0] * (gLEAmbientColor[0] / 255.0f)),
|
||||
(u8)(v->cn[1] * (gLEAmbientColor[1] / 255.0f)),
|
||||
(u8)(v->cn[2] * (gLEAmbientColor[2] / 255.0f)),
|
||||
};
|
||||
le_tone_map(out, vtxAmbient, color, weight);
|
||||
}
|
||||
|
||||
C_FIELD OPTIMIZE_O3 void le_calculate_lighting_color(Vec3f pos, VEC_OUT Color out, f32 lightIntensityScalar) {
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
u8 contribution = 0;
|
||||
for (LELight* light : sActiveLights) {
|
||||
le_calculate_light_contribution(*light, pos, NULL, lightIntensityScalar, color, weight, contribution);
|
||||
if (contribution == sMaxLightsPerVertex) { break; }
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
le_tone_map(out, gLEAmbientColor, color, weight);
|
||||
}
|
||||
|
||||
C_FIELD OPTIMIZE_O3 void le_calculate_lighting_color_with_normal(Vec3f pos, Vec3f normal, VEC_OUT Color out, f32 lightIntensityScalar) {
|
||||
// normalize normal
|
||||
if (normal) { vec3f_normalize(normal); }
|
||||
|
||||
// clear color
|
||||
Vec3f color = { 0 };
|
||||
|
||||
// accumulate lighting
|
||||
f32 weight = 1.0f;
|
||||
u8 contribution = 0;
|
||||
for (LELight* light : sActiveLights) {
|
||||
le_calculate_light_contribution(*light, pos, normal, lightIntensityScalar, color, weight, contribution);
|
||||
if (contribution == sMaxLightsPerVertex) { break; }
|
||||
}
|
||||
|
||||
// tone map and output
|
||||
le_tone_map(out, gLEAmbientColor, color, weight);
|
||||
}
|
||||
|
||||
C_FIELD void le_calculate_lighting_dir(Vec3f pos, VEC_OUT Vec3f out) {
|
||||
Vec3f lightingDir = { 0, 0, 0 };
|
||||
s16 count = 1;
|
||||
|
||||
for (LELight* light : sActiveLights) {
|
||||
f32 diffX = light->pos[0] - pos[0];
|
||||
f32 diffY = light->pos[1] - pos[1];
|
||||
f32 diffZ = light->pos[2] - pos[2];
|
||||
f32 dist = (diffX * diffX) + (diffY * diffY) + (diffZ * diffZ);
|
||||
f32 radius = light->radius * light->radius;
|
||||
if (dist > radius) { continue; }
|
||||
|
||||
Vec3f dir = {
|
||||
pos[0] - light->pos[0],
|
||||
pos[1] - light->pos[1],
|
||||
pos[2] - light->pos[2],
|
||||
};
|
||||
vec3f_normalize(dir);
|
||||
|
||||
f32 intensity = (1 - (dist / radius)) * light->intensity;
|
||||
lightingDir[0] += dir[0] * intensity;
|
||||
lightingDir[1] += dir[1] * intensity;
|
||||
lightingDir[2] += dir[2] * intensity;
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
out[0] = lightingDir[0] / (f32)(count);
|
||||
out[1] = lightingDir[1] / (f32)(count);
|
||||
out[2] = lightingDir[2] / (f32)(count);
|
||||
vec3f_normalize(out);
|
||||
}
|
||||
|
||||
C_FIELD s16 le_add_light(f32 x, f32 y, f32 z, u8 r, u8 g, u8 b, f32 radius, f32 intensity) {
|
||||
if (sLightPool.size() >= LE_MAX_LIGHTS) {
|
||||
LOG_LUA_LINE("LE light count cannot exceed %d lights!", LE_MAX_LIGHTS);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LELight newLight;
|
||||
newLight.id = ++sLightID;
|
||||
newLight.pos[0] = x;
|
||||
newLight.pos[1] = y;
|
||||
newLight.pos[2] = z;
|
||||
newLight.color[0] = r;
|
||||
newLight.color[1] = g;
|
||||
newLight.color[2] = b;
|
||||
newLight.radius = radius;
|
||||
newLight.intensity = intensity;
|
||||
newLight.useSurfaceNormals = true;
|
||||
|
||||
sLightPool.push_back(newLight);
|
||||
|
||||
le_update_active_lights();
|
||||
|
||||
sEnabled = true;
|
||||
return sLightID;
|
||||
}
|
||||
|
||||
C_FIELD void le_remove_light(s16 id) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
auto it = std::find_if(sLightPool.begin(), sLightPool.end(),
|
||||
[id](const LELight& light) {
|
||||
return light.id == id;
|
||||
}
|
||||
);
|
||||
|
||||
if (it != sLightPool.end()) {
|
||||
sLightPool.erase(it);
|
||||
}
|
||||
|
||||
le_update_active_lights();
|
||||
}
|
||||
|
||||
C_FIELD s16 le_get_light_count(void) {
|
||||
return sLightPool.size();
|
||||
}
|
||||
|
||||
C_FIELD bool le_light_exists(s16 id) {
|
||||
if (id < 0) { return false; }
|
||||
|
||||
return std::any_of(sLightPool.begin(), sLightPool.end(),
|
||||
[id](const LELight& light) {
|
||||
return light.id == id;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static LELight* le_find_light(s16 id) {
|
||||
if (id < 0) { return nullptr; }
|
||||
|
||||
auto it = std::find_if(sLightPool.begin(), sLightPool.end(),
|
||||
[id](const LELight& light) {
|
||||
return light.id == id;
|
||||
}
|
||||
);
|
||||
|
||||
// kinda cursed syntax but it works
|
||||
return (it != sLightPool.end()) ? &(*it) : nullptr;
|
||||
}
|
||||
|
||||
C_FIELD void le_get_light_pos(s16 id, VEC_OUT Vec3f out) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
vec3f_set(out, light->pos[0], light->pos[1], light->pos[2]);
|
||||
}
|
||||
}
|
||||
|
||||
C_FIELD void le_set_light_pos(s16 id, f32 x, f32 y, f32 z) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
light->pos[0] = x;
|
||||
light->pos[1] = y;
|
||||
light->pos[2] = z;
|
||||
}
|
||||
}
|
||||
|
||||
C_FIELD void le_get_light_color(s16 id, VEC_OUT Color out) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
color_set(out, light->color[0], light->color[1], light->color[2]);
|
||||
}
|
||||
}
|
||||
|
||||
C_FIELD void le_set_light_color(s16 id, u8 r, u8 g, u8 b) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
light->color[0] = r;
|
||||
light->color[1] = g;
|
||||
light->color[2] = b;
|
||||
}
|
||||
}
|
||||
|
||||
C_FIELD f32 le_get_light_radius(s16 id) {
|
||||
if (id < 0) { return 0.0f; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
return light->radius;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_light_radius(s16 id, f32 radius) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
light->radius = radius;
|
||||
}
|
||||
|
||||
le_update_active_lights();
|
||||
}
|
||||
|
||||
C_FIELD f32 le_get_light_intensity(s16 id) {
|
||||
if (id < 0) { return 0.0f; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
return light->intensity;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_light_intensity(s16 id, f32 intensity) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
light->intensity = intensity;
|
||||
}
|
||||
|
||||
le_update_active_lights();
|
||||
}
|
||||
|
||||
C_FIELD bool le_get_light_use_surface_normals(s16 id) {
|
||||
if (id < 0) { return false; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
return light->useSurfaceNormals;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
C_FIELD void le_set_light_use_surface_normals(s16 id, bool useSurfaceNormals) {
|
||||
if (id < 0) { return; }
|
||||
|
||||
if (auto* light = le_find_light(id)) {
|
||||
light->useSurfaceNormals = useSurfaceNormals;
|
||||
}
|
||||
}
|
||||
|
||||
void le_clear(void) {
|
||||
sLightPool.clear();
|
||||
sLightID = -1;
|
||||
|
||||
color_set(gLEAmbientColor, 127, 127, 127);
|
||||
}
|
||||
|
||||
void le_shutdown(void) {
|
||||
sEnabled = false;
|
||||
sMode = LE_MODE_AFFECT_ALL_SHADED_AND_COLORED;
|
||||
sToneMapping = LE_TONE_MAPPING_WEIGHTED;
|
||||
sMaxLightsPerVertex = 4;
|
||||
le_clear();
|
||||
}
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
#ifndef LIGHTING_ENGINE_H
|
||||
#define LIGHTING_ENGINE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "types.h"
|
||||
|
||||
#define LE_MAX_LIGHTS 512
|
||||
#define LE_MAX_LIGHTS 1024
|
||||
|
||||
enum LEMode {
|
||||
LE_MODE_AFFECT_ALL_SHADED_AND_COLORED,
|
||||
|
|
@ -32,8 +35,10 @@ void le_set_tone_mapping(enum LEToneMapping toneMapping);
|
|||
void le_get_ambient_color(VEC_OUT Color out);
|
||||
/* |description|Sets the lighting engine ambient color|descriptionEnd| */
|
||||
void le_set_ambient_color(u8 r, u8 g, u8 b);
|
||||
/* |description|Sets the max amount of lights that can affect a vertex|descriptionEnd| */
|
||||
void le_set_max_lights_per_vertex(u8 count);
|
||||
|
||||
void le_calculate_vertex_lighting(Vtx_t* v, Vec3f pos, VEC_OUT Color out);
|
||||
void le_calculate_vertex_lighting(const Vtx_t* v, Vec3f pos, VEC_OUT Color out);
|
||||
/* |description|Calculates the lighting with `lightIntensityScalar` at a position and outputs the color in `out`|descriptionEnd|*/
|
||||
void le_calculate_lighting_color(Vec3f pos, VEC_OUT Color out, f32 lightIntensityScalar);
|
||||
/* |description|Calculates the lighting with `lightIntensityScalar` at a position and with a normal and outputs the color in `out`|descriptionEnd|*/
|
||||
|
|
@ -71,4 +76,8 @@ void le_set_light_use_surface_normals(s16 id, bool useSurfaceNormals);
|
|||
void le_clear(void);
|
||||
void le_shutdown(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIGHTING_ENGINE_H
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ OPTIMIZE_O3 bool mtxf_inverse_non_affine(VEC_OUT Mat4 dest, Mat4 src) {
|
|||
if (fabsf(aug[i][k]) > fabsf(aug[piv][k])) { piv = i; }
|
||||
}
|
||||
|
||||
if (fabsf(aug[piv][k]) < FLT_EPSILON) { return false; }
|
||||
if (fabsf(aug[piv][k]) < __FLT_EPSILON__) { return false; }
|
||||
|
||||
// swap pivot row into place
|
||||
if (piv != k) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "game/hardcoded.h"
|
||||
#include "pc/utils/misc.h"
|
||||
#include "pc/network/network.h"
|
||||
#include "pc/lua/smlua_hooks.h"
|
||||
|
||||
Vec3f gFindWallDirection = { 0 };
|
||||
u8 gFindWallDirectionActive = false;
|
||||
|
|
@ -343,6 +344,9 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
|||
s32 numCollisions = 0;
|
||||
s16 x = colData->x;
|
||||
s16 z = colData->z;
|
||||
f32 posX = colData->x;
|
||||
f32 posY = colData->y;
|
||||
f32 posZ = colData->z;
|
||||
|
||||
colData->numWalls = 0;
|
||||
|
||||
|
|
@ -371,6 +375,8 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
|||
// Increment the debug tracker.
|
||||
gNumCalls.wall += 1;
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_WALL_COLLISION, posX, posY, posZ, colData, &numCollisions);
|
||||
|
||||
return numCollisions;
|
||||
}
|
||||
|
||||
|
|
@ -544,6 +550,8 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, RET struct Surface **pceil) {
|
|||
// Increment the debug tracker.
|
||||
gNumCalls.ceil += 1;
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_CEIL, posX, posY, posZ, pceil, &height);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
|
|
@ -882,6 +890,8 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, RET struct Surface **pfloor) {
|
|||
// Increment the debug tracker.
|
||||
gNumCalls.floor += 1;
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_FLOOR, xPos, yPos, zPos, pfloor, &height);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
|
|
@ -922,6 +932,8 @@ f32 find_water_level(f32 x, f32 z) {
|
|||
}
|
||||
}
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_WATER_LEVEL, x, z, &waterLevel);
|
||||
|
||||
return waterLevel;
|
||||
}
|
||||
|
||||
|
|
@ -963,6 +975,8 @@ f32 find_poison_gas_level(f32 x, f32 z) {
|
|||
}
|
||||
}
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_POISON_GAS_LEVEL, x, z, &gasLevel);
|
||||
|
||||
return gasLevel;
|
||||
}
|
||||
|
||||
|
|
@ -1227,6 +1241,7 @@ void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Ve
|
|||
if (normalized_dir[1] >= 1.0f || normalized_dir[1] <= -1.0f)
|
||||
{
|
||||
find_surface_on_ray_cell(cellX, cellZ, orig, normalized_dir, dir_length, hit_surface, hit_pos, &max_length);
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_SURFACE_ON_RAY, orig, dir, hit_surface, hit_pos);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1249,4 +1264,6 @@ void find_surface_on_ray(Vec3f orig, Vec3f dir, struct Surface **hit_surface, Ve
|
|||
cellX = (s16)fCellX;
|
||||
cellZ = (s16)fCellZ;
|
||||
}
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_FIND_SURFACE_ON_RAY, orig, dir, hit_surface, hit_pos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,6 +271,8 @@ static void add_surface(struct Surface *surface, s32 dynamic) {
|
|||
|
||||
s16 cellZ, cellX;
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_ADD_SURFACE, surface, dynamic);
|
||||
|
||||
minX = min_3(surface->vertex1[0], surface->vertex2[0], surface->vertex3[0]);
|
||||
minZ = min_3(surface->vertex1[2], surface->vertex2[2], surface->vertex3[2]);
|
||||
maxX = max_3(surface->vertex1[0], surface->vertex2[0], surface->vertex3[0]);
|
||||
|
|
@ -287,7 +289,6 @@ static void add_surface(struct Surface *surface, s32 dynamic) {
|
|||
}
|
||||
}
|
||||
|
||||
smlua_call_event_hooks(HOOK_ON_ADD_SURFACE, surface, dynamic);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -805,7 +806,10 @@ static void load_object_collision_model_internal(bool isSOC) {
|
|||
|
||||
for (s32 i = 0; i < MAX_PLAYERS; i++) {
|
||||
f32 dist = dist_between_objects(gCurrentObject, gMarioStates[i].marioObj);
|
||||
if (dist < tangibleDist) { anyPlayerInTangibleRange = TRUE; }
|
||||
if (dist < tangibleDist) {
|
||||
anyPlayerInTangibleRange = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the object collision is supposed to be loaded more than the
|
||||
|
|
|
|||
|
|
@ -57,19 +57,19 @@ void bhv_activated_back_and_forth_platform_init(void) {
|
|||
o->oActivatedBackAndForthPlatformStartYaw = o->oFaceAngleYaw;
|
||||
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oVelX);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oVelZ);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformMaxOffset);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformOffset);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformVel);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformCountdown);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformStartYaw);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformVertical);
|
||||
sync_object_init_field(o, &o->oActivatedBackAndForthPlatformFlipRotation);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oVelX);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oVelZ);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformMaxOffset);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformOffset);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformVel);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformCountdown);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformStartYaw);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformVertical);
|
||||
sync_object_init_field(o, o->oActivatedBackAndForthPlatformFlipRotation);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -207,14 +207,14 @@ void bhv_homing_amp_loop(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oAmpYPhase);
|
||||
sync_object_init_field(o, &o->oAnimState);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oFriction);
|
||||
sync_object_init_field(o, &o->oHomingAmpAvgY);
|
||||
sync_object_init_field(o, &o->oHomingAmpLockedOn);
|
||||
sync_object_init_field(o, o->oAmpYPhase);
|
||||
sync_object_init_field(o, o->oAnimState);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oFriction);
|
||||
sync_object_init_field(o, o->oHomingAmpAvgY);
|
||||
sync_object_init_field(o, o->oHomingAmpLockedOn);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -354,12 +354,12 @@ void bhv_circling_amp_loop(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oAmpYPhase);
|
||||
sync_object_init_field(o, &o->oAnimState);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oFriction);
|
||||
sync_object_init_field(o, o->oAmpYPhase);
|
||||
sync_object_init_field(o, o->oAnimState);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oFriction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ void bhv_arrow_lift_loop(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
void bhv_haunted_bookshelf_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oHauntedBookshelfShouldOpen);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oHauntedBookshelfShouldOpen);
|
||||
}
|
||||
|
||||
// oDistanceToMario is unused by this object.
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
* in the enclosure nor in the room around it.
|
||||
*/
|
||||
static void handle_merry_go_round_music(void) {
|
||||
// COOP: raise scope of this variable since floor check is no longer strictly tied to music
|
||||
u16 marioFloorType = 0;
|
||||
|
||||
// If the music should play, play it and check whether it still should.
|
||||
// Otherwise, don't play it and check whether it should.
|
||||
if (o->oMerryGoRoundMusicShouldPlay == FALSE) {
|
||||
|
|
@ -23,7 +26,7 @@ static void handle_merry_go_round_music(void) {
|
|||
// Get Mario's floor and floor surface type
|
||||
struct Surface *marioFloor = NULL;
|
||||
struct Object *marioObject = gMarioObjects[0];
|
||||
u16 marioFloorType = 0;
|
||||
// COOP: `marioFloorType` originally here
|
||||
|
||||
if (marioObject) {
|
||||
find_floor(marioObject->oPosX, marioObject->oPosY, marioObject->oPosZ, &marioFloor);
|
||||
|
|
@ -37,7 +40,9 @@ static void handle_merry_go_round_music(void) {
|
|||
// The cur_obj_is_mario_on_platform check is redundant since the merry-go-round
|
||||
// has surface type 0x1A, so Mario cannot be on the merry-go-round
|
||||
// without being on a floor with surface type 0x1A (SURFACE_MGR_MUSIC).
|
||||
gMarioOnMerryGoRound = cur_obj_is_any_player_on_platform();
|
||||
|
||||
// COOP: `gMarioOnMerryGoRound` is used to determine if the merry-go-round Boos should be active
|
||||
// for co-op, this means that this check needs to be separated from the music check, since music is client-side.
|
||||
if (cur_obj_is_mario_on_platform() || marioFloorType == SURFACE_MGR_MUSIC) {
|
||||
// If Mario is in the merry-go-round's enclosure, play only the merry-go-round music.
|
||||
play_secondary_music(SEQ_EVENT_MERRY_GO_ROUND, 0, 78, 50);
|
||||
|
|
@ -60,6 +65,28 @@ static void handle_merry_go_round_music(void) {
|
|||
cur_obj_play_sound_1(SOUND_ENV_MERRY_GO_ROUND_CREAKING);
|
||||
}
|
||||
}
|
||||
|
||||
// COOP: floor check happens here
|
||||
// `marioFloorType` refers to the local player's character
|
||||
gMarioOnMerryGoRound = marioFloorType == SURFACE_MGR_MUSIC || cur_obj_is_any_player_on_platform();
|
||||
if (!gMarioOnMerryGoRound) {
|
||||
// check the other Marios' floors
|
||||
// starting at 1 since local player was already checked
|
||||
for (s32 i = 1; i < MAX_PLAYERS; i++) {
|
||||
if (!is_player_active(&gMarioStates[i])) { continue; }
|
||||
|
||||
struct Object *marioObject = gMarioStates[i].marioObj;
|
||||
if (marioObject == NULL) { continue; }
|
||||
|
||||
struct Surface *marioFloor = NULL;
|
||||
find_floor(marioObject->oPosX, marioObject->oPosY, marioObject->oPosZ, &marioFloor);
|
||||
|
||||
if (marioFloor != NULL && marioFloor->type == SURFACE_MGR_MUSIC) {
|
||||
gMarioOnMerryGoRound = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ void bhv_bbh_tilting_trap_platform_loop(void) {
|
|||
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 1000.0f);
|
||||
sync_object_init_field(o, &o->oAngleVelPitch);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oAngleVelPitch);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
}
|
||||
|
||||
f32 x = 0;
|
||||
|
|
|
|||
|
|
@ -120,12 +120,12 @@ void bhv_blue_coin_switch_init(void) {
|
|||
void bhv_blue_coin_switch_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oGravity);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oHomeY);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oGravity);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oHomeY);
|
||||
}
|
||||
|
||||
// The switch's model is 1/3 size.
|
||||
|
|
|
|||
|
|
@ -300,9 +300,9 @@ void bhv_bobomb_buddy_init(void) {
|
|||
|
||||
if (o->oBobombBuddyRole == BOBOMB_BUDDY_ROLE_CANNON) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oBobombBuddyHasTalkedToMario);
|
||||
sync_object_init_field(o, &o->oBobombBuddyCannonStatus);
|
||||
sync_object_init_field(o, &forceCannonOpen);
|
||||
sync_object_init_field(o, o->oBobombBuddyHasTalkedToMario);
|
||||
sync_object_init_field(o, o->oBobombBuddyCannonStatus);
|
||||
sync_object_init_field(o, forceCannonOpen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,20 +27,20 @@ struct SyncObject* boo_sync_object_init(void) {
|
|||
struct SyncObject *so = sync_object_init(o, 4000.0f);
|
||||
if (so == NULL) { return NULL; }
|
||||
so->ignore_if_true = boo_ignore_update;
|
||||
sync_object_init_field(o, &o->oBooBaseScale);
|
||||
sync_object_init_field(o, &o->oBooNegatedAggressiveness);
|
||||
sync_object_init_field(o, &o->oBooOscillationTimer);
|
||||
sync_object_init_field(o, &o->oBooTargetOpacity);
|
||||
sync_object_init_field(o, &o->oBooTurningSpeed);
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &o->oFlags);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oHealth);
|
||||
sync_object_init_field(o, &o->oInteractStatus);
|
||||
sync_object_init_field(o, &o->oInteractType);
|
||||
sync_object_init_field(o, &o->oOpacity);
|
||||
sync_object_init_field(o, &o->oRoom);
|
||||
sync_object_init_field(o, o->oBooBaseScale);
|
||||
sync_object_init_field(o, o->oBooNegatedAggressiveness);
|
||||
sync_object_init_field(o, o->oBooOscillationTimer);
|
||||
sync_object_init_field(o, o->oBooTargetOpacity);
|
||||
sync_object_init_field(o, o->oBooTurningSpeed);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oFlags);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oHealth);
|
||||
sync_object_init_field(o, o->oInteractStatus);
|
||||
sync_object_init_field(o, o->oInteractType);
|
||||
sync_object_init_field(o, o->oOpacity);
|
||||
sync_object_init_field(o, o->oRoom);
|
||||
return so;
|
||||
}
|
||||
|
||||
|
|
@ -56,16 +56,11 @@ void bhv_boo_init(void) {
|
|||
|
||||
static s32 boo_should_be_stopped(void) {
|
||||
if (cur_obj_has_behavior(bhvMerryGoRoundBigBoo) || cur_obj_has_behavior(bhvMerryGoRoundBoo)) {
|
||||
for (s32 i = 0; i < MAX_PLAYERS; i++) {
|
||||
if (!is_player_active(&gMarioStates[i])) { continue; }
|
||||
if (gMarioStates[i].currentRoom != BBH_DYNAMIC_SURFACE_ROOM && gMarioStates[i].currentRoom != BBH_NEAR_MERRY_GO_ROUND_ROOM) { return TRUE; }
|
||||
}
|
||||
return FALSE;
|
||||
/*if (!gMarioOnMerryGoRound) {
|
||||
if (!gMarioOnMerryGoRound) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}*/
|
||||
}
|
||||
} else {
|
||||
if (o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) {
|
||||
return TRUE;
|
||||
|
|
@ -384,9 +379,7 @@ static void boo_chase_mario(f32 a0, s16 a1, f32 a2) {
|
|||
if (boo_vanish_or_appear()) {
|
||||
o->oInteractType = 0x8000;
|
||||
|
||||
|
||||
u8 isMerryGoRoundBoo = (cur_obj_has_behavior(bhvMerryGoRoundBigBoo) || cur_obj_has_behavior(bhvMerryGoRoundBoo));
|
||||
if (!isMerryGoRoundBoo && cur_obj_lateral_dist_from_obj_to_home(player) > 1500.0f) {
|
||||
if (cur_obj_lateral_dist_from_obj_to_home(player) > 1500.0f) {
|
||||
sp1A = cur_obj_angle_to_home();
|
||||
} else {
|
||||
sp1A = angleToPlayer;
|
||||
|
|
@ -535,7 +528,8 @@ static void (*sBooActions[])(void) = {
|
|||
};
|
||||
|
||||
void bhv_boo_loop(void) {
|
||||
if (o->oAction < 3) {
|
||||
// COOP: only sync when Boo isn't in a death state
|
||||
if (o->oAction < 3 || o->oAction == 5) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject* so = boo_sync_object_init();
|
||||
if (so) { so->syncDeathEvent = FALSE; }
|
||||
|
|
@ -862,8 +856,8 @@ void bhv_boo_with_cage_loop(void) {
|
|||
void bhv_merry_go_round_boo_manager_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oMerryGoRoundBooManagerNumBoosSpawned);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oMerryGoRoundBooManagerNumBoosSpawned);
|
||||
}
|
||||
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@ void bhv_boo_cage_init(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so == NULL) { return; }
|
||||
so->on_received_post = bhv_boo_cage_on_received_post;
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oVelX);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oVelZ);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oVelX);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oVelZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void bhv_big_boulder_loop(void) {
|
|||
void bhv_big_boulder_generator_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
}
|
||||
|
||||
struct Object *sp1C;
|
||||
|
|
|
|||
|
|
@ -50,14 +50,14 @@ s16 D_8032F520[][3] = { { 1, 10, 40 }, { 0, 0, 74 }, { -1, -10, 114 }, { 1
|
|||
|
||||
void bhv_bowser_tail_anchor_init(void) {
|
||||
if (!o->parentObj) { mark_obj_for_deletion(o); return; }
|
||||
sync_object_init_field(o->parentObj, &o->oAction);
|
||||
sync_object_init_field(o->parentObj, &o->oPrevAction);
|
||||
sync_object_init_field(o->parentObj, &o->oTimer);
|
||||
sync_object_init_field(o->parentObj, &o->oIntangibleTimer);
|
||||
sync_object_init_field(o->parentObj, &o->oInteractStatus);
|
||||
sync_object_init_field(o->parentObj, &o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o->parentObj, &o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o->parentObj, &o->header.gfx.scale[2]);
|
||||
sync_object_init_field(o->parentObj, o->oAction);
|
||||
sync_object_init_field(o->parentObj, o->oPrevAction);
|
||||
sync_object_init_field(o->parentObj, o->oTimer);
|
||||
sync_object_init_field(o->parentObj, o->oIntangibleTimer);
|
||||
sync_object_init_field(o->parentObj, o->oInteractStatus);
|
||||
sync_object_init_field(o->parentObj, o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o->parentObj, o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o->parentObj, o->header.gfx.scale[2]);
|
||||
}
|
||||
|
||||
void bhv_bowser_tail_anchor_loop(void) {
|
||||
|
|
@ -112,10 +112,10 @@ void bhv_bowser_flame_spawn_loop(void) {
|
|||
|
||||
void bhv_bowser_body_anchor_init(void) {
|
||||
if (!o->parentObj) { mark_obj_for_deletion(o); return; }
|
||||
sync_object_init_field(o->parentObj, &o->oInteractType);
|
||||
sync_object_init_field(o->parentObj, &o->oInteractStatus);
|
||||
sync_object_init_field(o->parentObj, &o->oIntangibleTimer);
|
||||
sync_object_init_field(o->parentObj, &o->oDamageOrCoinValue);
|
||||
sync_object_init_field(o->parentObj, o->oInteractType);
|
||||
sync_object_init_field(o->parentObj, o->oInteractStatus);
|
||||
sync_object_init_field(o->parentObj, o->oIntangibleTimer);
|
||||
sync_object_init_field(o->parentObj, o->oDamageOrCoinValue);
|
||||
}
|
||||
|
||||
void bhv_bowser_body_anchor_loop(void) {
|
||||
|
|
@ -1077,12 +1077,12 @@ void bowser_act_dead(void) {
|
|||
|
||||
void bhv_tilting_bowser_lava_platform_init(void) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAngleVelPitch);
|
||||
sync_object_init_field(o, &o->oAngleVelRoll);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, &o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, &o->oMoveAngleRoll);
|
||||
sync_object_init_field(o, o->oAngleVelPitch);
|
||||
sync_object_init_field(o, o->oAngleVelRoll);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, o->oMoveAngleRoll);
|
||||
}
|
||||
|
||||
void bowser_tilt_platform(struct Object* platform, s16 a1) {
|
||||
|
|
@ -1445,13 +1445,13 @@ void bhv_bowser_init(void) {
|
|||
so->ignore_if_true = bhv_bowser_ignore_if_true;
|
||||
so->on_received_post = bhv_bowser_on_received_post;
|
||||
so->fullObjectSync = TRUE;
|
||||
sync_object_init_field_with_size(o, &o->header.gfx.node.flags, 16);
|
||||
sync_object_init_field_with_size(o, &o->header.gfx.animInfo.animFrame, 16);
|
||||
sync_object_init_field_with_size(o, &bowserCutsceneGlobalIndex, 8);
|
||||
sync_object_init_field(o, &networkBowserAnimationIndex);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[2]);
|
||||
sync_object_init_field(o, o->header.gfx.node.flags);
|
||||
sync_object_init_field(o, o->header.gfx.animInfo.animFrame);
|
||||
sync_object_init_field(o, bowserCutsceneGlobalIndex);
|
||||
sync_object_init_field(o, networkBowserAnimationIndex);
|
||||
sync_object_init_field(o, o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1692,9 +1692,9 @@ void bhv_falling_bowser_platform_loop(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
so->ignore_if_true = bhv_falling_bowser_platform_ignore_if_true;
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void bhv_bowser_bomb_loop(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
so->syncDeathEvent = FALSE;
|
||||
sync_object_init_field(o, &networkBowserBombHit);
|
||||
sync_object_init_field(o, networkBowserBombHit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ void bhv_lll_bowser_puzzle_loop(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oBowserPuzzleCompletionFlags);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oBowserPuzzleCompletionFlags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ void bhv_breakable_box_small_init(void) {
|
|||
o->oAnimState = 1;
|
||||
o->activeFlags |= ACTIVE_FLAG_UNK9;
|
||||
sync_object_init(o, 1000.0f);
|
||||
sync_object_init_field(o, &o->oBreakableBoxSmallReleased);
|
||||
sync_object_init_field(o, &o->oBreakableBoxSmallFramesSinceReleased);
|
||||
sync_object_init_field(o, &o->oAnimState);
|
||||
sync_object_init_field(o, &o->oFlags);
|
||||
sync_object_init_field(o, o->oBreakableBoxSmallReleased);
|
||||
sync_object_init_field(o, o->oBreakableBoxSmallFramesSinceReleased);
|
||||
sync_object_init_field(o, o->oAnimState);
|
||||
sync_object_init_field(o, o->oFlags);
|
||||
}
|
||||
|
||||
void small_breakable_box_spawn_dust(void) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
void bhv_wf_breakable_wall_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oBreakableWallForce);
|
||||
sync_object_init_field(o, o->oBreakableWallForce);
|
||||
}
|
||||
|
||||
if (o->oBreakableWallForce || gMarioStates[0].action == ACT_SHOT_FROM_CANNON) {
|
||||
|
|
|
|||
|
|
@ -121,11 +121,11 @@ void bhv_bub_loop(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oCheepCheepUnkF4);
|
||||
sync_object_init_field(o, &o->oCheepCheepUnkF8);
|
||||
sync_object_init_field(o, &o->oCheepCheepUnkFC);
|
||||
sync_object_init_field(o, &o->oCheepCheepUnk104);
|
||||
sync_object_init_field(o, &o->oCheepCheepUnk108);
|
||||
sync_object_init_field(o, o->oCheepCheepUnkF4);
|
||||
sync_object_init_field(o, o->oCheepCheepUnkF8);
|
||||
sync_object_init_field(o, o->oCheepCheepUnkFC);
|
||||
sync_object_init_field(o, o->oCheepCheepUnk104);
|
||||
sync_object_init_field(o, o->oCheepCheepUnk108);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,17 +111,17 @@ void bubba_act_1(void) {
|
|||
void bhv_bubba_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oBubbaUnkF4);
|
||||
sync_object_init_field(o, &o->oBubbaUnkF8);
|
||||
sync_object_init_field(o, &o->oBubbaUnkFC);
|
||||
sync_object_init_field(o, &o->oBubbaUnk100);
|
||||
sync_object_init_field(o, &o->oBubbaUnk104);
|
||||
sync_object_init_field(o, &o->oBubbaUnk108);
|
||||
sync_object_init_field(o, &o->oBubbaUnk10C);
|
||||
sync_object_init_field(o, &o->oBubbaUnk1AC);
|
||||
sync_object_init_field(o, &o->oBubbaUnk1B0);
|
||||
sync_object_init_field(o, &o->oAnimState);
|
||||
sync_object_init_field(o, &o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, o->oBubbaUnkF4);
|
||||
sync_object_init_field(o, o->oBubbaUnkF8);
|
||||
sync_object_init_field(o, o->oBubbaUnkFC);
|
||||
sync_object_init_field(o, o->oBubbaUnk100);
|
||||
sync_object_init_field(o, o->oBubbaUnk104);
|
||||
sync_object_init_field(o, o->oBubbaUnk108);
|
||||
sync_object_init_field(o, o->oBubbaUnk10C);
|
||||
sync_object_init_field(o, o->oBubbaUnk1AC);
|
||||
sync_object_init_field(o, o->oBubbaUnk1B0);
|
||||
sync_object_init_field(o, o->oAnimState);
|
||||
sync_object_init_field(o, o->oMoveAnglePitch);
|
||||
}
|
||||
|
||||
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ void bhv_bullet_bill_init(void) {
|
|||
o->oBulletBillInitialMoveYaw = o->oMoveAngleYaw;
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ static void bhv_bully_override_ownership(u8* shouldOverride, u8* shouldOwn) {
|
|||
static void bhv_bully_network_init(void) {
|
||||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oFlags);
|
||||
sync_object_init_field(o, &o->oBullyKBTimerAndMinionKOCounter);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oBullyPrevX);
|
||||
sync_object_init_field(o, &o->oBullyPrevY);
|
||||
sync_object_init_field(o, &o->oBullyPrevZ);
|
||||
sync_object_init_field(o, &o->oBullyMarioCollisionAngle);
|
||||
sync_object_init_field(o, &o->oBullyLastNetworkPlayerIndex);
|
||||
sync_object_init_field(o, o->oFlags);
|
||||
sync_object_init_field(o, o->oBullyKBTimerAndMinionKOCounter);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oBullyPrevX);
|
||||
sync_object_init_field(o, o->oBullyPrevY);
|
||||
sync_object_init_field(o, o->oBullyPrevZ);
|
||||
sync_object_init_field(o, o->oBullyMarioCollisionAngle);
|
||||
sync_object_init_field(o, o->oBullyLastNetworkPlayerIndex);
|
||||
so->syncDeathEvent = FALSE;
|
||||
so->ignore_if_true = bhv_bully_ignore_if_true;
|
||||
so->override_ownership = bhv_bully_override_ownership;
|
||||
|
|
|
|||
|
|
@ -45,15 +45,15 @@ void bhv_camera_lakitu_init(void) {
|
|||
so->ignore_if_true = bhv_camera_lakitu_ignore_if_true;
|
||||
so->override_ownership = bhv_camera_lakitu_override_ownership;
|
||||
so->on_received_post = bhv_camera_lakitu_on_received_post;
|
||||
sync_object_init_field(o, &o->oAngleVelPitch);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oCameraLakituBlinkTimer);
|
||||
sync_object_init_field(o, &o->oCameraLakituSpeed);
|
||||
sync_object_init_field(o, &o->oCameraLakituCircleRadius);
|
||||
sync_object_init_field(o, &o->oCameraLakituFinishedDialog);
|
||||
sync_object_init_field(o, &o->oCameraLakituPitchVel);
|
||||
sync_object_init_field(o, o->oAngleVelPitch);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oCameraLakituBlinkTimer);
|
||||
sync_object_init_field(o, o->oCameraLakituSpeed);
|
||||
sync_object_init_field(o, o->oCameraLakituCircleRadius);
|
||||
sync_object_init_field(o, o->oCameraLakituFinishedDialog);
|
||||
sync_object_init_field(o, o->oCameraLakituPitchVel);
|
||||
#ifndef VERSION_JP
|
||||
sync_object_init_field(o, &o->oCameraLakituUnk104);
|
||||
sync_object_init_field(o, o->oCameraLakituUnk104);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,16 +218,16 @@ void bhv_cannon_base_loop(void) {
|
|||
if (so) {
|
||||
so->on_received_post = cannon_on_received_post;
|
||||
so->override_ownership = bhv_cannon_override_ownership;
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oCannonUnk10C);
|
||||
sync_object_init_field(o, &o->oCannonUnk10C);
|
||||
sync_object_init_field(o, &o->oCannonUnkF8);
|
||||
sync_object_init_field(o, &o->oCannonUnkF4);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oCannonUnk10C);
|
||||
sync_object_init_field(o, o->oCannonUnk10C);
|
||||
sync_object_init_field(o, o->oCannonUnkF8);
|
||||
sync_object_init_field(o, o->oCannonUnkF4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ void (*sCapSwitchActions[])(void) = { cap_switch_act_0, cap_switch_act_1,
|
|||
void bhv_cap_switch_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &capSwitchForcePress);
|
||||
sync_object_init_field(o, capSwitchForcePress);
|
||||
}
|
||||
|
||||
CUR_OBJ_CALL_ACTION_FUNCTION(sCapSwitchActions);
|
||||
|
|
|
|||
|
|
@ -482,8 +482,8 @@ void bhv_chain_chomp_update(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 1000.0f);
|
||||
if (so) {
|
||||
so->syncDeathEvent = FALSE;
|
||||
sync_object_init_field(o, &o->oChainChompUnk104);
|
||||
sync_object_init_field_with_size(o, &o->header.gfx.animInfo.animFrame, 16);
|
||||
sync_object_init_field(o, o->oChainChompUnk104);
|
||||
sync_object_init_field(o, o->header.gfx.animInfo.animFrame);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -506,12 +506,12 @@ void bhv_chain_chomp_update(void) {
|
|||
void bhv_wooden_post_update(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oBehParams);
|
||||
sync_object_init_field(o, &o->oWoodenPostMarioPounding);
|
||||
sync_object_init_field(o, &o->oWoodenPostOffsetY);
|
||||
sync_object_init_field(o, &o->oWoodenPostSpeedY);
|
||||
sync_object_init_field(o, &o->oWoodenPostTotalMarioAngle);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, o->oBehParams);
|
||||
sync_object_init_field(o, o->oWoodenPostMarioPounding);
|
||||
sync_object_init_field(o, o->oWoodenPostOffsetY);
|
||||
sync_object_init_field(o, o->oWoodenPostSpeedY);
|
||||
sync_object_init_field(o, o->oWoodenPostTotalMarioAngle);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
}
|
||||
|
||||
// When ground pounded by mario, drop by -45 + -20
|
||||
|
|
|
|||
|
|
@ -227,11 +227,11 @@ void bhv_chuckya_loop(void) {
|
|||
if (so != NULL) {
|
||||
so->override_ownership = bhv_chuckya_override_ownership;
|
||||
so->ignore_if_true = bhv_chuckya_ignore_if_true;
|
||||
sync_object_init_field(o, &o->oChuckyaUnk88);
|
||||
sync_object_init_field(o, &o->oChuckyaUnkF8);
|
||||
sync_object_init_field(o, &o->oChuckyaUnkFC);
|
||||
sync_object_init_field(o, &o->oChuckyaUnk100);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oChuckyaUnk88);
|
||||
sync_object_init_field(o, o->oChuckyaUnkF8);
|
||||
sync_object_init_field(o, o->oChuckyaUnkFC);
|
||||
sync_object_init_field(o, o->oChuckyaUnk100);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ void clam_act_1(void) {
|
|||
void bhv_clam_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oClamUnkF4);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oClamUnkF4);
|
||||
}
|
||||
o->header.gfx.scale[1] = 1.5f;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@ static void cloud_act_fwoosh_hidden(void) {
|
|||
static void cloud_fwoosh_update(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, &o->oCloudCenterX);
|
||||
sync_object_init_field(o, &o->oCloudCenterY);
|
||||
sync_object_init_field(o, &o->oCloudBlowing);
|
||||
sync_object_init_field(o, &o->oCloudGrowSpeed);
|
||||
sync_object_init_field(o, &o->oCloudFwooshMovementRadius);
|
||||
sync_object_init_field(o, o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, o->oCloudCenterX);
|
||||
sync_object_init_field(o, o->oCloudCenterY);
|
||||
sync_object_init_field(o, o->oCloudBlowing);
|
||||
sync_object_init_field(o, o->oCloudGrowSpeed);
|
||||
sync_object_init_field(o, o->oCloudFwooshMovementRadius);
|
||||
}
|
||||
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
|
|
|
|||
|
|
@ -85,30 +85,30 @@ void bhv_controllable_platform_init(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so != NULL) {
|
||||
so->on_received_post = bhv_controllable_platform_on_received_post;
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oVelX);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oVelZ);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field_with_size(o, &o->activeFlags, 16);
|
||||
sync_object_init_field_with_size(o, &D_80331694, 8);
|
||||
sync_object_init_field_with_size(o, &o->header.gfx.node.flags, 16);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oVelX);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oVelZ);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->activeFlags);
|
||||
sync_object_init_field(o, D_80331694);
|
||||
sync_object_init_field(o, o->header.gfx.node.flags);
|
||||
|
||||
sync_object_init_field(o, &o->oControllablePlatformUnkF8);
|
||||
sync_object_init_field(o, &o->oControllablePlatformUnkFC);
|
||||
sync_object_init_field(o, &o->oControllablePlatformUnk100);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oControllablePlatformUnkF8);
|
||||
sync_object_init_field(o, o->oControllablePlatformUnkFC);
|
||||
sync_object_init_field(o, o->oControllablePlatformUnk100);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
for (s32 i = 0; i < 4; i++) {
|
||||
if (controllablePlatformSubs[i] == NULL) { continue; }
|
||||
sync_object_init_field(o, &controllablePlatformSubs[i]->oAction);
|
||||
sync_object_init_field(o, &controllablePlatformSubs[i]->oPrevAction);
|
||||
sync_object_init_field(o, &controllablePlatformSubs[i]->oTimer);
|
||||
sync_object_init_field(o, &controllablePlatformSubs[i]->oParentRelativePosY);
|
||||
sync_object_init_field(o, controllablePlatformSubs[i]->oAction);
|
||||
sync_object_init_field(o, controllablePlatformSubs[i]->oPrevAction);
|
||||
sync_object_init_field(o, controllablePlatformSubs[i]->oTimer);
|
||||
sync_object_init_field(o, controllablePlatformSubs[i]->oParentRelativePosY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ void bhv_donut_platform_spawner_update(void) {
|
|||
void bhv_donut_platform_update(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oGravity);
|
||||
sync_object_init_field(o, &o->oIntangibleTimer);
|
||||
sync_object_init_field(o, o->oGravity);
|
||||
sync_object_init_field(o, o->oIntangibleTimer);
|
||||
}
|
||||
|
||||
struct Object* player = nearest_player_to_object(o);
|
||||
|
|
|
|||
|
|
@ -167,12 +167,12 @@ void bhv_dorrie_update(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
so->ignore_if_true = bhv_dorrie_ignore_if_true;
|
||||
sync_object_init_field(o, &o->oDorrieOffsetY);
|
||||
sync_object_init_field(o, &o->oDorrieVelY);
|
||||
sync_object_init_field(o, &o->oDorrieYawVel);
|
||||
sync_object_init_field(o, &o->oDorrieLiftingMario);
|
||||
sync_object_init_field(o, &o->oDorrieNeckAngle);
|
||||
sync_object_init_field(o, &o->oAngleVelYaw);
|
||||
sync_object_init_field(o, o->oDorrieOffsetY);
|
||||
sync_object_init_field(o, o->oDorrieVelY);
|
||||
sync_object_init_field(o, o->oDorrieYawVel);
|
||||
sync_object_init_field(o, o->oDorrieLiftingMario);
|
||||
sync_object_init_field(o, o->oDorrieNeckAngle);
|
||||
sync_object_init_field(o, o->oAngleVelYaw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ void bhv_lll_drawbridge_spawner_init(void) {
|
|||
sync_object_init(o, 3000.0f);
|
||||
for (s32 i = 0; i < 2; i++) {
|
||||
if (drawbridge[i] == NULL) { continue; }
|
||||
sync_object_init_field(o, &drawbridge[i]->oFaceAngleRoll);
|
||||
sync_object_init_field(o, &drawbridge[i]->oAction);
|
||||
sync_object_init_field(o, &drawbridge[i]->oPrevAction);
|
||||
sync_object_init_field(o, &drawbridge[i]->oTimer);
|
||||
sync_object_init_field(o, drawbridge[i]->oFaceAngleRoll);
|
||||
sync_object_init_field(o, drawbridge[i]->oAction);
|
||||
sync_object_init_field(o, drawbridge[i]->oPrevAction);
|
||||
sync_object_init_field(o, drawbridge[i]->oTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ void bhv_elevator_init(void) {
|
|||
}
|
||||
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
}
|
||||
|
||||
void (*sElevatorActions[])(void) = { elevator_act_0, elevator_act_1, elevator_act_2, elevator_act_3,
|
||||
|
|
|
|||
|
|
@ -245,9 +245,9 @@ void bhv_enemy_lakitu_update(void) {
|
|||
// PARTIAL_UPDATE
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oEnemyLakituBlinkTimer);
|
||||
sync_object_init_field(o, &o->oEnemyLakituSpinyCooldown);
|
||||
sync_object_init_field(o, &o->oEnemyLakituFaceForwardCountdown);
|
||||
sync_object_init_field(o, o->oEnemyLakituBlinkTimer);
|
||||
sync_object_init_field(o, o->oEnemyLakituSpinyCooldown);
|
||||
sync_object_init_field(o, o->oEnemyLakituFaceForwardCountdown);
|
||||
}
|
||||
|
||||
treat_far_home_as_mario(2000.0f, NULL, NULL);
|
||||
|
|
|
|||
|
|
@ -187,8 +187,8 @@ void bhv_exclamation_box_init(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
so->syncDeathEvent = FALSE;
|
||||
sync_object_init_field(o, &o->oExclamationBoxForce);
|
||||
sync_object_init_field(o, &o->areaTimer);
|
||||
sync_object_init_field(o, o->oExclamationBoxForce);
|
||||
sync_object_init_field(o, o->areaTimer);
|
||||
}
|
||||
|
||||
o->areaTimerType = AREA_TIMER_TYPE_MAXIMUM;
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
void bhv_wdw_express_elevator_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
}
|
||||
|
||||
o->oVelY = 0.0f;
|
||||
|
|
|
|||
|
|
@ -79,34 +79,34 @@ void bhv_eyerok_boss_init(void) {
|
|||
so->minUpdateRate = 1.0f;
|
||||
so->maxUpdateRate = 1.0f;
|
||||
so->syncDeathEvent = FALSE;
|
||||
sync_object_init_field(o, &o->oEyerokBossNumHands);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnkFC);
|
||||
sync_object_init_field(o, &o->oEyerokBossActiveHand);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnk104);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnk108);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnk10C);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnk110);
|
||||
sync_object_init_field(o, &o->oEyerokBossUnk1AC);
|
||||
sync_object_init_field(o, o->oEyerokBossNumHands);
|
||||
sync_object_init_field(o, o->oEyerokBossUnkFC);
|
||||
sync_object_init_field(o, o->oEyerokBossActiveHand);
|
||||
sync_object_init_field(o, o->oEyerokBossUnk104);
|
||||
sync_object_init_field(o, o->oEyerokBossUnk108);
|
||||
sync_object_init_field(o, o->oEyerokBossUnk10C);
|
||||
sync_object_init_field(o, o->oEyerokBossUnk110);
|
||||
sync_object_init_field(o, o->oEyerokBossUnk1AC);
|
||||
for (s32 i = 0; i < 2; i++) {
|
||||
sync_object_init_field(o, &hands[i]->oPosX);
|
||||
sync_object_init_field(o, &hands[i]->oPosY);
|
||||
sync_object_init_field(o, &hands[i]->oPosZ);
|
||||
sync_object_init_field(o, &hands[i]->oVelX);
|
||||
sync_object_init_field(o, &hands[i]->oVelY);
|
||||
sync_object_init_field(o, &hands[i]->oVelZ);
|
||||
sync_object_init_field(o, &hands[i]->oForwardVel);
|
||||
sync_object_init_field(o, &hands[i]->oAction);
|
||||
sync_object_init_field(o, &hands[i]->oPrevAction);
|
||||
sync_object_init_field(o, &hands[i]->oTimer);
|
||||
sync_object_init_field(o, &hands[i]->oHealth);
|
||||
sync_object_init_field(o, &hands[i]->oEyerokHandWakeUpTimer);
|
||||
sync_object_init_field(o, &hands[i]->oEyerokReceivedAttack);
|
||||
sync_object_init_field(o, &hands[i]->oEyerokHandUnkFC);
|
||||
sync_object_init_field(o, &hands[i]->oEyerokHandUnk100);
|
||||
sync_object_init_field(o, &hands[i]->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &hands[i]->oMoveAngleYaw);
|
||||
sync_object_init_field(o, &hands[i]->oGravity);
|
||||
sync_object_init_field(o, &hands[i]->oAnimState);
|
||||
sync_object_init_field(o, hands[i]->oPosX);
|
||||
sync_object_init_field(o, hands[i]->oPosY);
|
||||
sync_object_init_field(o, hands[i]->oPosZ);
|
||||
sync_object_init_field(o, hands[i]->oVelX);
|
||||
sync_object_init_field(o, hands[i]->oVelY);
|
||||
sync_object_init_field(o, hands[i]->oVelZ);
|
||||
sync_object_init_field(o, hands[i]->oForwardVel);
|
||||
sync_object_init_field(o, hands[i]->oAction);
|
||||
sync_object_init_field(o, hands[i]->oPrevAction);
|
||||
sync_object_init_field(o, hands[i]->oTimer);
|
||||
sync_object_init_field(o, hands[i]->oHealth);
|
||||
sync_object_init_field(o, hands[i]->oEyerokHandWakeUpTimer);
|
||||
sync_object_init_field(o, hands[i]->oEyerokReceivedAttack);
|
||||
sync_object_init_field(o, hands[i]->oEyerokHandUnkFC);
|
||||
sync_object_init_field(o, hands[i]->oEyerokHandUnk100);
|
||||
sync_object_init_field(o, hands[i]->oFaceAngleYaw);
|
||||
sync_object_init_field(o, hands[i]->oMoveAngleYaw);
|
||||
sync_object_init_field(o, hands[i]->oGravity);
|
||||
sync_object_init_field(o, hands[i]->oAnimState);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ void bhv_squishable_platform_loop(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
so->minUpdateRate = 5.0f;
|
||||
sync_object_init_field(o, &o->oPlatformTimer);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, o->oPlatformTimer);
|
||||
sync_object_init_field(o, o->header.gfx.scale[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ void bhv_bitfs_sinking_platform_loop(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
so->minUpdateRate = 5.0f;
|
||||
sync_object_init_field(o, &o->oPlatformTimer);
|
||||
sync_object_init_field(o, o->oPlatformTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ void bhv_bitfs_sinking_cage_platform_loop(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
so->minUpdateRate = 5.0f;
|
||||
sync_object_init_field(o, &o->oPlatformTimer);
|
||||
sync_object_init_field(o, o->oPlatformTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void bhv_ferris_wheel_axle_init(void) {
|
|||
if (so) {
|
||||
so->hasStandardFields = FALSE;
|
||||
so->maxUpdateRate = 5.0f;
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,9 +61,9 @@ void bhv_ferris_wheel_platform_init(void) {
|
|||
if (so) {
|
||||
so->hasStandardFields = FALSE;
|
||||
so->maxUpdateRate = 5.0f;
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ void bhv_fire_piranha_plant_init(void) {
|
|||
sNumActiveFirePiranhaPlants = sNumKilledFirePiranhaPlants = 0;
|
||||
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &sNumActiveFirePiranhaPlants);
|
||||
sync_object_init_field(o, &sNumKilledFirePiranhaPlants);
|
||||
sync_object_init_field(o, sNumActiveFirePiranhaPlants);
|
||||
sync_object_init_field(o, sNumKilledFirePiranhaPlants);
|
||||
}
|
||||
|
||||
static void fire_piranha_plant_act_hide(void) {
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ void bhv_fire_spitter_update(void) {
|
|||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
so->on_received_post = bhv_fire_spitter_on_received_post;
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oFireSpitterScaleVel);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[2]);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oFireSpitterScaleVel);
|
||||
sync_object_init_field(o, o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ void bhv_flamethrower_flame_loop(void) {
|
|||
void bhv_flamethrower_loop(void) {
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oFlameThowerUnk110);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oFlameThowerUnk110);
|
||||
}
|
||||
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
||||
struct Object* player = marioState ? marioState->marioObj : NULL;
|
||||
|
|
|
|||
|
|
@ -207,11 +207,11 @@ void bhv_fly_guy_update(void) {
|
|||
|
||||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oFlyGuyOscTimer);
|
||||
sync_object_init_field(o, &o->oFlyGuyLungeYDecel);
|
||||
sync_object_init_field(o, &o->oFlyGuyLungeTargetPitch);
|
||||
sync_object_init_field(o, &o->oFlyGuyTargetRoll);
|
||||
sync_object_init_field(o, &o->oFlyGuyLungeTargetPitch);
|
||||
sync_object_init_field(o, o->oFlyGuyOscTimer);
|
||||
sync_object_init_field(o, o->oFlyGuyLungeYDecel);
|
||||
sync_object_init_field(o, o->oFlyGuyLungeTargetPitch);
|
||||
sync_object_init_field(o, o->oFlyGuyTargetRoll);
|
||||
sync_object_init_field(o, o->oFlyGuyLungeTargetPitch);
|
||||
}
|
||||
|
||||
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
|
||||
|
|
|
|||
|
|
@ -279,13 +279,13 @@ void bhv_haunted_bookshelf_manager_loop(void) {
|
|||
so->syncDeathEvent = FALSE;
|
||||
so->override_ownership = bhv_haunted_bookshelf_manager_override_ownership;
|
||||
so->ignore_if_true = bhv_haunted_bookshelf_manager_ignore_if_true;
|
||||
sync_object_init_field_with_size(o, &o->activeFlags, 16);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oBookSwitchManagerUnkF8);
|
||||
sync_object_init_field(o, &o->oBookSwitchManagerUnkF4);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, o->activeFlags);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oBookSwitchManagerUnkF8);
|
||||
sync_object_init_field(o, o->oBookSwitchManagerUnkF4);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -315,12 +315,12 @@ void bhv_book_switch_loop(void) {
|
|||
so->override_ownership = bhv_haunted_bookshelf_manager_override_ownership;
|
||||
so->ignore_if_true = bhv_haunted_bookshelf_manager_ignore_if_true;
|
||||
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oBookSwitchUnkF4);
|
||||
sync_object_init_field(o, &o->oIntangibleTimer);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oBookSwitchUnkF4);
|
||||
sync_object_init_field(o, o->oIntangibleTimer);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ void bhv_goomba_init(void) {
|
|||
o->oGravity = -8.0f / 3.0f * o->oGoombaScale;
|
||||
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oGoombaTargetYaw);
|
||||
sync_object_init_field(o, &o->oGoombaWalkTimer);
|
||||
sync_object_init_field(o, o->oGoombaTargetYaw);
|
||||
sync_object_init_field(o, o->oGoombaWalkTimer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,27 +26,27 @@ void bhv_grand_star_init(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, &o->header.gfx.scale[2]);
|
||||
sync_object_init_field(o, &o->oPrevAction);
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oSubAction);
|
||||
sync_object_init_field(o, &o->oInteractStatus);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, &o->oHomeX);
|
||||
sync_object_init_field(o, &o->oHomeY);
|
||||
sync_object_init_field(o, &o->oHomeZ);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oGravity);
|
||||
sync_object_init_field(o, &o->oVelY);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oAngleVelYaw);
|
||||
sync_object_init_field(o, &o->oMoveAngleYaw);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &o->oGraphYOffset);
|
||||
sync_object_init_field(o, o->header.gfx.scale[0]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[1]);
|
||||
sync_object_init_field(o, o->header.gfx.scale[2]);
|
||||
sync_object_init_field(o, o->oPrevAction);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oSubAction);
|
||||
sync_object_init_field(o, o->oInteractStatus);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
sync_object_init_field(o, o->oHomeX);
|
||||
sync_object_init_field(o, o->oHomeY);
|
||||
sync_object_init_field(o, o->oHomeZ);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oGravity);
|
||||
sync_object_init_field(o, o->oVelY);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oAngleVelYaw);
|
||||
sync_object_init_field(o, o->oMoveAngleYaw);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oGraphYOffset);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@ void bhv_haunted_chair_init(void) {
|
|||
}
|
||||
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, &o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, &o->oHauntedChairUnk104);
|
||||
sync_object_init_field(o, &o->oHauntedChairUnkF4);
|
||||
sync_object_init_field(o, &o->oHauntedChairUnkF8);
|
||||
sync_object_init_field(o, &o->oHauntedChairUnkFC);
|
||||
sync_object_init_field(o, &o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, &o->oMoveAngleYaw);
|
||||
sync_object_init_field(o, o->oFaceAnglePitch);
|
||||
sync_object_init_field(o, o->oFaceAngleRoll);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oHauntedChairUnk104);
|
||||
sync_object_init_field(o, o->oHauntedChairUnkF4);
|
||||
sync_object_init_field(o, o->oHauntedChairUnkF8);
|
||||
sync_object_init_field(o, o->oHauntedChairUnkFC);
|
||||
sync_object_init_field(o, o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, o->oMoveAngleYaw);
|
||||
}
|
||||
|
||||
void haunted_chair_act_0(void) {
|
||||
|
|
|
|||
|
|
@ -136,11 +136,11 @@ void bhv_heave_ho_loop(void) {
|
|||
if (so != NULL) {
|
||||
so->override_ownership = bhv_heave_ho_override_ownership;
|
||||
so->ignore_if_true = bhv_heave_ho_ignore_if_true;
|
||||
sync_object_init_field(o, &o->oHeaveHoUnk88);
|
||||
sync_object_init_field(o, &o->oHeaveHoUnkF4);
|
||||
sync_object_init_field(o, &o->oInteractStatus);
|
||||
sync_object_init_field(o, &o->oGraphYOffset);
|
||||
sync_object_init_field(o, &o->oFaceAngleYaw);
|
||||
sync_object_init_field(o, o->oHeaveHoUnk88);
|
||||
sync_object_init_field(o, o->oHeaveHoUnkF4);
|
||||
sync_object_init_field(o, o->oInteractStatus);
|
||||
sync_object_init_field(o, o->oGraphYOffset);
|
||||
sync_object_init_field(o, o->oFaceAngleYaw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ void bhv_hidden_star_init(void) {
|
|||
if (!sync_object_is_initialized(o->oSyncID)) {
|
||||
struct SyncObject *so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
sync_object_init_field(o, &o->oAction);
|
||||
sync_object_init_field(o, &o->oHiddenStarTriggerCounter);
|
||||
sync_object_init_field(o, &o->oPosX);
|
||||
sync_object_init_field(o, &o->oPosY);
|
||||
sync_object_init_field(o, &o->oPosZ);
|
||||
sync_object_init_field(o, &o->oTimer);
|
||||
sync_object_init_field(o, o->oAction);
|
||||
sync_object_init_field(o, o->oHiddenStarTriggerCounter);
|
||||
sync_object_init_field(o, o->oPosX);
|
||||
sync_object_init_field(o, o->oPosY);
|
||||
sync_object_init_field(o, o->oPosZ);
|
||||
sync_object_init_field(o, o->oTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ void bhv_hoot_init(void) {
|
|||
struct SyncObject* so = sync_object_init(o, 4000.0f);
|
||||
if (so) {
|
||||
so->ignore_if_true = bhv_hoot_ignore_if_true;
|
||||
sync_object_init_field(o, &o->oHootAvailability);
|
||||
sync_object_init_field(o, &o->oMoveAnglePitch);
|
||||
sync_object_init_field_with_size(o, &o->header.gfx.animInfo.animFrame, 16);
|
||||
sync_object_init_field(o, o->oHootAvailability);
|
||||
sync_object_init_field(o, o->oMoveAnglePitch);
|
||||
sync_object_init_field(o, o->header.gfx.animInfo.animFrame);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ void bhv_horizontal_grindel_init(void) {
|
|||
o->oHorizontalGrindelTargetYaw = o->oMoveAngleYaw;
|
||||
|
||||
sync_object_init(o, 4000.0f);
|
||||
sync_object_init_field(o, &o->oHorizontalGrindelOnGround);
|
||||
sync_object_init_field(o, &o->oHorizontalGrindelTargetYaw);
|
||||
sync_object_init_field(o, &o->oHorizontalGrindelDistToHome);
|
||||
sync_object_init_field(o, &o->oMoveFlags);
|
||||
sync_object_init_field(o, &o->oForwardVel);
|
||||
sync_object_init_field(o, &o->oGravity);
|
||||
sync_object_init_field(o, o->oHorizontalGrindelOnGround);
|
||||
sync_object_init_field(o, o->oHorizontalGrindelTargetYaw);
|
||||
sync_object_init_field(o, o->oHorizontalGrindelDistToHome);
|
||||
sync_object_init_field(o, o->oMoveFlags);
|
||||
sync_object_init_field(o, o->oForwardVel);
|
||||
sync_object_init_field(o, o->oGravity);
|
||||
}
|
||||
|
||||
void bhv_horizontal_grindel_update(void) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue