mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-16 07:10:34 -05:00
Merge pull request #4290 from Archez/macready-golf-merge
merge Macready Golf -> develop
This commit is contained in:
commit
86580fc79f
@ -5,11 +5,11 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
|||||||
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||||
|
|
||||||
project(Ship VERSION 8.0.5 LANGUAGES C CXX)
|
project(Ship VERSION 8.0.6 LANGUAGES C CXX)
|
||||||
include(CMake/soh-cvars.cmake)
|
include(CMake/soh-cvars.cmake)
|
||||||
include(CMake/lus-cvars.cmake)
|
include(CMake/lus-cvars.cmake)
|
||||||
set(PROJECT_BUILD_NAME "MacReady Foxtrot" CACHE STRING "")
|
set(PROJECT_BUILD_NAME "MacReady Golf" CACHE STRING "" FORCE)
|
||||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
||||||
|
@ -1257,6 +1257,8 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||||||
s32 dListIndex);
|
s32 dListIndex);
|
||||||
void SkelAnime_DrawSkeletonOpa(PlayState* play, SkelAnime* skelAnime, OverrideLimbDrawOpa overrideLimbDraw,
|
void SkelAnime_DrawSkeletonOpa(PlayState* play, SkelAnime* skelAnime, OverrideLimbDrawOpa overrideLimbDraw,
|
||||||
PostLimbDrawOpa postLimbDraw, void* arg);
|
PostLimbDrawOpa postLimbDraw, void* arg);
|
||||||
|
Gfx* SkelAnime_DrawSkeleton2(PlayState* play, SkelAnime* skelAnime, OverrideLimbDrawOpa overrideLimbDraw,
|
||||||
|
PostLimbDrawOpa postLimbDraw, void* arg, Gfx* gfx);
|
||||||
void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
|
void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg);
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg);
|
||||||
void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||||
@ -2462,6 +2464,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP);
|
|||||||
|
|
||||||
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH);
|
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH);
|
||||||
void Interface_RandoRestoreSwordless(void);
|
void Interface_RandoRestoreSwordless(void);
|
||||||
|
s32 Ship_CalcShouldDrawAndUpdate(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW, bool* shouldDraw,
|
||||||
|
bool* shouldUpdate);
|
||||||
|
|
||||||
//Pause Warp
|
//Pause Warp
|
||||||
void PauseWarp_HandleSelection();
|
void PauseWarp_HandleSelection();
|
||||||
|
@ -1484,6 +1484,8 @@ typedef struct PlayState {
|
|||||||
/* 0x1242B */ u8 unk_1242B;
|
/* 0x1242B */ u8 unk_1242B;
|
||||||
/* 0x1242C */ SceneTableEntry* loadedScene;
|
/* 0x1242C */ SceneTableEntry* loadedScene;
|
||||||
/* 0x12430 */ char unk_12430[0xE8];
|
/* 0x12430 */ char unk_12430[0xE8];
|
||||||
|
// SOH [Custom Models] MTX tracker for flex based skeletons
|
||||||
|
Mtx** flexLimbOverrideMTX;
|
||||||
} PlayState; // size = 0x12518
|
} PlayState; // size = 0x12518
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -782,7 +782,7 @@ void DrawFlagTableArray16(const FlagTable& flagTable, uint16_t row, uint16_t& fl
|
|||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
if (ImGui::IsItemHovered() && hasDescription) {
|
if (ImGui::IsItemHovered() && hasDescription) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", UIWidgets::WrappedText(flagTable.flagDescriptions.at(row * 16 + flagIndex), 60));
|
ImGui::Text("%s", UIWidgets::WrappedText(flagTable.flagDescriptions.at(row * 16 + flagIndex), 60).c_str());
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
@ -226,6 +226,8 @@ const std::vector<const char*> enhancementsCvars = {
|
|||||||
CVAR_ENHANCEMENT("DisableLOD"),
|
CVAR_ENHANCEMENT("DisableLOD"),
|
||||||
CVAR_ENHANCEMENT("DisableDrawDistance"),
|
CVAR_ENHANCEMENT("DisableDrawDistance"),
|
||||||
CVAR_ENHANCEMENT("DisableKokiriDrawDistance"),
|
CVAR_ENHANCEMENT("DisableKokiriDrawDistance"),
|
||||||
|
CVAR_ENHANCEMENT("WidescreenActorCulling"),
|
||||||
|
CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"),
|
||||||
CVAR_LOW_RES_MODE,
|
CVAR_LOW_RES_MODE,
|
||||||
CVAR_ENHANCEMENT("DrawLineupTick"),
|
CVAR_ENHANCEMENT("DrawLineupTick"),
|
||||||
CVAR_ENHANCEMENT("QuickBongoKill"),
|
CVAR_ENHANCEMENT("QuickBongoKill"),
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <cstdio> // std::sprintf
|
#include <cstdio> // std::sprintf
|
||||||
|
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
#include <spdlog/fmt/fmt.h>
|
|
||||||
|
|
||||||
#include <soh/OTRGlobals.h>
|
#include <soh/OTRGlobals.h>
|
||||||
#include <soh/OTRAudio.h>
|
#include <soh/OTRAudio.h>
|
||||||
@ -25,19 +24,6 @@
|
|||||||
|
|
||||||
extern "C" PlayState* gPlayState;
|
extern "C" PlayState* gPlayState;
|
||||||
|
|
||||||
template <> struct fmt::formatter<RequestType> {
|
|
||||||
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
|
||||||
|
|
||||||
template <typename FormatContext>
|
|
||||||
auto format(const RequestType& type, FormatContext& ctx) {
|
|
||||||
switch (type) {
|
|
||||||
case RequestType::SAVE: return fmt::format_to(ctx.out(), "Save");
|
|
||||||
case RequestType::LOAD: return fmt::format_to(ctx.out(), "Load");
|
|
||||||
default: return fmt::format_to(ctx.out(), "Unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// FROM z_lights.c
|
// FROM z_lights.c
|
||||||
// I didn't feel like moving it into a header file.
|
// I didn't feel like moving it into a header file.
|
||||||
#define LIGHTS_BUFFER_SIZE 32
|
#define LIGHTS_BUFFER_SIZE 32
|
||||||
@ -862,11 +848,11 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
|
|||||||
this->states[request.slot]->Load();
|
this->states[request.slot]->Load();
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot);
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot);
|
||||||
} else {
|
} else {
|
||||||
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
|
SPDLOG_ERROR("Invalid SaveState slot: {}", request.slot);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
SPDLOG_ERROR("Invalid SaveState request type: {}", request.type);
|
SPDLOG_ERROR("Invalid SaveState request type: Unknown ({})", static_cast<int>(request.type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this->requests.pop();
|
this->requests.pop();
|
||||||
@ -889,12 +875,12 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
|
|||||||
requests.push(request);
|
requests.push(request);
|
||||||
return SaveStateReturn::SUCCESS;
|
return SaveStateReturn::SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
|
SPDLOG_ERROR("Invalid SaveState slot: {}", request.slot);
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot);
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot);
|
||||||
return SaveStateReturn::FAIL_INVALID_SLOT;
|
return SaveStateReturn::FAIL_INVALID_SLOT;
|
||||||
}
|
}
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
SPDLOG_ERROR("Invalid SaveState request type: {}", request.type);
|
SPDLOG_ERROR("Invalid SaveState request type: Unknown ({})", static_cast<int>(request.type));
|
||||||
return SaveStateReturn::FAIL_BAD_REQUEST;
|
return SaveStateReturn::FAIL_BAD_REQUEST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1832,6 +1832,7 @@ extern "C" char* ResourceMgr_LoadArrayByName(const char* path)
|
|||||||
return (char*)res->Scalars.data();
|
return (char*)res->Scalars.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return of LoadArrayByNameAsVec3s must be freed by the caller
|
||||||
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
|
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
|
||||||
auto res = std::static_pointer_cast<SOH::Array>(GetResourceByNameHandlingMQ(path));
|
auto res = std::static_pointer_cast<SOH::Array>(GetResourceByNameHandlingMQ(path));
|
||||||
|
|
||||||
|
@ -51,6 +51,12 @@ std::string GetWindowButtonText(const char* text, bool menuOpen) {
|
|||||||
return buttonText;
|
return buttonText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = {
|
||||||
|
{ Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" },
|
||||||
|
{ Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" },
|
||||||
|
{ Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" },
|
||||||
|
};
|
||||||
|
|
||||||
static const char* imguiScaleOptions[4] = { "Small", "Normal", "Large", "X-Large" };
|
static const char* imguiScaleOptions[4] = { "Small", "Normal", "Large", "X-Large" };
|
||||||
|
|
||||||
static const char* filters[3] = {
|
static const char* filters[3] = {
|
||||||
@ -103,6 +109,24 @@ extern "C" SaveContext gSaveContext;
|
|||||||
|
|
||||||
namespace SohGui {
|
namespace SohGui {
|
||||||
|
|
||||||
|
std::unordered_map<Ship::WindowBackend, const char*> availableWindowBackendsMap;
|
||||||
|
Ship::WindowBackend configWindowBackend;
|
||||||
|
|
||||||
|
void UpdateWindowBackendObjects() {
|
||||||
|
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
|
||||||
|
int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
|
||||||
|
if (Ship::Context::GetInstance()->GetWindow()->IsAvailableWindowBackend(configWindowBackendId)) {
|
||||||
|
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
|
||||||
|
} else {
|
||||||
|
configWindowBackend = runningWindowBackend;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto availableWindowBackends = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends();
|
||||||
|
for (auto& backend : *availableWindowBackends) {
|
||||||
|
availableWindowBackendsMap[backend] = windowBackendNames[backend];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DrawMenuBarIcon() {
|
void DrawMenuBarIcon() {
|
||||||
static bool gameIconLoaded = false;
|
static bool gameIconLoaded = false;
|
||||||
if (!gameIconLoaded) {
|
if (!gameIconLoaded) {
|
||||||
@ -442,38 +466,23 @@ void DrawSettingsMenu() {
|
|||||||
|
|
||||||
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
|
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
|
||||||
|
|
||||||
static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = {
|
|
||||||
{ Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" },
|
|
||||||
{ Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL"},
|
|
||||||
{ Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" }
|
|
||||||
};
|
|
||||||
|
|
||||||
ImGui::Text("Renderer API (Needs reload)");
|
ImGui::Text("Renderer API (Needs reload)");
|
||||||
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
|
|
||||||
Ship::WindowBackend configWindowBackend;
|
|
||||||
int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
|
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->IsAvailableWindowBackend(configWindowBackendId)) {
|
|
||||||
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
|
|
||||||
} else {
|
|
||||||
configWindowBackend = runningWindowBackend;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) {
|
if (availableWindowBackendsMap.size() <= 1) {
|
||||||
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
|
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
|
||||||
}
|
}
|
||||||
if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) {
|
if (ImGui::BeginCombo("##RApi", availableWindowBackendsMap[configWindowBackend])) {
|
||||||
for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) {
|
for (auto backend : availableWindowBackendsMap) {
|
||||||
auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i];
|
if (ImGui::Selectable(backend.second, backend.first == configWindowBackend)) {
|
||||||
if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) {
|
Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast<int>(backend.first));
|
||||||
Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast<int>(backend));
|
Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", backend.second);
|
||||||
Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name",
|
|
||||||
windowBackendNames[backend]);
|
|
||||||
Ship::Context::GetInstance()->GetConfig()->Save();
|
Ship::Context::GetInstance()->GetConfig()->Save();
|
||||||
|
UpdateWindowBackendObjects();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
}
|
}
|
||||||
if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) {
|
if (availableWindowBackendsMap.size() <= 1) {
|
||||||
UIWidgets::ReEnableComponent("");
|
UIWidgets::ReEnableComponent("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1147,26 +1156,42 @@ void DrawEnhancementsMenu() {
|
|||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Disable LOD", CVAR_ENHANCEMENT("DisableLOD"), true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Disable LOD", CVAR_ENHANCEMENT("DisableLOD"), true, false);
|
||||||
UIWidgets::Tooltip("Turns off the Level of Detail setting, making models use their higher-poly variants at any distance");
|
UIWidgets::Tooltip(
|
||||||
if (UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", CVAR_ENHANCEMENT("DisableDrawDistance"), true, false)) {
|
"Turns off the Level of Detail setting, making models use their higher-poly variants at any distance");
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) == 0) {
|
if (UIWidgets::EnhancementSliderInt("Increase Actor Draw Distance: %dx", "##IncreaseActorDrawDistance",
|
||||||
|
CVAR_ENHANCEMENT("DisableDrawDistance"), 1, 5, "", 1, true, false)) {
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) <= 1) {
|
||||||
CVarSetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0);
|
CVarSetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UIWidgets::Tooltip("Turns off the objects draw distance, making objects being visible from a longer range");
|
UIWidgets::Tooltip("Increases the range in which actors/objects are drawn");
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) == 1) {
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) > 1) {
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance",
|
||||||
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance");
|
CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), true, false);
|
||||||
}
|
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this "
|
||||||
if (UIWidgets::PaddedEnhancementCheckbox("Show Age-Dependent Equipment", CVAR_ENHANCEMENT("EquimentAlwaysVisible"), true,
|
"will remove their draw distance");
|
||||||
false)) {
|
|
||||||
UpdatePatchHand();
|
|
||||||
}
|
|
||||||
UIWidgets::Tooltip("Makes all equipment visible, regardless of Age.");
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("EquimentAlwaysVisible"), 0) == 1) {
|
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Scale Adult Equipment as Child", CVAR_ENHANCEMENT("ScaleAdultEquimentAsChild"), true, false);
|
|
||||||
UIWidgets::Tooltip("Scales all of the Adult Equipment, as well and moving some a bit, to fit on Child Link Better. May not work properly with some mods.");
|
|
||||||
}
|
}
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox("Widescreen Actor Culling", CVAR_ENHANCEMENT("WidescreenActorCulling"),
|
||||||
|
true, false);
|
||||||
|
UIWidgets::Tooltip("Adjusts the horizontal culling plane to account for widescreen resolutions");
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox(
|
||||||
|
"Cull Glitch Useful Actors", CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), true, false,
|
||||||
|
!CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0) &&
|
||||||
|
CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) <= 1,
|
||||||
|
"Requires Actor Draw Distance to be increased or Widescreen Actor Culling enabled");
|
||||||
|
UIWidgets::Tooltip(
|
||||||
|
"Exclude actors that are useful for glitches from the extended culling ranges.\n"
|
||||||
|
"Some actors may still draw in the extended ranges, but will not \"update\" so that certain "
|
||||||
|
"glitches that leverage the original culling requirements will still work.\n"
|
||||||
|
"\n"
|
||||||
|
"The following actors are excluded:\n"
|
||||||
|
"- White clothed Gerudos\n"
|
||||||
|
"- King Zora\n"
|
||||||
|
"- Gossip Stones\n"
|
||||||
|
"- Boulders\n"
|
||||||
|
"- Blue Warps\n"
|
||||||
|
"- Darunia\n"
|
||||||
|
"- Gold Skulltulas");
|
||||||
UIWidgets::PaddedEnhancementCheckbox("N64 Mode", CVAR_LOW_RES_MODE, true, false);
|
UIWidgets::PaddedEnhancementCheckbox("N64 Mode", CVAR_LOW_RES_MODE, true, false);
|
||||||
UIWidgets::Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution");
|
UIWidgets::Tooltip("Sets aspect ratio to 4:3 and lowers resolution to 240p, the N64's native resolution");
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Glitch line-up tick", CVAR_ENHANCEMENT("DrawLineupTick"), true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Glitch line-up tick", CVAR_ENHANCEMENT("DrawLineupTick"), true, false);
|
||||||
@ -2004,6 +2029,10 @@ void DrawRandomizerMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SohMenuBar::InitElement() {
|
||||||
|
UpdateWindowBackendObjects();
|
||||||
|
}
|
||||||
|
|
||||||
void SohMenuBar::DrawElement() {
|
void SohMenuBar::DrawElement() {
|
||||||
if (ImGui::BeginMenuBar()) {
|
if (ImGui::BeginMenuBar()) {
|
||||||
DrawMenuBarIcon();
|
DrawMenuBarIcon();
|
||||||
|
@ -10,7 +10,7 @@ class SohMenuBar : public Ship::GuiMenuBar {
|
|||||||
using Ship::GuiMenuBar::GuiMenuBar;
|
using Ship::GuiMenuBar::GuiMenuBar;
|
||||||
protected:
|
protected:
|
||||||
void DrawElement() override;
|
void DrawElement() override;
|
||||||
void InitElement() override {};
|
void InitElement() override;
|
||||||
void UpdateElement() override {};
|
void UpdateElement() override {};
|
||||||
};
|
};
|
||||||
} // namespace SohGui
|
} // namespace SohGui
|
@ -24,7 +24,7 @@ namespace UIWidgets {
|
|||||||
// Automatically adds newlines to break up text longer than a specified number of characters
|
// Automatically adds newlines to break up text longer than a specified number of characters
|
||||||
// Manually included newlines will still be respected and reset the line length
|
// Manually included newlines will still be respected and reset the line length
|
||||||
// If line is midword when it hits the limit, text should break at the last encountered space
|
// If line is midword when it hits the limit, text should break at the last encountered space
|
||||||
char* WrappedText(const char* text, unsigned int charactersPerLine) {
|
std::string WrappedText(const char* text, unsigned int charactersPerLine) {
|
||||||
std::string newText(text);
|
std::string newText(text);
|
||||||
const size_t tipLength = newText.length();
|
const size_t tipLength = newText.length();
|
||||||
int lastSpace = -1;
|
int lastSpace = -1;
|
||||||
@ -46,17 +46,17 @@ namespace UIWidgets {
|
|||||||
currentLineLength++;
|
currentLineLength++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return strdup(newText.c_str());
|
return newText;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* WrappedText(const std::string& text, unsigned int charactersPerLine) {
|
std::string WrappedText(const std::string& text, unsigned int charactersPerLine) {
|
||||||
return WrappedText(text.c_str(), charactersPerLine);
|
return WrappedText(text.c_str(), charactersPerLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetLastItemHoverText(const std::string& text) {
|
void SetLastItemHoverText(const std::string& text) {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", WrappedText(text, 60));
|
ImGui::Text("%s", WrappedText(text, 60).c_str());
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ namespace UIWidgets {
|
|||||||
void SetLastItemHoverText(const char* text) {
|
void SetLastItemHoverText(const char* text) {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", WrappedText(text, 60));
|
ImGui::Text("%s", WrappedText(text, 60).c_str());
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ namespace UIWidgets {
|
|||||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", WrappedText(text, 60));
|
ImGui::Text("%s", WrappedText(text, 60).c_str());
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ namespace UIWidgets {
|
|||||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?");
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text("%s", WrappedText(text, 60));
|
ImGui::Text("%s", WrappedText(text, 60).c_str());
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ namespace UIWidgets {
|
|||||||
|
|
||||||
void Tooltip(const char* text) {
|
void Tooltip(const char* text) {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("%s", WrappedText(text));
|
ImGui::SetTooltip("%s", WrappedText(text).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ namespace UIWidgets {
|
|||||||
constexpr float sliderButtonWidth = 30.0f;
|
constexpr float sliderButtonWidth = 30.0f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char* WrappedText(const char* text, unsigned int charactersPerLine = 60);
|
std::string WrappedText(const char* text, unsigned int charactersPerLine = 60);
|
||||||
char* WrappedText(const std::string& text, unsigned int charactersPerLine);
|
std::string WrappedText(const std::string& text, unsigned int charactersPerLine);
|
||||||
|
|
||||||
void SetLastItemHoverText(const std::string& text);
|
void SetLastItemHoverText(const std::string& text);
|
||||||
void SetLastItemHoverText(const char* text);
|
void SetLastItemHoverText(const char* text);
|
||||||
|
@ -99,8 +99,14 @@ void aClearBufferImpl(uint16_t addr, int nbytes) {
|
|||||||
memset(BUF_U8(addr), 0, nbytes);
|
memset(BUF_U8(addr), 0, nbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void aLoadBufferImpl(const void *source_addr, uint16_t dest_addr, uint16_t nbytes) {
|
void aLoadBufferImpl(const void* source_addr, uint16_t dest_addr, uint16_t nbytes) {
|
||||||
|
#if __SANITIZE_ADDRESS__
|
||||||
|
for (size_t i = 0; i < ROUND_DOWN_16(nbytes); i++) {
|
||||||
|
BUF_U8(dest_addr)[i] = ((const unsigned char*)source_addr)[i];
|
||||||
|
}
|
||||||
|
#else
|
||||||
memcpy(BUF_U8(dest_addr), source_addr, ROUND_DOWN_16(nbytes));
|
memcpy(BUF_U8(dest_addr), source_addr, ROUND_DOWN_16(nbytes));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void aSaveBufferImpl(uint16_t source_addr, int16_t *dest_addr, uint16_t nbytes) {
|
void aSaveBufferImpl(uint16_t source_addr, int16_t *dest_addr, uint16_t nbytes) {
|
||||||
|
@ -1228,14 +1228,6 @@ void Actor_Init(Actor* actor, PlayState* play) {
|
|||||||
actor->uncullZoneForward = 1000.0f;
|
actor->uncullZoneForward = 1000.0f;
|
||||||
actor->uncullZoneScale = 350.0f;
|
actor->uncullZoneScale = 350.0f;
|
||||||
actor->uncullZoneDownward = 700.0f;
|
actor->uncullZoneDownward = 700.0f;
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
|
||||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
|
||||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
|
||||||
&& (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
|
||||||
actor->uncullZoneForward = 32767.0f;
|
|
||||||
actor->uncullZoneScale = 32767.0f;
|
|
||||||
actor->uncullZoneDownward = 32767.0f;
|
|
||||||
}
|
|
||||||
CollisionCheck_InitInfo(&actor->colChkInfo);
|
CollisionCheck_InitInfo(&actor->colChkInfo);
|
||||||
actor->floorBgId = BGCHECK_SCENE;
|
actor->floorBgId = BGCHECK_SCENE;
|
||||||
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
|
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
|
||||||
@ -2898,34 +2890,93 @@ s32 func_800314B0(PlayState* play, Actor* actor) {
|
|||||||
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) {
|
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) {
|
||||||
f32 var;
|
f32 var;
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
|
||||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
|
||||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
|
||||||
&& (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
|
if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
|
||||||
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
|
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
|
||||||
|
|
||||||
// #region SoH [Widescreen support]
|
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) &&
|
||||||
// Doors will cull quite noticeably on wider screens. For these actors the zone is increased
|
(((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) &&
|
||||||
f32 limit = 1.0f;
|
(((arg2->y - actor->uncullZoneScale) * var) < 1.0f)) {
|
||||||
if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger(CVAR_GENERAL("IncreaseDoorUncullZones"), 1)) {
|
|
||||||
limit = 2.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < limit) &&
|
|
||||||
(((arg2->y + actor->uncullZoneDownward) * var) > -limit) &&
|
|
||||||
(((arg2->y - actor->uncullZoneScale) * var) < limit)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// #endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #region SOH [Enhancements] Allows us to increase the draw and update distance independently,
|
||||||
|
// mostly a modified version of the function above and additional tweaks for some specfic actors
|
||||||
|
s32 Ship_CalcShouldDrawAndUpdate(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW, bool* shouldDraw,
|
||||||
|
bool* shouldUpdate) {
|
||||||
|
f32 clampedProjectedW;
|
||||||
|
|
||||||
|
// Check if the actor passes its original/vanilla culling requirements
|
||||||
|
if (func_800314D4(play, actor, projectedPos, projectedW)) {
|
||||||
|
*shouldUpdate = true;
|
||||||
|
*shouldDraw = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip cutscne actors that depend on culling to hide from camera pans
|
||||||
|
if (actor->id == ACTOR_EN_VIEWER) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 multiplier = CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1);
|
||||||
|
multiplier = MAX(multiplier, 1);
|
||||||
|
|
||||||
|
// Some actors have a really short forward value, so we need to add to it before the multiplier to increase the
|
||||||
|
// final strength of the forward culling
|
||||||
|
f32 adder = (actor->uncullZoneForward < 500) ? 1000.0f : 0.0f;
|
||||||
|
|
||||||
|
if ((projectedPos->z > -actor->uncullZoneScale) &&
|
||||||
|
(projectedPos->z < (((actor->uncullZoneForward + adder) * multiplier) + actor->uncullZoneScale))) {
|
||||||
|
clampedProjectedW = (projectedW < 1.0f) ? 1.0f : 1.0f / projectedW;
|
||||||
|
|
||||||
|
f32 ratioAdjusted = 1.0f;
|
||||||
|
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0)) {
|
||||||
|
f32 originalAspectRatio = 4.0f / 3.0f;
|
||||||
|
f32 currentAspectRatio = OTRGetAspectRatio();
|
||||||
|
ratioAdjusted = MAX(currentAspectRatio / originalAspectRatio, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((((fabsf(projectedPos->x) - actor->uncullZoneScale) * (clampedProjectedW / ratioAdjusted)) < 1.0f) &&
|
||||||
|
(((projectedPos->y + actor->uncullZoneDownward) * clampedProjectedW) > -1.0f) &&
|
||||||
|
(((projectedPos->y - actor->uncullZoneScale) * clampedProjectedW) < 1.0f)) {
|
||||||
|
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 0)) {
|
||||||
|
// These actors are safe to draw without impacting glitches
|
||||||
|
if ((actor->id == ACTOR_OBJ_BOMBIWA || actor->id == ACTOR_OBJ_HAMISHI ||
|
||||||
|
actor->id == ACTOR_EN_ISHI) || // Boulders (hookshot through collision)
|
||||||
|
actor->id == ACTOR_EN_GS || // Gossip stones (text delay)
|
||||||
|
actor->id == ACTOR_EN_GE1 || // White gerudos (gate clip/archery room transition)
|
||||||
|
actor->id == ACTOR_EN_KZ || // King Zora (unfreeze glitch)
|
||||||
|
actor->id == ACTOR_EN_DU || // Darunia (Fire temple BK skip)
|
||||||
|
actor->id == ACTOR_DOOR_WARP1 // Blue warps (wrong warps)
|
||||||
|
) {
|
||||||
|
*shouldDraw = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip these actors entirely as their draw funcs impacts glitches
|
||||||
|
if ((actor->id == ACTOR_EN_SW &&
|
||||||
|
(((actor->params & 0xE000) >> 0xD) == 1 ||
|
||||||
|
((actor->params & 0xE000) >> 0xD) == 2)) // Gold Skulltulas (hitbox at 0,0)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*shouldDraw = true;
|
||||||
|
*shouldUpdate = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// #endregion
|
||||||
|
|
||||||
void func_800315AC(PlayState* play, ActorContext* actorCtx) {
|
void func_800315AC(PlayState* play, ActorContext* actorCtx) {
|
||||||
s32 invisibleActorCounter;
|
s32 invisibleActorCounter;
|
||||||
Actor* invisibleActors[INVISIBLE_ACTOR_MAX];
|
Actor* invisibleActors[INVISIBLE_ACTOR_MAX];
|
||||||
@ -2961,18 +3012,35 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #region SOH [Enhancement] Extended culling updates
|
||||||
|
bool shipShouldDraw = false;
|
||||||
|
bool shipShouldUpdate = false;
|
||||||
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
|
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) > 1 ||
|
||||||
|
CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0)) {
|
||||||
|
Ship_CalcShouldDrawAndUpdate(play, actor, &actor->projectedPos, actor->projectedW, &shipShouldDraw,
|
||||||
|
&shipShouldUpdate);
|
||||||
|
|
||||||
|
if (shipShouldUpdate) {
|
||||||
|
actor->flags |= ACTOR_FLAG_ACTIVE;
|
||||||
|
} else {
|
||||||
|
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (func_800314B0(play, actor)) {
|
if (func_800314B0(play, actor)) {
|
||||||
actor->flags |= ACTOR_FLAG_ACTIVE;
|
actor->flags |= ACTOR_FLAG_ACTIVE;
|
||||||
} else {
|
} else {
|
||||||
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
actor->isDrawn = false;
|
actor->isDrawn = false;
|
||||||
|
|
||||||
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
|
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
|
||||||
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & (ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_ACTIVE))) {
|
if ((actor->init == NULL) && (actor->draw != NULL) &&
|
||||||
|
((actor->flags & (ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_ACTIVE)) || shipShouldDraw)) {
|
||||||
|
// #endregion
|
||||||
if ((actor->flags & ACTOR_FLAG_LENS) &&
|
if ((actor->flags & ACTOR_FLAG_LENS) &&
|
||||||
((play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) ||
|
((play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) ||
|
||||||
play->actorCtx.lensActive || (actor->room != play->roomCtx.curRoom.num))) {
|
play->actorCtx.lensActive || (actor->room != play->roomCtx.curRoom.num))) {
|
||||||
|
@ -131,10 +131,6 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelAnimeCurve* skelCurv
|
|||||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||||
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) {
|
|
||||||
lod = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lod == 0) {
|
if (lod == 0) {
|
||||||
s32 pad1;
|
s32 pad1;
|
||||||
|
|
||||||
|
@ -1116,7 +1116,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msgCtx->textDelayTimer == 0) {
|
if (msgCtx->textDelayTimer == 0) {
|
||||||
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 2);
|
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
|
||||||
msgCtx->textDelayTimer = msgCtx->textDelay;
|
msgCtx->textDelayTimer = msgCtx->textDelay;
|
||||||
} else {
|
} else {
|
||||||
msgCtx->textDelayTimer--;
|
msgCtx->textDelayTimer--;
|
||||||
|
@ -2415,10 +2415,12 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f*
|
|||||||
}
|
}
|
||||||
|
|
||||||
srcTable = ResourceMgr_LoadArrayByNameAsVec3s(srcTable);
|
srcTable = ResourceMgr_LoadArrayByNameAsVec3s(srcTable);
|
||||||
|
Vec3s* ogSrcTable = srcTable;
|
||||||
destTable = skelAnime->jointTable;
|
destTable = skelAnime->jointTable;
|
||||||
for (i = 0; i < skelAnime->limbCount; i++) {
|
for (i = 0; i < skelAnime->limbCount; i++) {
|
||||||
*destTable++ = *srcTable++;
|
*destTable++ = *srcTable++;
|
||||||
}
|
}
|
||||||
|
free(ogSrcTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
Player_DrawPauseImpl(play, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
|
Player_DrawPauseImpl(play, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
|
||||||
|
@ -148,6 +148,8 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
|
|||||||
|
|
||||||
newDList = limbDList = limb->dLists[lod];
|
newDList = limbDList = limb->dLists[lod];
|
||||||
|
|
||||||
|
play->flexLimbOverrideMTX = mtx;
|
||||||
|
|
||||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||||
if (newDList != NULL) {
|
if (newDList != NULL) {
|
||||||
@ -220,6 +222,8 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||||||
|
|
||||||
newDList = limbDList = rootLimb->dLists[lod];
|
newDList = limbDList = rootLimb->dLists[lod];
|
||||||
|
|
||||||
|
play->flexLimbOverrideMTX = &mtx;
|
||||||
|
|
||||||
if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||||
if (newDList != NULL) {
|
if (newDList != NULL) {
|
||||||
@ -306,6 +310,20 @@ void SkelAnime_DrawSkeletonOpa(PlayState* play, SkelAnime* skelAnime, OverrideLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gfx* SkelAnime_DrawSkeleton2(PlayState* play, SkelAnime* skelAnime, OverrideLimbDrawOpa overrideLimbDraw,
|
||||||
|
PostLimbDrawOpa postLimbDraw, void* arg, Gfx* gfx)
|
||||||
|
{
|
||||||
|
if (skelAnime->skeletonHeader->skeletonType == SKELANIME_TYPE_NORMAL) {
|
||||||
|
return SkelAnime_Draw(play, skelAnime->skeleton, skelAnime->jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||||
|
} else if (skelAnime->skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
FlexSkeletonHeader* flexHeader = (FlexSkeletonHeader*)skelAnime->skeletonHeader;
|
||||||
|
return SkelAnime_DrawFlex(play, skelAnime->skeleton, skelAnime->jointTable, flexHeader->dListCount,
|
||||||
|
overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return gfx;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
||||||
*/
|
*/
|
||||||
@ -383,6 +401,8 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton,
|
|||||||
|
|
||||||
newDList = limbDList = limb->dList;
|
newDList = limbDList = limb->dList;
|
||||||
|
|
||||||
|
play->flexLimbOverrideMTX = limbMatricies;
|
||||||
|
|
||||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||||
if (newDList != NULL) {
|
if (newDList != NULL) {
|
||||||
|
@ -1288,6 +1288,10 @@ block_1:
|
|||||||
if (*dList != NULL) {
|
if (*dList != NULL) {
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
if (this->skelAnime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
MATRIX_TOMTX(*play->flexLimbOverrideMTX);
|
||||||
|
}
|
||||||
|
|
||||||
mtxScaleZ = 1.0f;
|
mtxScaleZ = 1.0f;
|
||||||
mtxScaleY = 1.0f;
|
mtxScaleY = 1.0f;
|
||||||
|
|
||||||
@ -1308,11 +1312,20 @@ block_1:
|
|||||||
Matrix_RotateX(-(this->unk_25C[limbIndex] * 0.115f), MTXMODE_APPLY);
|
Matrix_RotateX(-(this->unk_25C[limbIndex] * 0.115f), MTXMODE_APPLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->skelAnime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, *play->flexLimbOverrideMTX, G_MTX_LOAD);
|
||||||
|
} else {
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
|
|
||||||
|
if (this->skelAnime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
(*play->flexLimbOverrideMTX)++;
|
||||||
|
}
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
{ s32 pad; } // Required to match
|
{ s32 pad; } // Required to match
|
||||||
|
@ -2015,12 +2015,26 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
|
|||||||
Matrix_TranslateRotateZYX(pos, rot);
|
Matrix_TranslateRotateZYX(pos, rot);
|
||||||
|
|
||||||
if (*dList != NULL) {
|
if (*dList != NULL) {
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
MATRIX_TOMTX(*play->flexLimbOverrideMTX);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push();
|
Matrix_Push();
|
||||||
Matrix_Scale(this->eyeIrisScaleX, this->eyeIrisScaleY, 1.0f, MTXMODE_APPLY);
|
Matrix_Scale(this->eyeIrisScaleX, this->eyeIrisScaleY, 1.0f, MTXMODE_APPLY);
|
||||||
|
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, *play->flexLimbOverrideMTX, G_MTX_LOAD);
|
||||||
|
} else {
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
|
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
(*play->flexLimbOverrideMTX)++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doNotDrawLimb = true;
|
doNotDrawLimb = true;
|
||||||
@ -2034,14 +2048,28 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
|
|||||||
Matrix_TranslateRotateZYX(pos, rot);
|
Matrix_TranslateRotateZYX(pos, rot);
|
||||||
|
|
||||||
if (*dList != NULL) {
|
if (*dList != NULL) {
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
MATRIX_TOMTX(*play->flexLimbOverrideMTX);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push();
|
Matrix_Push();
|
||||||
Matrix_Scale(this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4],
|
Matrix_Scale(this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4],
|
||||||
this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4],
|
this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4],
|
||||||
this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4], MTXMODE_APPLY);
|
this->tailLimbsScale[limbIndex - BOSSGOMA_LIMB_TAIL4], MTXMODE_APPLY);
|
||||||
|
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
gSPMatrix(POLY_OPA_DISP++, *play->flexLimbOverrideMTX, G_MTX_LOAD);
|
||||||
|
} else {
|
||||||
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
|
|
||||||
|
if (this->skelanime.skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||||
|
(*play->flexLimbOverrideMTX)++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doNotDrawLimb = true;
|
doNotDrawLimb = true;
|
||||||
|
@ -1055,7 +1055,7 @@ void DoorWarp1_DrawBlueCrystal(DoorWarp1* this, PlayState* play) {
|
|||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0xFF, 0xFF, 200, 255, 255, (u8)this->crystalAlpha);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0xFF, 0xFF, 200, 255, 255, (u8)this->crystalAlpha);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, (u8)this->crystalAlpha);
|
gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, (u8)this->crystalAlpha);
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime, NULL, NULL,
|
||||||
&this->actor, POLY_XLU_DISP);
|
&this->actor, POLY_XLU_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
@ -1079,7 +1079,7 @@ void DoorWarp1_DrawPurpleCrystal(DoorWarp1* this, PlayState* play) {
|
|||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)this->crystalAlpha);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)this->crystalAlpha);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 150, 0, 100, (u8)this->crystalAlpha);
|
gDPSetEnvColor(POLY_XLU_DISP++, 150, 0, 100, (u8)this->crystalAlpha);
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime, NULL, NULL,
|
||||||
&this->actor, POLY_XLU_DISP);
|
&this->actor, POLY_XLU_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -768,7 +768,7 @@ void EnBili_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gSPSegment(POLY_XLU_DISP++, 0x09, D_809C1700);
|
gSPSegment(POLY_XLU_DISP++, 0x09, D_809C1700);
|
||||||
}
|
}
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnBili_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
EnBili_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
@ -955,7 +955,7 @@ void EnBox_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, EnBox_EmptyDList(play->state.gfxCtx));
|
gSPSegment(POLY_OPA_DISP++, 0x08, EnBox_EmptyDList(play->state.gfxCtx));
|
||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelanime.skeleton, this->skelanime.jointTable, NULL,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelanime, NULL,
|
||||||
EnBox_PostLimbDraw, this, POLY_OPA_DISP);
|
EnBox_PostLimbDraw, this, POLY_OPA_DISP);
|
||||||
} else if (this->alpha != 0) {
|
} else if (this->alpha != 0) {
|
||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
@ -966,7 +966,7 @@ void EnBox_Draw(Actor* thisx, PlayState* play) {
|
|||||||
} else {
|
} else {
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, func_809CA4A0(play->state.gfxCtx));
|
gSPSegment(POLY_XLU_DISP++, 0x08, func_809CA4A0(play->state.gfxCtx));
|
||||||
}
|
}
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelanime.skeleton, this->skelanime.jointTable, NULL,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelanime, NULL,
|
||||||
EnBox_PostLimbDraw, this, POLY_XLU_DISP);
|
EnBox_PostLimbDraw, this, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
|
|||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
gDPSetEnvColor(POLY_OPA_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
EnBw_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
@ -864,7 +864,7 @@ void EnBw_Draw(Actor* thisx, PlayState* play2) {
|
|||||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a);
|
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->color1.a);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
gDPSetEnvColor(POLY_XLU_DISP++, this->color1.r, this->color1.g, this->color1.b, this->color1.a);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, &D_80116280[0]);
|
gSPSegment(POLY_XLU_DISP++, 0x08, &D_80116280[0]);
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnBw_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
EnBw_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,14 +708,14 @@ void EnEiyer_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
||||||
|
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelanime.skeleton, this->skelanime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelanime,
|
||||||
EnEiyer_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
EnEiyer_OverrideLimbDraw, NULL, this, POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, D_80116280);
|
gSPSegment(POLY_XLU_DISP++, 0x08, D_80116280);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->actor.shape.shadowAlpha);
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->actor.shape.shadowAlpha);
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelanime.skeleton, this->skelanime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelanime,
|
||||||
EnEiyer_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
EnEiyer_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -1540,7 +1540,7 @@ void EnElf_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gSPEndDisplayList(dListHead++);
|
gSPEndDisplayList(dListHead++);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b,
|
gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b,
|
||||||
(u8)(envAlpha * alphaScale));
|
(u8)(envAlpha * alphaScale));
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnElf_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
EnElf_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -839,8 +839,9 @@ void EnFirefly_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime, EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw,
|
||||||
EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
&this->actor, POLY_OPA_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -856,7 +857,7 @@ void EnFirefly_DrawInvisible(Actor* thisx, PlayState* play) {
|
|||||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 255);
|
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw, this, POLY_XLU_DISP);
|
EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw, this, POLY_XLU_DISP);
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
@ -880,7 +880,7 @@ void EnPartner_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gSPEndDisplayList(dListHead++);
|
gSPEndDisplayList(dListHead++);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b,
|
gDPSetEnvColor(POLY_XLU_DISP++, (u8)this->outerColor.r, (u8)this->outerColor.g, (u8)this->outerColor.b,
|
||||||
(u8)(envAlpha * alphaScale));
|
(u8)(envAlpha * alphaScale));
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnPartner_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
EnPartner_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -267,7 +267,7 @@ void EnPoDesert_Draw(Actor* thisx, PlayState* play) {
|
|||||||
} else {
|
} else {
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x0C, D_80116280 + 2);
|
gSPSegment(POLY_XLU_DISP++, 0x0C, D_80116280 + 2);
|
||||||
}
|
}
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnPoDesert_OverrideLimbDraw, EnPoDesert_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
EnPoDesert_OverrideLimbDraw, EnPoDesert_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
@ -944,15 +944,14 @@ void EnPoField_Draw(Actor* thisx, PlayState* play) {
|
|||||||
this->lightColor.a));
|
this->lightColor.a));
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x0C, D_80116280 + 2);
|
gSPSegment(POLY_OPA_DISP++, 0x0C, D_80116280 + 2);
|
||||||
POLY_OPA_DISP =
|
POLY_OPA_DISP =
|
||||||
SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnPoField_OverrideLimbDraw2, EnPoField_PostLimDraw2, &this->actor, POLY_OPA_DISP);
|
EnPoField_OverrideLimbDraw2, EnPoField_PostLimDraw2, &this->actor, POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||||
Gfx_EnvColor(play->state.gfxCtx, this->lightColor.r, this->lightColor.g, this->lightColor.b,
|
Gfx_EnvColor(play->state.gfxCtx, this->lightColor.r, this->lightColor.g, this->lightColor.b,
|
||||||
this->lightColor.a));
|
this->lightColor.a));
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x0C, D_80116280);
|
gSPSegment(POLY_XLU_DISP++, 0x0C, D_80116280);
|
||||||
POLY_XLU_DISP =
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
|
||||||
EnPoField_OverrideLimbDraw2, EnPoField_PostLimDraw2, &this->actor, POLY_XLU_DISP);
|
EnPoField_OverrideLimbDraw2, EnPoField_PostLimDraw2, &this->actor, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
@ -1373,14 +1373,12 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) {
|
|||||||
if (this->unk_22E.a == 255 || this->unk_22E.a == 0) {
|
if (this->unk_22E.a == 255 || this->unk_22E.a == 0) {
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, this->unk_22E.r, this->unk_22E.g, this->unk_22E.b, this->unk_22E.a);
|
gDPSetEnvColor(POLY_OPA_DISP++, this->unk_22E.r, this->unk_22E.g, this->unk_22E.b, this->unk_22E.a);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x09, D_80116280 + 2);
|
gSPSegment(POLY_OPA_DISP++, 0x09, D_80116280 + 2);
|
||||||
POLY_OPA_DISP =
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime, EnPoSisters_OverrideLimbDraw,
|
||||||
SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
EnPoSisters_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
||||||
EnPoSisters_OverrideLimbDraw, EnPoSisters_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
|
||||||
} else {
|
} else {
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->unk_22E.a);
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->unk_22E.a);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280);
|
gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280);
|
||||||
POLY_XLU_DISP =
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
|
||||||
EnPoSisters_OverrideLimbDraw, EnPoSisters_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
EnPoSisters_OverrideLimbDraw, EnPoSisters_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
if (!(this->unk_199 & 0x80)) {
|
if (!(this->unk_199 & 0x80)) {
|
||||||
|
@ -1085,12 +1085,12 @@ void EnPoh_DrawRegular(Actor* thisx, PlayState* play) {
|
|||||||
if (this->lightColor.a == 255 || this->lightColor.a == 0) {
|
if (this->lightColor.a == 255 || this->lightColor.a == 0) {
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
|
gDPSetEnvColor(POLY_OPA_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, D_80116280 + 2);
|
gSPSegment(POLY_OPA_DISP++, 0x08, D_80116280 + 2);
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->lightColor.a);
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->lightColor.a);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, D_80116280);
|
gSPSegment(POLY_XLU_DISP++, 0x08, D_80116280);
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
@ -814,7 +814,7 @@ void EnVali_Draw(Actor* thisx, PlayState* play) {
|
|||||||
|
|
||||||
EnVali_DrawBody(this, play);
|
EnVali_DrawBody(this, play);
|
||||||
|
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnVali_OverrideLimbDraw, EnVali_PostLimbDraw, this, POLY_XLU_DISP);
|
EnVali_OverrideLimbDraw, EnVali_PostLimbDraw, this, POLY_XLU_DISP);
|
||||||
|
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -640,13 +640,13 @@ void EnWeiyer_Draw(Actor* thisx, PlayState* play) {
|
|||||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime, EnWeiyer_OverrideLimbDraw, NULL, &this->actor,
|
||||||
EnWeiyer_OverrideLimbDraw, NULL, &this->actor, POLY_OPA_DISP);
|
POLY_OPA_DISP);
|
||||||
} else {
|
} else {
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x08, &D_80116280[0]);
|
gSPSegment(POLY_XLU_DISP++, 0x08, &D_80116280[0]);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->actor.shape.shadowAlpha);
|
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->actor.shape.shadowAlpha);
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnWeiyer_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
|
EnWeiyer_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,13 +101,19 @@ static f32 sSpawnSin;
|
|||||||
s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* pos) {
|
s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* pos) {
|
||||||
f32 phi_f12;
|
f32 phi_f12;
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, pos, &this->actor.projectedPos,
|
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, pos, &this->actor.projectedPos,
|
||||||
&this->actor.projectedW);
|
&this->actor.projectedW);
|
||||||
|
|
||||||
|
// #region SOH [Enhancement] Use the extended culling calculation
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) > 1 ||
|
||||||
|
CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0)) {
|
||||||
|
bool shipShouldDraw = false;
|
||||||
|
bool shipShouldUpdate = false;
|
||||||
|
return Ship_CalcShouldDrawAndUpdate(play, &this->actor, &this->actor.projectedPos, this->actor.projectedW,
|
||||||
|
&shipShouldDraw, &shipShouldUpdate);
|
||||||
|
}
|
||||||
|
// #endregion
|
||||||
|
|
||||||
phi_f12 = ((this->actor.projectedW == 0.0f) ? 1000.0f : fabsf(1.0f / this->actor.projectedW));
|
phi_f12 = ((this->actor.projectedW == 0.0f) ? 1000.0f : fabsf(1.0f / this->actor.projectedW));
|
||||||
|
|
||||||
if ((-this->actor.uncullZoneScale < this->actor.projectedPos.z) &&
|
if ((-this->actor.uncullZoneScale < this->actor.projectedPos.z) &&
|
||||||
|
@ -2252,7 +2252,7 @@ void EnZf_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->alpha);
|
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->alpha);
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]);
|
gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]);
|
||||||
|
|
||||||
POLY_OPA_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_OPA_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnZf_OverrideLimbDraw, EnZf_PostLimbDraw, this, POLY_OPA_DISP);
|
EnZf_OverrideLimbDraw, EnZf_PostLimbDraw, this, POLY_OPA_DISP);
|
||||||
|
|
||||||
if (this->iceTimer != 0) {
|
if (this->iceTimer != 0) {
|
||||||
@ -2271,7 +2271,7 @@ void EnZf_Draw(Actor* thisx, PlayState* play) {
|
|||||||
gDPPipeSync(POLY_XLU_DISP++);
|
gDPPipeSync(POLY_XLU_DISP++);
|
||||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
|
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
|
||||||
gSPSegment(POLY_XLU_DISP++, 0x09, &D_80116280[0]);
|
gSPSegment(POLY_XLU_DISP++, 0x09, &D_80116280[0]);
|
||||||
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
POLY_XLU_DISP = SkelAnime_DrawSkeleton2(play, &this->skelAnime,
|
||||||
EnZf_OverrideLimbDraw, EnZf_PostLimbDraw, this, POLY_XLU_DISP);
|
EnZf_OverrideLimbDraw, EnZf_PostLimbDraw, this, POLY_XLU_DISP);
|
||||||
}
|
}
|
||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
@ -275,7 +275,12 @@ void ObjMure_InitialAction(ObjMure* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjMure_CulledState(ObjMure* this, PlayState* play) {
|
void ObjMure_CulledState(ObjMure* this, PlayState* play) {
|
||||||
if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] || CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) {
|
// #region SOH [Enhancements] Extended draw distance
|
||||||
|
s32 distanceMultiplier = CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1);
|
||||||
|
distanceMultiplier = MAX(distanceMultiplier, 1);
|
||||||
|
|
||||||
|
if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] * distanceMultiplier) {
|
||||||
|
// #endregion
|
||||||
this->actionFunc = ObjMure_ActiveState;
|
this->actionFunc = ObjMure_ActiveState;
|
||||||
this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
||||||
ObjMure_SpawnActors(this, play);
|
ObjMure_SpawnActors(this, play);
|
||||||
@ -398,8 +403,13 @@ static ObjMureActionFunc sTypeGroupBehaviorFunc[] = {
|
|||||||
|
|
||||||
void ObjMure_ActiveState(ObjMure* this, PlayState* play) {
|
void ObjMure_ActiveState(ObjMure* this, PlayState* play) {
|
||||||
ObjMure_CheckChildren(this, play);
|
ObjMure_CheckChildren(this, play);
|
||||||
if (sZClip[this->type] + 40.0f <= fabsf(this->actor.projectedPos.z) &&
|
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) != 0) {
|
// #region SOH [Enhancements] Extended draw distance
|
||||||
|
s32 distanceMultiplier = CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1);
|
||||||
|
distanceMultiplier = MAX(distanceMultiplier, 1);
|
||||||
|
|
||||||
|
if ((sZClip[this->type] + 40.0f) * distanceMultiplier <= fabsf(this->actor.projectedPos.z)) {
|
||||||
|
// #endregion
|
||||||
this->actionFunc = ObjMure_CulledState;
|
this->actionFunc = ObjMure_CulledState;
|
||||||
this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
||||||
ObjMure_KillActors(this, play);
|
ObjMure_KillActors(this, play);
|
||||||
|
@ -190,8 +190,7 @@ void func_80B9A658(ObjMure2* this) {
|
|||||||
|
|
||||||
void func_80B9A668(ObjMure2* this, PlayState* play) {
|
void func_80B9A668(ObjMure2* this, PlayState* play) {
|
||||||
if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) <
|
if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) <
|
||||||
(sDistSquared1[this->actor.params & 3] * this->unk_184) ||
|
(sDistSquared1[this->actor.params & 3] * this->unk_184)) {
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) {
|
|
||||||
this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
this->actor.flags |= ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
||||||
ObjMure2_SpawnActors(this, play);
|
ObjMure2_SpawnActors(this, play);
|
||||||
func_80B9A6E8(this);
|
func_80B9A6E8(this);
|
||||||
@ -205,10 +204,6 @@ void func_80B9A6E8(ObjMure2* this) {
|
|||||||
void func_80B9A6F8(ObjMure2* this, PlayState* play) {
|
void func_80B9A6F8(ObjMure2* this, PlayState* play) {
|
||||||
func_80B9A534(this);
|
func_80B9A534(this);
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sDistSquared2[this->actor.params & 3] * this->unk_184) <=
|
if ((sDistSquared2[this->actor.params & 3] * this->unk_184) <=
|
||||||
Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
|
Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
|
||||||
this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
this->actor.flags &= ~ACTOR_FLAG_UPDATE_WHILE_CULLED;
|
||||||
@ -225,5 +220,20 @@ void ObjMure2_Update(Actor* thisx, PlayState* play) {
|
|||||||
} else {
|
} else {
|
||||||
this->unk_184 = 4.0f;
|
this->unk_184 = 4.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SOH [Enhancements] Extended draw distance
|
||||||
|
s32 distanceMultiplier = CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1);
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0) || distanceMultiplier > 1) {
|
||||||
|
f32 originalAspectRatio = 4.0f / 3.0f;
|
||||||
|
f32 currentAspectRatio = OTRGetAspectRatio();
|
||||||
|
// Adjust ratio difference based on field of view testing
|
||||||
|
f32 ratioAdjusted = 1.0f + (MAX(currentAspectRatio / originalAspectRatio, 1.0f) / 1.5f);
|
||||||
|
// Distance multiplier is squared due to the checks above for squared distances
|
||||||
|
distanceMultiplier = SQ(MAX(distanceMultiplier, 1));
|
||||||
|
|
||||||
|
// Prefer the largest of the three values
|
||||||
|
this->unk_184 = MAX(MAX((f32)distanceMultiplier, ratioAdjusted), this->unk_184);
|
||||||
|
}
|
||||||
|
|
||||||
this->actionFunc(this, play);
|
this->actionFunc(this, play);
|
||||||
}
|
}
|
||||||
|
@ -11892,10 +11892,6 @@ void Player_Draw(Actor* thisx, PlayState* play2) {
|
|||||||
lod = 1;
|
lod = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) {
|
|
||||||
lod = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
func_80093C80(play);
|
func_80093C80(play);
|
||||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user