Cosmetics menu rework (#589)

* -

* DPad/some margin fix(left side)

* various ImGui stuff and fixes

* disabled kaleido menu (non working)

* fix win being dumb

* same for C btn this time

* Fix windows build

* Beating hearts fix

* Default win size and some placement fix

* Fix Dpad Ammo & C notes, Kaleido, white dog

* some texts fix and tab move

* Add stone of agony, some fixes and build correctly

* precise item place with Dpad

* Gamecube -> GameCube

Co-authored-by: Baoulettes <iMacWin10>
This commit is contained in:
Baoulettes 2022-07-06 02:52:01 +02:00 committed by GitHub
parent 2fbdd056ed
commit a2d64864dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 3027 additions and 534 deletions

View File

@ -65,40 +65,22 @@ namespace SohImGui {
GameOverlay* overlay = new GameOverlay;
bool p_open = false;
bool needs_save = false;
ImVec4 hearts_colors;
ImVec4 hearts_dd_colors;
ImVec4 a_btn_colors;
ImVec4 b_btn_colors;
ImVec4 c_btn_colors;
ImVec4 start_btn_colors;
ImVec4 magic_border_colors;
ImVec4 magic_remaining_colors;
ImVec4 magic_use_colors;
ImVec4 minimap_colors;
ImVec4 rupee_colors;
ImVec4 smolekey_colors;
ImVec4 fileselect_colors;
ImVec4 fileselect_text_colors;
ImVec4 kokiri_col;
ImVec4 goron_col;
ImVec4 zora_col;
ImVec4 navi_idle_i_col;
ImVec4 navi_idle_o_col;
ImVec4 navi_npc_i_col;
ImVec4 navi_npc_o_col;
ImVec4 navi_enemy_i_col;
ImVec4 navi_enemy_o_col;
ImVec4 navi_prop_i_col;
ImVec4 navi_prop_o_col;
const char* RainbowColorCvarList[] = {
//This is the list of possible CVars that has rainbow effect.
"gTunic_Kokiri_", "gTunic_Goron_", "gTunic_Zora_",
"gCCHeartsPrim","gDDCCHeartsPrim",
"gCCHeartsPrim", "gDDCCHeartsPrim", "gCCDDHeartsPrim",
"gCCABtnPrim", "gCCBBtnPrim", "gCCCBtnPrim", "gCCStartBtnPrim",
"gCCMagicBorderPrim","gCCMagicPrim","gCCMagicUsePrim",
"gCCMinimapPrim","gCCRupeePrim","gCCKeysPrim",
"gCCFileChoosePrim", "gCCFileChooseTextPrim"
"gCCCUBtnPrim", "gCCCLBtnPrim", "gCCCRBtnPrim", "gCCCDBtnPrim", "gCCDpadPrim",
"gCCMagicBorderNormPrim", "gCCMagicBorderPrim", "gCCMagicPrim", "gCCMagicUsePrim",
"gCCMinimapPrim", "gCCMinimapDGNPrim", "gCCMinimapCPPrim", "gCCMinimapLEPrim",
"gCCRupeePrim", "gCCKeysPrim", "gDog1Col", "gDog2Col", "gCCVSOAPrim",
"gKeese1_Ef_Prim","gKeese2_Ef_Prim","gKeese1_Ef_Env","gKeese2_Ef_Env",
"gDF_Col", "gDF_Env",
"gNL_Diamond_Col", "gNL_Diamond_Env", "gNL_Orb_Col", "gNL_Orb_Env",
"gTrailCol", "gCharged1Col", "gCharged1ColEnv", "gCharged2Col", "gCharged2ColEnv",
"gCCFileChoosePrim", "gCCFileChooseTextPrim", "gCCEquipmentsPrim", "gCCItemsPrim",
"gCCMapsPrim", "gCCQuestsPrim", "gCCSavePrim", "gCCGameoverPrim",
};
const char* filters[3] = {
@ -652,6 +634,7 @@ namespace SohImGui {
}
void EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow, bool has_alpha, bool TitleSameLine) {
//This will be moved to external cosmetics ed
std::string Cvar_Red = cvarName;
Cvar_Red += "R";
std::string Cvar_Green = cvarName;
@ -689,21 +672,17 @@ namespace SohImGui {
}
//ImGui::SameLine(); // Removing that one to gain some width spacing on the HUD editor
ImGui::NewLine();
ImGui::PushItemWidth(-FLT_MIN);
ResetColor(cvarName, &ColorRGBA, default_colors, has_alpha);
ImGui::SameLine();
RandomizeColor(cvarName, &ColorRGBA);
if (allow_rainbow) {
if (ImGui::GetWindowSize().x > 560) {
if (ImGui::GetContentRegionAvail().x > 185) {
ImGui::SameLine();
}
else {
ImGui::NewLine();
}
RainbowColor(cvarName, &ColorRGBA);
}
ImGui::NewLine();
ImGui::PopItemWidth();
}
@ -1198,23 +1177,6 @@ namespace SohImGui {
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Cosmetics")) {
EnhancementCheckbox("Cosmetics editor", "gCosmeticEditor");
Tooltip("Edit Navi and Link's Tunics color.");
EnhancementCheckbox("HUD Margins editor", "gUseMargins");
EnhancementRadioButton("N64 interface", "gHudColors", 0);
Tooltip("Change interface color to N64 style.");
EnhancementRadioButton("GameCube interface", "gHudColors", 1);
Tooltip("Change interface color to GameCube style.");
EnhancementRadioButton("Custom interface", "gHudColors", 2);
Tooltip("Change interface color to your own made style.");
if (CVar_GetS32("gHudColors", 1) == 2) {
EnhancementCheckbox("Interface editor", "gColorsEditor");
Tooltip("Edit the colors used for your own interface");
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Cheats"))
{
if (ImGui::BeginMenu("Infinite...")) {
@ -1271,167 +1233,6 @@ namespace SohImGui {
ImGui::EndMenu();
}
bool Margins_isOpen = CVar_GetS32("gUseMargins", 0);
bool Cosmetics_isOpen = CVar_GetS32("gCosmeticEditor", 0);
bool Interface_isOpen = CVar_GetS32("gColorsEditor", 0);
if (Margins_isOpen) {
if (!Margins_isOpen) {
CVar_SetS32("gHUDMargins", 0);
return;
}
ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
ImGui::Begin("Margins Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Margins Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Interface margins")) {
EnhancementCheckbox("Use margins", "gHUDMargins");
Tooltip("Enable/Disable custom margins. \nIf disabled you will have original margins");
EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", -20, 20, "");
EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, 25, "");
EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", -25, 25, "");
EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", -20, 20, "");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::End();
}
if (Cosmetics_isOpen) {
if (!Cosmetics_isOpen) {
CVar_SetS32("gCosmeticEditor", 0);
return;
}
ImGui::SetNextWindowSize(ImVec2(500, 627), ImGuiCond_FirstUseEver);
ImGui::Begin("Cosmetics Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Cosmetics Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Navi")) {
EnhancementCheckbox("Custom colors for Navi", "gUseNaviCol");
Tooltip("Enable/Disable custom Navi's colors. \nIf disabled you will have original colors for Navi.\nColors are refreshed when Navi goes back in your pockets.");
EnhancementColor("Navi Idle Inner", "gNavi_Idle_Inner_", navi_idle_i_col, ImVec4(255, 255, 255, 255), false);
Tooltip("Inner color for Navi (idle flying around)");
EnhancementColor("Navi Idle Outer", "gNavi_Idle_Outer_", navi_idle_o_col, ImVec4(0, 0, 255, 255), false);
Tooltip("Outer color for Navi (idle flying around)");
ImGui::Separator();
EnhancementColor("Navi NPC Inner", "gNavi_NPC_Inner_", navi_npc_i_col, ImVec4(150, 150, 255, 255), false);
Tooltip("Inner color for Navi (when Navi fly around NPCs)");
EnhancementColor("Navi NPC Outer", "gNavi_NPC_Outer_", navi_npc_o_col, ImVec4(150, 150, 255, 255), false);
Tooltip("Outer color for Navi (when Navi fly around NPCs)");
ImGui::Separator();
EnhancementColor("Navi Enemy Inner", "gNavi_Enemy_Inner_", navi_enemy_i_col, ImVec4(255, 255, 0, 255), false);
Tooltip("Inner color for Navi (when Navi fly around Enemies or Bosses)");
EnhancementColor("Navi Enemy Outer", "gNavi_Enemy_Outer_", navi_enemy_o_col, ImVec4(220, 155, 0, 255), false);
Tooltip("Outer color for Navi (when Navi fly around Enemies or Bosses)");
ImGui::Separator();
EnhancementColor("Navi Prop Inner", "gNavi_Prop_Inner_", navi_prop_i_col, ImVec4(0, 255, 0, 255), false);
Tooltip("Inner color for Navi (when Navi fly around props (signs etc))");
EnhancementColor("Navi Prop Outer", "gNavi_Prop_Outer_", navi_prop_o_col, ImVec4(0, 255, 0, 255), false);
Tooltip("Outer color for Navi (when Navi fly around props (signs etc))");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Tunics")) {
EnhancementCheckbox("Custom colors on tunics", "gUseTunicsCol");
Tooltip("Enable/Disable custom Link's tunics colors. \nIf disabled you will have original colors for Link's tunics.");
EnhancementColor("Kokiri Tunic", "gTunic_Kokiri_", kokiri_col, ImVec4(30, 105, 27, 255));
ImGui::Separator();
EnhancementColor("Goron Tunic", "gTunic_Goron_", goron_col, ImVec4(100, 20, 0, 255));
ImGui::Separator();
EnhancementColor("Zora Tunic", "gTunic_Zora_", zora_col, ImVec4(0, 60, 100, 255));
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::End();
}
if (Interface_isOpen) {
if (!Interface_isOpen) {
CVar_SetS32("gColorsEditor", 0);
return;
}
ImGui::SetNextWindowSize(ImVec2(215, 627), ImGuiCond_FirstUseEver);
ImGui::Begin("Interface Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Interface Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("HUD")) {
if (ImGui::BeginTable("tableInterfaceEditor", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("Hearts", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableSetupColumn("Magic Bar", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableSetupColumn("Buttons", ImGuiTableColumnFlags_WidthStretch, 200.0f);
ImGui::TableHeadersRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
// COLUMN 1.1 - HEARTS
ImGui::PushItemWidth(-FLT_MIN);
EnhancementColor("Hearts inner", "gCCHeartsPrim", hearts_colors, ImVec4(255, 70, 50, 255));
Tooltip("Hearts inner color (red in original)\nAffect both Normal Hearts and the ones in Double Defense");
ImGui::Separator();
EnhancementColor("Hearts double def", "gDDCCHeartsPrim", hearts_dd_colors, ImVec4(255, 255, 255, 255));
Tooltip("Hearts outline color (white in original)\nAffect Double Defense outline only.");
ImGui::PopItemWidth();
ImGui::Separator();
if (ImGui::BeginTable("tableMisc", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
ImGui::TableSetupColumn("Misc", ImGuiTableColumnFlags_WidthStretch, 600.0f);
ImGui::TableHeadersRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
// COLUMN 1.2 - MISC
ImGui::PushItemWidth(-FLT_MIN);
EnhancementColor("Minimap color", "gCCMinimapPrim", minimap_colors, ImVec4(0, 255, 255, 255));
Tooltip("Affect the Dungeon and Overworld minimaps.");
ImGui::Separator();
EnhancementColor("Rupee icon color", "gCCRupeePrim", rupee_colors, ImVec4(120, 120, 120, 255));
Tooltip("Affect the Rupee icon on interface\nGreen by default.");
ImGui::Separator();
EnhancementColor("Small Keys icon color", "gCCKeysPrim", smolekey_colors, ImVec4(200, 230, 255, 255));
Tooltip("Affect the Small keys icon on interface\nGray by default.");
ImGui::PopItemWidth();
ImGui::EndTable();
}
ImGui::TableNextColumn();
// COLUMN 2 - MAGIC BAR
ImGui::PushItemWidth(-FLT_MIN);
EnhancementColor("Magic bar borders", "gCCMagicBorderPrim", magic_border_colors, ImVec4(255, 255, 255, 255));
Tooltip("Affect the border of the magic bar when being used\nWhite flash in original game.");
ImGui::Separator();
EnhancementColor("Magic bar main color", "gCCMagicPrim", magic_remaining_colors, ImVec4(0, 200, 0, 255));
Tooltip("Affect the magic bar color\nGreen in original game.");
ImGui::Separator();
EnhancementColor("Magic bar being used", "gCCMagicUsePrim", magic_use_colors, ImVec4(250, 250, 0, 255));
Tooltip("Affect the magic bar when being used\nYellow in original game.");
ImGui::Separator();
ImGui::PopItemWidth();
ImGui::TableNextColumn();
// COLUMN 3 - BUTTON
ImGui::PushItemWidth(-FLT_MIN);
EnhancementColor("A Buttons", "gCCABtnPrim", a_btn_colors, ImVec4(90, 90, 255, 255));
Tooltip("A Buttons colors (Green in original GameCube)\nAffect A buttons colors on interface, in shops, messages boxes, ocarina notes and inventory cursors.");
ImGui::Separator();
EnhancementColor("B Buttons", "gCCBBtnPrim", b_btn_colors, ImVec4(0, 150, 0, 255));
Tooltip("B Button colors (Red in original GameCube)\nAffect B button colors on interface");
ImGui::Separator();
EnhancementColor("C Buttons", "gCCCBtnPrim", c_btn_colors, ImVec4(255, 160, 0, 255));
Tooltip("C Buttons colors (Yellowish / Oranges in originals)\nAffect C buttons colors on interface, in inventory and ocarina notes");
ImGui::Separator();
EnhancementColor("Start Buttons", "gCCStartBtnPrim", start_btn_colors, ImVec4(120, 120, 120, 255));
Tooltip("Start Button colors (gray in GameCube)\nAffect Start button colors in inventory");
ImGui::Separator();
ImGui::PopItemWidth();
ImGui::EndTable();
ImGui::EndTabItem();
}
}
if (ImGui::BeginTabItem("File Choose")) {
EnhancementColor("File Choose color", "gCCFileChoosePrim", fileselect_colors, ImVec4(100, 150, 255, 255));
Tooltip("Affect the File Select.");
ImGui::Separator();
EnhancementColor("Bottom text color", "gCCFileChooseTextPrim", fileselect_text_colors, ImVec4(0, 100, 255, 255));
Tooltip("Affect the File Select.");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::End();
}
for (const auto& category : windowCategories) {
if (ImGui::BeginMenu(category.first.c_str())) {
for (const std::string& name : category.second) {

View File

@ -257,7 +257,9 @@ typedef struct {
/* 0x0A */ u8 durationTimer; // how long the title card appears for before fading
/* 0x0B */ u8 delayTimer; // how long the title card waits to appear
/* 0x0C */ s16 alpha;
/* 0x0E */ s16 intensity;
/* ---- */ s16 intensityR; //Splited intensity per channel to support precise recolor
/* ---- */ s16 intensityG;
/* ---- */ s16 intensityB;
/* ---- */ s16 isBossCard; //To detect if that a Boss name title card.
/* ---- */ s16 hasTranslation; // to detect if the current title card has translation (used for bosses only)
} TitleCardContext; // size = 0x10

View File

@ -179,6 +179,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="soh\Enhancements\cosmetics\CosmeticsEditor.cpp" />
<ClCompile Include="soh\Enhancements\debugger\actorViewer.cpp" />
<ClCompile Include="soh\frame_interpolation.cpp" />
<ClCompile Include="soh\Enhancements\bootcommands.c" />
@ -887,6 +888,7 @@
<ClCompile Include="src\overlays\misc\ovl_map_mark_data\z_map_mark_data.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="soh\Enhancements\cosmetics\CosmeticsEditor.h" />
<ClInclude Include="soh\Enhancements\debugger\actorViewer.h" />
<ClInclude Include="soh\frame_interpolation.h" />
<ClInclude Include="include\alloca.h" />

View File

@ -2208,6 +2208,9 @@
<ClCompile Include="soh\SaveManager.cpp">
<Filter>Source Files\soh</Filter>
</ClCompile>
<ClCompile Include="soh\Enhancements\cosmetics\CosmeticsEditor.cpp">
<Filter>Header Files\include</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\overlays\actors\ovl_kaleido_scope\z_kaleido_scope.h">
@ -3782,6 +3785,9 @@
<ClInclude Include="soh\SaveManager.h">
<Filter>Source Files\soh</Filter>
</ClInclude>
<ClInclude Include="soh\Enhancements\cosmetics\CosmeticsEditor.h">
<Filter>Header Files\include</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="SHIPOFHARKINIAN.ico" />

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
#pragma once
void InitCosmeticsEditor();//Init the menu itself

View File

@ -32,6 +32,7 @@
#define DRWAV_IMPLEMENTATION
#include "Lib/dr_libs/wav.h"
#include "AudioPlayer.h"
#include "Enhancements/cosmetics/CosmeticsEditor.h"
#include "Enhancements/debugconsole.h"
#include "Enhancements/debugger/debugger.h"
#include "soh/frame_interpolation.h"
@ -113,6 +114,7 @@ extern "C" void InitOTR() {
clearMtx = (uintptr_t)&gMtxClear;
OTRMessage_Init();
OTRAudio_Init();
InitCosmeticsEditor();
DebugConsole_Init();
Debug_Init();
OTRExtScanner();

View File

@ -780,7 +780,9 @@ void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) {
}
void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensity = titleCtx->alpha = 0;
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityR = titleCtx->alpha = 0;
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityG = titleCtx->alpha = 0;
titleCtx->durationTimer = titleCtx->delayTimer = titleCtx->intensityB = titleCtx->alpha = 0;
}
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width,
@ -803,7 +805,6 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y,
s32 width, s32 height, s32 delay) {
SceneTableEntry* loadedScene = globalCtx->loadedScene;
// size_t size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
switch (globalCtx->sceneNum) {
case SCENE_YDAN:
@ -1021,13 +1022,32 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
}
void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
s16* TitleCard_Colors[3] = {255,255,255};
if (titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {//Bosses cards.
TitleCard_Colors[0] = CVar_GetS32("gCCTC_B_U_PrimR", 255);
TitleCard_Colors[1] = CVar_GetS32("gCCTC_B_U_PrimG", 255);
TitleCard_Colors[2] = CVar_GetS32("gCCTC_B_U_PrimB", 255);
} else if (!titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {
TitleCard_Colors[0] = CVar_GetS32("gCCTC_OW_U_PrimR", 255);
TitleCard_Colors[1] = CVar_GetS32("gCCTC_OW_U_PrimG", 255);
TitleCard_Colors[2] = CVar_GetS32("gCCTC_OW_U_PrimB", 255);
} else {
TitleCard_Colors[0] = 255;
TitleCard_Colors[1] = 255;
TitleCard_Colors[2] = 255;
}
if (DECR(titleCtx->delayTimer) == 0) {
if (DECR(titleCtx->durationTimer) == 0) {
Math_StepToS(&titleCtx->alpha, 0, 30);
Math_StepToS(&titleCtx->intensity, 0, 70);
Math_StepToS(&titleCtx->intensityR, 0, 70);
Math_StepToS(&titleCtx->intensityG, 0, 70);
Math_StepToS(&titleCtx->intensityB, 0, 70);
} else {
Math_StepToS(&titleCtx->alpha, 255, 10);
Math_StepToS(&titleCtx->intensity, 255, 20);
Math_StepToS(&titleCtx->intensityR, TitleCard_Colors[0], 20);
Math_StepToS(&titleCtx->intensityG, TitleCard_Colors[1], 20);
Math_StepToS(&titleCtx->intensityB, TitleCard_Colors[2], 20);
}
}
}
@ -1047,8 +1067,30 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
if (titleCtx->alpha != 0) {
width = titleCtx->width;
height = titleCtx->height;
titleX = (titleCtx->x * 4) - (width * 2);
titleY = (titleCtx->y * 4) - (height * 2);
s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosX", 0) : CVar_GetS32("gTCMPosX", 0));
s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosY", 0) : CVar_GetS32("gTCMPosY", 0));
s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosType", 0) : CVar_GetS32("gTCMPosType", 0));
s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBUseMargins", 0) : CVar_GetS32("gTCMUseMargins", 0));
s16 TitleCard_MarginX = 0;
s16 TitleCard_PosX = titleCtx->x;
s16 TitleCard_PosY = titleCtx->y;
if (TitleCard_PosType_Checker != 0) {
TitleCard_PosY = TitleCard_PosY_Modifier;
if (TitleCard_PosType_Checker == 1) {//Anchor Left
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_L", 0)*-1;};
TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier+TitleCard_MarginX)-11;
} else if (TitleCard_PosType_Checker == 2) {//Anchor Right
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_R", 0);};
TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier+TitleCard_MarginX);
} else if (TitleCard_PosType_Checker == 3) {//Anchor None
TitleCard_PosX = TitleCard_PosX_Modifier;
} else if (TitleCard_PosType_Checker == 4) {//Hidden
TitleCard_PosX = -9999;
}
}
titleX = (TitleCard_PosX * 4) - (width * 2);
titleY = (TitleCard_PosY * 4) - (height * 2);
doubleWidth = width * 2;
OPEN_DISPS(globalCtx->state.gfxCtx);
@ -1075,7 +1117,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
// WORLD_OVERLAY_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP
WORLD_OVERLAY_DISP = func_80093808(WORLD_OVERLAY_DISP);
gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensityR, (u8)titleCtx->intensityG, (u8)titleCtx->intensityB,
(u8)titleCtx->alpha);
gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftTopY, G_IM_FMT_IA,
@ -1083,7 +1125,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
//Removing the -1 there remove the gap between top and bottom textures.
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4),
gSPWideTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4),
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
height = titleCtx->height - height;
@ -1095,7 +1137,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
//Removing the -1 there remove the gap between top and bottom textures.
gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
gSPWideTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
titleSecondY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}

View File

@ -194,6 +194,10 @@ void EffectBlure_Destroy(void* thisx) {
s32 EffectBlure_Update(void* thisx) {
EffectBlure* this = (EffectBlure*)thisx;
s32 i;
s16 RedColor;
s16 GreenColor;
s16 BlueColor;
s16 TrailDuration;
if (this == NULL) {
return 0;
@ -203,6 +207,31 @@ s32 EffectBlure_Update(void* thisx) {
return 0;
}
if (CVar_GetS32("gUseTrailsCol", 0) !=0) {
RedColor = CVar_GetS32("gTrailColR",255);
GreenColor = CVar_GetS32("gTrailColG",255);
BlueColor = CVar_GetS32("gTrailColB",255);
TrailDuration = 4.0f*CVar_GetS32("gTrailDurantion",1);
} else {
RedColor = 255;
GreenColor = 255;
BlueColor = 255;
TrailDuration=4.0f;
}
this->p1StartColor.r = RedColor;
this->p2StartColor.r = RedColor;
this->p1EndColor.r = RedColor;
this->p2EndColor.r = RedColor;
this->p1StartColor.g = GreenColor;
this->p2StartColor.g = GreenColor;
this->p1EndColor.g = GreenColor;
this->p2EndColor.g = GreenColor;
this->p1StartColor.b = BlueColor;
this->p2StartColor.b = BlueColor;
this->p1EndColor.b = BlueColor;
this->p2EndColor.b = BlueColor;
this->elemDuration = TrailDuration;
while (true) {
if (this->elements[0].state == 0) {
for (i = 0; i < 15; i++) {

View File

@ -181,17 +181,10 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
s16 gFactor;
s16 bFactor;
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_LM_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_LM_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_LM_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_LM_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_LM_Margin = 0;
Left_LM_Margin = 0;
Right_LM_Margin = 0;
Bottom_LM_Margin = 0;
}
if (CVar_GetS32("gHudColors", 1) == 2) {
HeartInner[0] = CVar_GetS32("gCCHeartsPrimR", sHeartsPrimColors[0][0]);
@ -274,21 +267,25 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
sHeartsDDEnv[0][2] = HeartDDInner[2];
if (CVar_GetS32("gHudColors", 1) == 2) {
sHeartsDDPrim[2][0] = HeartInner[0];
sHeartsDDPrim[2][1] = HeartInner[1];
sHeartsDDPrim[2][2] = HeartInner[2];
sHeartsDDPrim[2][0] = CVar_GetS32("gCCDDHeartsPrimR", 255);
sHeartsDDPrim[2][1] = CVar_GetS32("gCCDDHeartsPrimG", 70);
sHeartsDDPrim[2][2] = CVar_GetS32("gCCDDHeartsPrimB", 50);
sHeartsDDPrim[1][0] = HeartDDOutline[0];
sHeartsDDPrim[1][1] = HeartDDOutline[1];
sHeartsDDPrim[1][2] = HeartDDOutline[2];
sHeartsDDEnv[1][0] = HeartDDInner[0];
sHeartsDDEnv[1][1] = HeartDDInner[1];
sHeartsDDEnv[1][2] = HeartDDInner[2];
sHeartsDDEnv[1][0] = CVar_GetS32("gCCDDHeartsPrimR", 255);
sHeartsDDEnv[1][1] = CVar_GetS32("gCCDDHeartsPrimG", 70);
sHeartsDDEnv[1][2] = CVar_GetS32("gCCDDHeartsPrimB", 50);
HeartDDInner[0] = HeartInner[0];
HeartDDInner[1] = HeartInner[1];
HeartDDInner[2] = HeartInner[2];
HeartDDInner[0] = CVar_GetS32("gCCDDHeartsPrimR", 255);
HeartDDInner[1] = CVar_GetS32("gCCDDHeartsPrimG", 70);
HeartDDInner[2] = CVar_GetS32("gCCDDHeartsPrimB", 50);
sHeartsDDEnv[0][0] = CVar_GetS32("gCCDDHeartsPrimR", 255);
sHeartsDDEnv[0][1] = CVar_GetS32("gCCDDHeartsPrimG", 70);
sHeartsDDEnv[0][2] = CVar_GetS32("gCCDDHeartsPrimB", 0);
rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor;
@ -306,17 +303,21 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF;
} else {
// sHeartsDDPrim[2][0] = HEARTS_PRIM_R;
// sHeartsDDPrim[2][1] = HEARTS_PRIM_G;
// sHeartsDDPrim[2][2] = HEARTS_PRIM_B;
sHeartsDDPrim[0][0] = HEARTS_DD_PRIM_R;
sHeartsDDPrim[0][1] = HEARTS_DD_PRIM_G;
sHeartsDDPrim[0][2] = HEARTS_DD_PRIM_B;
sHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R;
sHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G;
sHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B;
sHeartsDDEnv[0][0] = HEARTS_DD_ENV_R;
sHeartsDDEnv[0][1] = HEARTS_DD_ENV_G;
sHeartsDDEnv[0][2] = HEARTS_DD_ENV_B;
sHeartsDDEnv[1][0] = HEARTS_PRIM_R;
sHeartsDDEnv[1][1] = HEARTS_PRIM_G;
sHeartsDDEnv[1][2] = HEARTS_PRIM_B;
sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0];
sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1];
sHeartsDDPrim[1][2] = sHeartsDDPrimColors[ddType][2];
sHeartsDDEnv[1][0] = sHeartsDDEnvColors[ddType][0];
sHeartsDDEnv[1][1] = sHeartsDDEnvColors[ddType][1];
sHeartsDDEnv[1][2] = sHeartsDDEnvColors[ddType][2];
rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor;
@ -330,9 +331,9 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor;
sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_PRIM_R) & 0xFF;
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_PRIM_G) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_PRIM_B) & 0xFF;
sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_DD_ENV_R) & 0xFF;
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_DD_ENV_G) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_DD_ENV_B) & 0xFF;
}
}
@ -419,8 +420,33 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
}
curColorSet = -1;
offsetY = 0.0f+(Top_LM_Margin*-1);
offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1);
s16 X_Margins;
s16 Y_Margins;
if (CVar_GetS32("gHeartsUseMargins", 0) != 0) {
X_Margins = Left_LM_Margin;
Y_Margins = (Top_LM_Margin*-1);
} else {
X_Margins = 0;
Y_Margins = 0;
}
s16 PosX_original = OTRGetDimensionFromLeftEdge(0.0f)+X_Margins;
s16 PosY_original = 0.0f+Y_Margins;
if (CVar_GetS32("gHeartsCountPosType", 0) != 0) {
offsetY = CVar_GetS32("gHeartsPosY", 0)+Y_Margins;
if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left
offsetX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right
X_Margins = Right_LM_Margin;
offsetX = OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None
offsetX = CVar_GetS32("gHeartsPosX", 0);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden
offsetX = -9999;
}
} else {
offsetY = PosY_original;
offsetX = PosX_original;
}
for (i = 0; i < totalHeartCount; i++) {
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
@ -579,8 +605,24 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
offsetX += 10.0f;
if (i == 9) {
offsetY += 10.0f;
offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1);
PosX_original = OTRGetDimensionFromLeftEdge(0.0f)+X_Margins;
PosY_original = 10.0f+Y_Margins;
if (CVar_GetS32("gHeartsCountPosType", 0) != 0) {
offsetY = CVar_GetS32("gHeartsPosY", 0)+Y_Margins+10.0f;
if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left
offsetX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right
X_Margins = Right_LM_Margin;
offsetX = OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsPosX", 0)+X_Margins);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None
offsetX = CVar_GetS32("gHeartsPosX", 0);
} else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden
offsetX = -9999;
}
} else {
offsetY = PosY_original;
offsetX = PosX_original;
}
}
}

View File

@ -598,22 +598,55 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
s32 pad;
Player* player = GET_PLAYER(globalCtx);
s16 tempX, tempZ;
s16 X_Margins_Minimap;
s16 Y_Margins_Minimap;
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {
if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;};
Y_Margins_Minimap = Bottom_MM_Margin;
} else {
X_Margins_Minimap = 0;
Y_Margins_Minimap = 0;
}
OPEN_DISPS(globalCtx->state.gfxCtx);
if (globalCtx->interfaceCtx.minimapAlpha >= 0xAA) {
func_80094A14(globalCtx->state.gfxCtx);
//Player current position (yellow arrow)
gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
tempX = player->actor.world.pos.x+Right_MM_Margin;
tempZ = player->actor.world.pos.z+Bottom_MM_Margin;
tempX = player->actor.world.pos.x;
tempZ = player->actor.world.pos.z;
tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
Matrix_Translate(
OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f),
(R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
Matrix_Translate(
OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f),
(R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
Matrix_Translate(
(R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f),
(R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
Matrix_Translate(
(R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f),
(R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
}
} else {
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(X_Margins_Minimap*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Y_Margins_Minimap*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
}
Matrix_Scale(0.4f, 0.4f, 0.4f, MTXMODE_APPLY);
Matrix_RotateX(-1.6f, MTXMODE_APPLY);
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
@ -621,21 +654,52 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255);
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, CVar_GetS32("gCCMinimapCPPrimR", 200), CVar_GetS32("gCCMinimapCPPrimG", 255), CVar_GetS32("gCCMinimapCPPrimB", 0), 255);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 255, 0, 255);
}
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
tempX = sPlayerInitialPosX+Right_MM_Margin;
tempZ = sPlayerInitialPosZ+Bottom_MM_Margin;
//Player map entry (red arrow)
tempX = sPlayerInitialPosX+X_Margins_Minimap;
tempZ = sPlayerInitialPosZ+Y_Margins_Minimap;
tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
Matrix_Translate(
OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f),
(R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
Matrix_Translate(
OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f),
(R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
Matrix_Translate(
(R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f),
(R_COMPASS_OFFSET_Y - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW);
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
Matrix_Translate(
(R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f),
(R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
}
} else {
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(X_Margins_Minimap*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Y_Margins_Minimap*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
}
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, CVar_GetS32("gCCMinimapLEPrimR", 200), CVar_GetS32("gCCMinimapLEPrimG", 0), CVar_GetS32("gCCMinimapLEPrimB", 0), 255);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255);
}
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
}
@ -650,6 +714,17 @@ void Minimap_Draw(GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
if (globalCtx->pauseCtx.state < 4) {
//Minimap margins
s16 X_Margins_Minimap;
s16 Y_Margins_Minimap;
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {
if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;};
Y_Margins_Minimap = Bottom_MM_Margin;
} else {
X_Margins_Minimap = 0;
Y_Margins_Minimap = 0;
}
switch (globalCtx->sceneNum) {
case SCENE_YDAN:
case SCENE_DDAN:
@ -668,7 +743,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) {
if (CVar_GetS32("gHudColors", 1) == 2) { //Dungeon minimap
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapDGNPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapDGNPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapDGNPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha);
}
@ -678,9 +753,22 @@ void Minimap_Draw(GlobalContext* globalCtx) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + Right_MM_Margin);
const s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Bottom_MM_Margin;
s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + X_Margins_Minimap);
s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
dgnMiniMapY = R_DGN_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
dgnMiniMapX = OTRGetDimensionFromLeftEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap);
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
dgnMiniMapX = OTRGetDimensionFromRightEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap);
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
dgnMiniMapX = CVar_GetS32("gMinimapPosX", 0);
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
dgnMiniMapX = -9999;
}
}
gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, dgnMiniMapY << 2,
(dgnMiniMapX + 96) << 2, (dgnMiniMapY + 85) << 2, G_TX_RENDERTILE,
0, 0, 1 << 10, 1 << 10);
@ -740,9 +828,22 @@ void Minimap_Draw(GlobalContext* globalCtx) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + Right_MM_Margin);
const s16 oWMiniMapY = R_OW_MINIMAP_Y + Bottom_MM_Margin;
s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + X_Margins_Minimap);
s16 oWMiniMapY = R_OW_MINIMAP_Y + Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
oWMiniMapY = R_OW_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
oWMiniMapX = OTRGetDimensionFromLeftEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap);
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
oWMiniMapX = OTRGetDimensionFromRightEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap);
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
oWMiniMapX = CVar_GetS32("gMinimapPosX", 0);
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
oWMiniMapX = -9999;
}
}
gSPWideTextureRectangle(OVERLAY_DISP++, oWMiniMapX << 2, oWMiniMapY << 2,
(oWMiniMapX + gMapData->owMinimapWidth[mapIndex]) << 2,
(oWMiniMapY + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0,
@ -757,17 +858,43 @@ void Minimap_Draw(GlobalContext* globalCtx) {
(LINK_AGE_IN_YEARS != YEARS_ADULT)) {
bool Map0 = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2 == 0;
s16 IconSize = 8;
s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + (Map0 ? 0 : Right_MM_Margin);
s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + (Map0 ? 0 : Bottom_MM_Margin);
s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + (Map0 ? 0 : X_Margins_Minimap);
s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + (Map0 ? 0 : Y_Margins_Minimap);
//gFixDungeonMinimapIcon fix both Y position of visible icon and hide these non needed.
if (CVar_GetS32("gFixDungeonMinimapIcon", 0) != 0){
//No idea why and how Original value work but this does actually fix them all.
PosY = PosY+1024;
}
s16 TopLeftX = (Map0 ? OTRGetRectDimensionFromLeftEdge(PosX) : OTRGetRectDimensionFromRightEdge(PosX)) << 2;
s16 TopLeftY = PosY << 2;
s16 TopLeftW = (Map0 ? OTRGetRectDimensionFromLeftEdge(PosX + IconSize) : OTRGetRectDimensionFromRightEdge(PosX + IconSize)) << 2;
s16 TopLeftH = (PosY + IconSize) << 2;
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosX", 0) + X_Margins_Minimap;
PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosY", 0) + Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
TopLeftX = OTRGetRectDimensionFromLeftEdge(PosX) << 2;
TopLeftW = OTRGetRectDimensionFromLeftEdge(PosX + IconSize) << 2;
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
TopLeftX = OTRGetRectDimensionFromRightEdge(PosX) << 2;
TopLeftW = OTRGetRectDimensionFromRightEdge(PosX + IconSize) << 2;
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
TopLeftX = PosX << 2;
TopLeftW = PosX + IconSize << 2;
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
TopLeftX = -9999 << 2;
TopLeftW = -9999 + IconSize << 2;
}
if (!CVar_GetS32("gMinimapPosType", 0) != 4 && Map0 && !CVar_GetS32("gFixDungeonMinimapIcon", 0)) { //Force top left icon if fix not applied.
TopLeftX = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex]) << 2;
TopLeftY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2;
TopLeftW = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + IconSize) << 2;
TopLeftH = (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + IconSize) << 2;
}
}
if (CVar_GetS32("gFixDungeonMinimapIcon", 0) != 0){
//No idea why and how Original value work but this does actually fix them all.
PosY = PosY+1024;
}
if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) ||
((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) &&
(gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) {
@ -785,8 +912,23 @@ void Minimap_Draw(GlobalContext* globalCtx) {
}
}
const s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + Right_MM_Margin);
const s16 entranceY = 154 + Bottom_MM_Margin;
s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap);
s16 entranceY = 154 + Y_Margins_Minimap;
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
entranceY = 154 + Y_Margins_Minimap + CVar_GetS32("gMinimapPosY", 0);
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;};
entranceX = OTRGetRectDimensionFromLeftEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0));
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;};
entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0));
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
entranceX = 270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0);
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
entranceX = -9999;
}
}
if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
@ -794,6 +936,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} else if ((globalCtx->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
@ -834,17 +977,10 @@ void Map_Update(GlobalContext* globalCtx) {
s16 floor;
s16 i;
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_MM_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_MM_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_MM_Margin = 0;
Left_MM_Margin = 0;
Right_MM_Margin = 0;
Bottom_MM_Margin = 0;
}
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
switch (globalCtx->sceneNum) {

View File

@ -108,38 +108,71 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha);
s16 Top_MC_Margin = 0;
s16 Left_MC_Margin = 0;
s16 Right_MC_Margin = 0;
s16 Bottom_MC_Margin = 0;
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0);
s32 Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0);
s32 Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0);
s32 Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0);
s32 Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0);
s32 X_Margins_Minimap_ic;
s32 Y_Margins_Minimap_ic;
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {
if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap_ic = Right_MC_Margin;};
Y_Margins_Minimap_ic = Bottom_MC_Margin;
} else {
Top_MC_Margin = 0;
Left_MC_Margin = 0;
Right_MC_Margin = 0;
Bottom_MC_Margin = 0;
X_Margins_Minimap_ic = 0;
Y_Margins_Minimap_ic = 0;
}
markPoint = &mapMarkIconData->points[0];
//Place each chest / boss room icon
for (i = 0; i < mapMarkIconData->count; i++) {
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
//Minimap chest / boss icon
const s32 PosX_Minimap_ori = GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+X_Margins_Minimap_ic) + 204;
const s32 PosY_Minimap_ori = GREG(95) + markPoint->y + Y_Margins_Minimap_ic + 140;
if (CVar_GetS32("gMinimapPosType", 0) != 0) {
rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 + CVar_GetS32("gMinimapPosY", 0));
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Left_MC_Margin;};
if (globalCtx->sceneNum == SCENE_YDAN || globalCtx->sceneNum == SCENE_DDAN || globalCtx->sceneNum == SCENE_BDAN ||
globalCtx->sceneNum == SCENE_BMORI1 || globalCtx->sceneNum == SCENE_HIDAN || globalCtx->sceneNum == SCENE_MIZUSIN ||
globalCtx->sceneNum == SCENE_JYASINZOU || globalCtx->sceneNum == SCENE_HAKADAN || globalCtx->sceneNum == SCENE_HAKADANCH ||
globalCtx->sceneNum == SCENE_ICE_DOUKUTO) {
rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic);
} else {
rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic);
}
} else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Right_MC_Margin;};
rectLeft = OTRGetRectDimensionFromRightEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic);
} else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None
rectLeft = markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic;
} else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden
rectLeft = -9999;
}
} else {
rectLeft = PosX_Minimap_ori;
rectTop = PosY_Minimap_ori;
}
int height = 8 * 1.0f; //Adjust Height with scale
int width = 8 * 1.0f; //Adjust Width with scale
int height_factor = (1 << 10) * 8 / height;
int width_factor = (1 << 10) * 8 / width;
markInfo = &sMapMarkInfoTable[mapMarkIconData->markType];
gDPPipeSync(OVERLAY_DISP++);
gDPLoadTextureBlock(OVERLAY_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
rectLeft = (GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+Right_MC_Margin) + 204) << 2;
rectTop = (GREG(95) + markPoint->y + Bottom_MC_Margin + 140) << 2;
gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft,
rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx,
markInfo->dtdy);
//Changed to a Wide texture to support Left anchor.
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, rectLeft + width << 2,
rectTop + height << 2, G_TX_RENDERTILE, 0, 0, width_factor,
height_factor);
}
markPoint++;
}
mapMarkIconData++;

View File

@ -82,6 +82,18 @@ s16 sOcarinaNoteCPrimG;
s16 sOcarinaNoteCEnvR;
s16 sOcarinaNoteCEnvB;
s16 sOcarinaNoteCEnvG;
s16 sOcarinaNoteCUpPrimR;
s16 sOcarinaNoteCUpPrimB;
s16 sOcarinaNoteCUpPrimG;
s16 sOcarinaNoteCLeftPrimR;
s16 sOcarinaNoteCLeftPrimB;
s16 sOcarinaNoteCLeftPrimG;
s16 sOcarinaNoteCDownPrimR;
s16 sOcarinaNoteCDownPrimB;
s16 sOcarinaNoteCDownPrimG;
s16 sOcarinaNoteCRightPrimR;
s16 sOcarinaNoteCRightPrimB;
s16 sOcarinaNoteCRightPrimG;
void Message_ResetOcarinaNoteState(void) {
R_OCARINA_NOTES_YPOS(0) = 189;
@ -93,18 +105,46 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaNotesAlphaValues[0] = sOcarinaNotesAlphaValues[1] = sOcarinaNotesAlphaValues[2] =
sOcarinaNotesAlphaValues[3] = sOcarinaNotesAlphaValues[4] = sOcarinaNotesAlphaValues[5] =
sOcarinaNotesAlphaValues[6] = sOcarinaNotesAlphaValues[7] = sOcarinaNotesAlphaValues[8] = 0;
sOcarinaNoteAPrimR = 80;
sOcarinaNoteAPrimG = 255;
sOcarinaNoteAPrimB = 150;
sOcarinaNoteAEnvR = 10;
sOcarinaNoteAEnvG = 10;
sOcarinaNoteAEnvB = 10;
sOcarinaNoteCPrimR = 255;
sOcarinaNoteCPrimG = 255;
sOcarinaNoteCPrimB = 50;
sOcarinaNoteCEnvR = 10;
sOcarinaNoteCEnvG = 10;
sOcarinaNoteCEnvB = 10;
if (CVar_GetS32("gHudColors", 1) == 0) {
sOcarinaNoteAPrimR = 80;
sOcarinaNoteAPrimG = 150;
sOcarinaNoteAPrimB = 255;
sOcarinaNoteCPrimR = 255;
sOcarinaNoteCPrimG = 255;
sOcarinaNoteCPrimB = 50;
} else if (CVar_GetS32("gHudColors", 1) == 1) {
sOcarinaNoteAPrimR = 80;
sOcarinaNoteAPrimG = 255;
sOcarinaNoteAPrimB = 150;
sOcarinaNoteCPrimR = 255;
sOcarinaNoteCPrimG = 255;
sOcarinaNoteCPrimB = 50;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
sOcarinaNoteAPrimR = CVar_GetS32("gCCABtnPrimR", 80);
sOcarinaNoteAPrimG = CVar_GetS32("gCCABtnPrimR", 255);
sOcarinaNoteAPrimB = CVar_GetS32("gCCABtnPrimR", 150);
sOcarinaNoteCPrimR = CVar_GetS32("gCCCBtnPrimR", 255);
sOcarinaNoteCPrimG = CVar_GetS32("gCCCBtnPrimG", 255);
sOcarinaNoteCPrimB = CVar_GetS32("gCCCBtnPrimB", 50);
sOcarinaNoteCUpPrimR = CVar_GetS32("gCCCUBtnPrimR", 255);
sOcarinaNoteCUpPrimG = CVar_GetS32("gCCCUBtnPrimG", 255);
sOcarinaNoteCUpPrimB = CVar_GetS32("gCCCUBtnPrimB", 50);
sOcarinaNoteCLeftPrimR = CVar_GetS32("gCCCLBtnPrimR", 255);
sOcarinaNoteCLeftPrimG = CVar_GetS32("gCCCLBtnPrimG", 255);
sOcarinaNoteCLeftPrimB = CVar_GetS32("gCCCLBtnPrimB", 50);
sOcarinaNoteCDownPrimR = CVar_GetS32("gCCCDBtnPrimR", 255);
sOcarinaNoteCDownPrimG = CVar_GetS32("gCCCDBtnPrimG", 255);
sOcarinaNoteCDownPrimB = CVar_GetS32("gCCCDBtnPrimB", 50);
sOcarinaNoteCRightPrimR = CVar_GetS32("gCCCRBtnPrimR", 255);
sOcarinaNoteCRightPrimG = CVar_GetS32("gCCCRBtnPrimG", 255);
sOcarinaNoteCRightPrimB = CVar_GetS32("gCCCRBtnPrimB", 50);
}
}
void Message_UpdateOcarinaGame(GlobalContext* globalCtx) {
@ -1948,22 +1988,80 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
static void* sOcarinaNoteTextures[] = {
gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex,
};
static s16 sOcarinaNoteAPrimColors[][3] = {
s16 sOcarinaNoteAPrimColors[2][3];
s16 sOcarinaNoteAPrimColors_GCN[][3] = {
{ 80, 255, 150 },
{ 100, 255, 200 },
};
s16 sOcarinaNoteAPrimColors_N64[][3] = {
{ 80, 255, 150 },
{ 100, 255, 200 },
};
s16 ABtnR = CVar_GetS32("gCCABtnPrimR", 80);
s16 ABtnG = CVar_GetS32("gCCABtnPrimG", 255);
s16 ABtnB = CVar_GetS32("gCCABtnPrimB", 150);
s16 ABtnR_2 = CVar_GetS32("gCCABtnPrimR", 80)+20;
s16 ABtnG_2 = CVar_GetS32("gCCABtnPrimG", 235)+20;
s16 ABtnB_2 = CVar_GetS32("gCCABtnPrimB", 180)+20;
if(ABtnR_2 > 255){ABtnR_2=255;};
if(ABtnG_2 > 255){ABtnG_2=255;};
if(ABtnB_2 > 255){ABtnB_2=255;};
s16 sOcarinaNoteAPrimColors_CUSTOM[][3] = {
{ ABtnG, ABtnG, ABtnB },
{ ABtnR_2, ABtnG_2, ABtnB_2 },
};
static s16 sOcarinaNoteAEnvColors[][3] = {
{ 10, 10, 10 },
{ 50, 255, 50 },
};
static s16 sOcarinaNoteCPrimColors[][3] = {
s16 sOcarinaNoteCPrimColors[2][3];
s16 sOcarinaNoteCPrimColors_GCN[][3] = {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
s16 CBtnR = CVar_GetS32("gCCCBtnPrimR", 255);
s16 CBtnG = CVar_GetS32("gCCCBtnPrimG", 255);
s16 CBtnB = CVar_GetS32("gCCCBtnPrimB", 50);
s16 CBtnR_2 = CVar_GetS32("gCCCBtnPrimR", 255)+20;
s16 CBtnG_2 = CVar_GetS32("gCCCBtnPrimG", 255)+20;
s16 CBtnB_2 = CVar_GetS32("gCCCBtnPrimB", 50)+20;
s16 CBtnRU = CVar_GetS32("gCCCUBtnPrimR", 255);
s16 CBtnGU = CVar_GetS32("gCCCUBtnPrimG", 255);
s16 CBtnBU = CVar_GetS32("gCCCUBtnPrimB", 50);
s16 CBtnRL = CVar_GetS32("gCCCLBtnPrimR", 255);
s16 CBtnGL = CVar_GetS32("gCCCLBtnPrimG", 255);
s16 CBtnBL = CVar_GetS32("gCCCLBtnPrimB", 50);
s16 CBtnRD = CVar_GetS32("gCCCDBtnPrimR", 255);
s16 CBtnGD = CVar_GetS32("gCCCDBtnPrimG", 255);
s16 CBtnBD = CVar_GetS32("gCCCDBtnPrimB", 50);
s16 CBtnRR = CVar_GetS32("gCCCRBtnPrimR", 255);
s16 CBtnGR = CVar_GetS32("gCCCRBtnPrimG", 255);
s16 CBtnBR = CVar_GetS32("gCCCRBtnPrimB", 50);
if(CBtnR_2 > 255){CBtnR_2=255;};
if(CBtnG_2 > 255){CBtnG_2=255;};
if(CBtnB_2 > 255){CBtnB_2=255;};
s16 sOcarinaNoteCPrimColors_CUSTOM[][3] = {
{ CBtnR, CBtnG, CBtnB }, //Unified
{ CBtnR_2, CBtnG_2, CBtnB_2 },
{ CBtnRL, CBtnGL, CBtnBL }, //Left
{ CBtnRD, CBtnGD, CBtnBD }, //Down
{ CBtnRR, CBtnGR, CBtnBR }, //Right
{ CBtnRU, CBtnGU, CBtnBU }, //Up
};
static s16 sOcarinaNoteCEnvColors[][3] = {
{ 10, 10, 10 },
{ 110, 110, 50 },
};
if (CVar_GetS32("gHudColors", 1) == 0) { //N64
sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_N64;
sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_GCN; //GCN and N64 share same C buttons color.
} else if (CVar_GetS32("gHudColors", 1) == 1) { //GCN
sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_GCN;
sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_GCN;
} else if (CVar_GetS32("gHudColors", 1) == 2) { //Custom
sOcarinaNoteAPrimColors < sOcarinaNoteAPrimColors_CUSTOM;
sOcarinaNoteCPrimColors < sOcarinaNoteCPrimColors_CUSTOM;
}
static s16 sOcarinaNoteFlashTimer = 12;
static s16 sOcarinaNoteFlashColorIdx = 1;
static s16 sOcarinaSongFanfares[] = {
@ -1980,6 +2078,18 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
s16 r;
s16 g;
s16 b;
s16 ru;//Red Up
s16 gu;//Green Up
s16 bu;//Blue Up
s16 rl;//Red Left
s16 gl;//green Left
s16 bl;//Blue Left
s16 rd;//And so on
s16 gd;
s16 bd;
s16 rr;
s16 gr;
s16 br;
u16 i;
u16 notePosX;
u16 pad1;
@ -2221,6 +2331,31 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
b = ABS(sOcarinaNoteCPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][2]) /
sOcarinaNoteFlashTimer;
ru = ABS(sOcarinaNoteCUpPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0]) /
sOcarinaNoteFlashTimer;
gu = ABS(sOcarinaNoteCUpPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1]) /
sOcarinaNoteFlashTimer;
bu = ABS(sOcarinaNoteCUpPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2]) /
sOcarinaNoteFlashTimer;
rl = ABS(sOcarinaNoteCLeftPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0]) /
sOcarinaNoteFlashTimer;
gl = ABS(sOcarinaNoteCLeftPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1]) /
sOcarinaNoteFlashTimer;
bl = ABS(sOcarinaNoteCLeftPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2]) /
sOcarinaNoteFlashTimer;
rd = ABS(sOcarinaNoteCDownPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0]) /
sOcarinaNoteFlashTimer;
gd = ABS(sOcarinaNoteCDownPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1]) /
sOcarinaNoteFlashTimer;
bd = ABS(sOcarinaNoteCDownPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2]) /
sOcarinaNoteFlashTimer;
rr = ABS(sOcarinaNoteCRightPrimR - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0]) /
sOcarinaNoteFlashTimer;
gr = ABS(sOcarinaNoteCRightPrimG - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1]) /
sOcarinaNoteFlashTimer;
br = ABS(sOcarinaNoteCRightPrimB - sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2]) /
sOcarinaNoteFlashTimer;
if (sOcarinaNoteCPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][0]) {
sOcarinaNoteCPrimR -= r;
} else {
@ -2237,6 +2372,70 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
sOcarinaNoteCPrimB += b;
}
if (sOcarinaNoteCUpPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0]) {
sOcarinaNoteCUpPrimR -= ru;
} else {
sOcarinaNoteCUpPrimR += ru;
}
if (sOcarinaNoteCUpPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1]) {
sOcarinaNoteCUpPrimG -= gu;
} else {
sOcarinaNoteCUpPrimG += gu;
}
if (sOcarinaNoteCUpPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2]) {
sOcarinaNoteCUpPrimB -= bu;
} else {
sOcarinaNoteCUpPrimB += bu;
}
if (sOcarinaNoteCLeftPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0]) {
sOcarinaNoteCLeftPrimR -= rl;
} else {
sOcarinaNoteCLeftPrimR += rl;
}
if (sOcarinaNoteCLeftPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1]) {
sOcarinaNoteCLeftPrimG -= gl;
} else {
sOcarinaNoteCLeftPrimG += gl;
}
if (sOcarinaNoteCLeftPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2]) {
sOcarinaNoteCLeftPrimB -= bl;
} else {
sOcarinaNoteCLeftPrimB += bl;
}
if (sOcarinaNoteCDownPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0]) {
sOcarinaNoteCDownPrimR -= rd;
} else {
sOcarinaNoteCDownPrimR += rd;
}
if (sOcarinaNoteCDownPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1]) {
sOcarinaNoteCDownPrimG -= gd;
} else {
sOcarinaNoteCDownPrimG += gd;
}
if (sOcarinaNoteCDownPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2]) {
sOcarinaNoteCDownPrimB -= bd;
} else {
sOcarinaNoteCDownPrimB += bd;
}
if (sOcarinaNoteCRightPrimR >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0]) {
sOcarinaNoteCRightPrimR -= rr;
} else {
sOcarinaNoteCRightPrimR += rr;
}
if (sOcarinaNoteCRightPrimG >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1]) {
sOcarinaNoteCRightPrimG -= gr;
} else {
sOcarinaNoteCRightPrimG += gr;
}
if (sOcarinaNoteCRightPrimB >= sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2]) {
sOcarinaNoteCRightPrimB -= br;
} else {
sOcarinaNoteCRightPrimB += br;
}
r = ABS(sOcarinaNoteCEnvR - sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][0]) /
sOcarinaNoteFlashTimer;
g = ABS(sOcarinaNoteCEnvG - sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][1]) /
@ -2271,6 +2470,18 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
sOcarinaNoteCPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][0];
sOcarinaNoteCPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][1];
sOcarinaNoteCPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx][2];
sOcarinaNoteCUpPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][0];
sOcarinaNoteCUpPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][1];
sOcarinaNoteCUpPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+5][2];
sOcarinaNoteCLeftPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][0];
sOcarinaNoteCLeftPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][1];
sOcarinaNoteCLeftPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+2][2];
sOcarinaNoteCDownPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][0];
sOcarinaNoteCDownPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][1];
sOcarinaNoteCDownPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+3][2];
sOcarinaNoteCRightPrimR = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][0];
sOcarinaNoteCRightPrimG = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][1];
sOcarinaNoteCRightPrimB = sOcarinaNoteCPrimColors[sOcarinaNoteFlashColorIdx+4][2];
sOcarinaNoteCEnvR = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][0];
sOcarinaNoteCEnvG = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][1];
sOcarinaNoteCEnvB = sOcarinaNoteCEnvColors[sOcarinaNoteFlashColorIdx][2];
@ -2883,7 +3094,7 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteAPrimR, sOcarinaNoteAPrimG, sOcarinaNoteAPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCABtnPrimR", 0), CVar_GetS32("gCCABtnPrimG", 0), CVar_GetS32("gCCABtnPrimB", 0), sOcarinaNotesAlphaValues[i]);
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCABtnPrimR", 80), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 150), sOcarinaNotesAlphaValues[i]);
}
gDPSetEnvColor(gfx++, sOcarinaNoteAEnvR, sOcarinaNoteAEnvG, sOcarinaNoteAEnvB, 0);
} else {
@ -2891,8 +3102,16 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 0), CVar_GetS32("gCCCBtnPrimG", 0), CVar_GetS32("gCCCBtnPrimB", 0), sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 180), sOcarinaNotesAlphaValues[i]);
} else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCUpPrimR, sOcarinaNoteCUpPrimG, sOcarinaNoteCUpPrimB, sOcarinaNotesAlphaValues[i]);
} else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCLeftPrimR, sOcarinaNoteCLeftPrimG, sOcarinaNoteCLeftPrimB, sOcarinaNotesAlphaValues[i]);
} else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCRightPrimR, sOcarinaNoteCRightPrimG, sOcarinaNoteCRightPrimB, sOcarinaNotesAlphaValues[i]);
} else if (sOcarinaNoteBuf[i] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCDownPrimR, sOcarinaNoteCDownPrimG, sOcarinaNoteCDownPrimB, sOcarinaNotesAlphaValues[i]);
}
gDPSetEnvColor(gfx++, sOcarinaNoteCEnvR, sOcarinaNoteCEnvG, sOcarinaNoteCEnvB, 0);
}

File diff suppressed because it is too large Load Diff

View File

@ -212,8 +212,16 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx2) {
// Draw red effect over the screen when arrow hits
if (this->unk_15C > 0) {
POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0,
(s32)(CVar_GetS32("gFireArrowColEnvR", 40) * this->unk_15C) & 0xFF,
(s32)(CVar_GetS32("gFireArrowColEnvG", 0) * this->unk_15C) & 0xFF,
(s32)(CVar_GetS32("gFireArrowColEnvB", 0) * this->unk_15C) & 0xFF,
(s32)(30.0f * this->unk_15C) & 0xFF); //Intentionnally made Alpha lower.
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0, 0,
(s32)(150.0f * this->unk_15C) & 0xFF);
}
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
@ -221,8 +229,13 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx2) {
// Draw fire on the arrow
func_80093D84(globalCtx->state.gfxCtx);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gFireArrowColR", 255), CVar_GetS32("gFireArrowColG", 200), CVar_GetS32("gFireArrowColB", 0), this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gFireArrowColEnvR", 255), CVar_GetS32("gFireArrowColEnvG", 0), CVar_GetS32("gFireArrowColEnvB", 0), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 200, 0, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
}
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);

View File

@ -210,8 +210,16 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
// Draw blue effect over the screen when arrow hits
if (this->unk_164 > 0) {
POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0,
(s32)(CVar_GetS32("gIceArrowColEnvR", 0) * this->unk_164) & 0xFF,
(s32)(CVar_GetS32("gIceArrowColEnvG", 10) * this->unk_164) & 0xFF,
(s32)(CVar_GetS32("gIceArrowColEnvB", 50) * this->unk_164) & 0xFF,
(s32)(30.0f * this->unk_164) & 0xFF); //Intentionnally made Alpha lower.
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF,
(s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF);
}
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
@ -219,8 +227,13 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
// Draw ice on the arrow
func_80093D84(globalCtx->state.gfxCtx);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gIceArrowColR", 170), CVar_GetS32("gIceArrowColG", 255), CVar_GetS32("gIceArrowColB", 255), this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gIceArrowColEnvR", 0), CVar_GetS32("gIceArrowColEnvG", 0), CVar_GetS32("gIceArrowColEnvB", 255), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128);
}
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);

View File

@ -208,8 +208,16 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
// Draw yellow effect over the screen when arrow hits
if (this->unk_164 > 0) {
POLY_XLU_DISP = func_800937C0(POLY_XLU_DISP);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0,
(s32)(CVar_GetS32("gLightArrowColEnvR", 30) * this->unk_164) & 0xFF,
(s32)(CVar_GetS32("gLightArrowColEnvG", 40) * this->unk_164) & 0xFF,
(s32)(CVar_GetS32("gLightArrowColEnvB", 0) * this->unk_164) & 0xFF,
(s32)(30.0f * this->unk_164) & 0xFF); //Intentionnally made Alpha lower.
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF,
(s32)(40.0f * this->unk_164) & 0xFF, 0, (s32)(150.0f * this->unk_164) & 0xFF);
}
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_DISABLE);
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
@ -217,8 +225,13 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) {
// Draw light on the arrow
func_80093D84(globalCtx->state.gfxCtx);
if (CVar_GetS32("gUseArrowsCol", 0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, CVar_GetS32("gLightArrowColR", 255), CVar_GetS32("gLightArrowColG", 255), CVar_GetS32("gLightArrowColB", 170), this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gLightArrowColEnvR", 255), CVar_GetS32("gLightArrowColEnvG", 255), CVar_GetS32("gLightArrowColEnvB", 0), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 170, this->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 128);
}
Matrix_RotateZYX(0x4000, 0x0, 0x0, MTXMODE_APPLY);
if (this->timer != 0) {
Matrix_Translate(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);

View File

@ -478,6 +478,21 @@ void EnDog_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80093D18(globalCtx->state.gfxCtx);
gDPPipeSync(POLY_OPA_DISP++);
if (CVar_GetS32("gUseDogsCol",0)) {
colors[0].r = CVar_GetS32("gDog1ColR", 255);
colors[0].g = CVar_GetS32("gDog1ColG", 255);
colors[0].b = CVar_GetS32("gDog1ColB", 200);
colors[1].r = CVar_GetS32("gDog2ColR", 150);
colors[1].g = CVar_GetS32("gDog2ColG", 100);
colors[1].b = CVar_GetS32("gDog2ColB", 50);
} else {
colors[0].r = 255;
colors[0].g = 255;
colors[0].b = 200;
colors[1].r = 150;
colors[1].g = 100;
colors[1].b = 50;
}
gDPSetEnvColor(POLY_OPA_DISP++, colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g,
colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a);

View File

@ -746,7 +746,26 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
s16 effScaleStep;
s16 effLife;
EnFirefly* this = (EnFirefly*)thisx;
if (CVar_GetS32("gUseKeeseCol", 0)) {
Color_RGBA8 fireAuraPrimColor_custom = { CVar_GetS32("gKeese1_Ef_PrimR", 255), CVar_GetS32("gKeese1_Ef_PrimG", 255), CVar_GetS32("gKeese1_Ef_PrimB", 100), 255 };
Color_RGBA8 fireAuraEnvColor_custom = { CVar_GetS32("gKeese1_Ef_EnvR", 255), CVar_GetS32("gKeese1_Ef_Env", 50), CVar_GetS32("gKeese1_Ef_EnvB", 0), 0 };
Color_RGBA8 iceAuraPrimColor_custom = { CVar_GetS32("gKeese2_Ef_PrimR", 100), CVar_GetS32("gKeese2_Ef_PrimG", 200), CVar_GetS32("gKeese2_Ef_PrimB", 255), 255 };
Color_RGBA8 iceAuraEnvColor_custom = { CVar_GetS32("gKeese2_Ef_EnvR", 0), CVar_GetS32("gKeese2_Ef_Env", 0), CVar_GetS32("gKeese2_Ef_EnvB", 255), 0 };
fireAuraPrimColor = fireAuraPrimColor_custom;
fireAuraEnvColor = fireAuraEnvColor_custom;
iceAuraPrimColor = iceAuraPrimColor_custom;
iceAuraEnvColor = iceAuraEnvColor_custom;
} else {
//Original colors are back there
Color_RGBA8 fireAuraPrimColor_custom = { 255, 255, 100, 255 };
Color_RGBA8 fireAuraEnvColor_custom = { 255, 50, 0, 0 };
Color_RGBA8 iceAuraPrimColor_custom = { 100, 200, 255, 255 };
Color_RGBA8 iceAuraEnvColor_custom = { 0, 0, 255, 0 };
fireAuraPrimColor = fireAuraPrimColor_custom;
fireAuraEnvColor = fireAuraEnvColor_custom;
iceAuraPrimColor = iceAuraPrimColor_custom;
iceAuraEnvColor = iceAuraEnvColor_custom;
}
if (!this->onFire && (limbIndex == 27)) {
gSPDisplayList((*gfx)++, gKeeseEyesDL);
} else {

View File

@ -340,12 +340,20 @@ void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) {
switch (this->unk_1C6) {
case 0:
if (CVar_GetS32("gUseChargedCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged2ColR",255), CVar_GetS32("gCharged2ColG",255), CVar_GetS32("gCharged2ColB",170), (u8)(this->unk_1B0 * 255));
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->unk_1B0 * 255));
}
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack3DL);
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack4DL);
break;
case 1:
if (CVar_GetS32("gUseChargedCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged1ColR",170), CVar_GetS32("gCharged1ColG",255), CVar_GetS32("gCharged1ColB",255), (u8)(this->unk_1B0 * 255));
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->unk_1B0 * 255));
}
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack1DL);
gSPDisplayList(POLY_XLU_DISP++, gSpinAttack2DL);
break;
@ -373,13 +381,25 @@ void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) {
if (this->unk_1B8 >= 0.85f) {
phi_f14 = (D_80AA046C[(globalCtx->gameplayFrames & 7)] * 6.0f) + 1.0f;
if (CVar_GetS32("gUseChargedCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged2ColR",255), CVar_GetS32("gCharged2ColG",255), CVar_GetS32("gCharged2ColB",170), this->unk_1C8);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gCharged2ColEnvR",255), CVar_GetS32("gCharged2ColEnvG",100), CVar_GetS32("gCharged2ColEnvB",0), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128);
}
gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128);
phi_t1 = 0x28;
} else {
phi_f14 = (D_80AA046C[globalCtx->gameplayFrames & 7] * 2.0f) + 1.0f;
if (CVar_GetS32("gUseChargedCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gCharged1ColR",170), CVar_GetS32("gCharged1ColG",255), CVar_GetS32("gCharged1ColB",255), this->unk_1C8);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gCharged1ColEnvR",0), CVar_GetS32("gCharged1ColEnvG",100), CVar_GetS32("gCharged1ColEnvB",255), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128);
}
gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128);
phi_t1 = 0x14;
}
Matrix_Scale(1.0f, phi_f14, phi_f14, MTXMODE_APPLY);

View File

@ -220,8 +220,13 @@ void MagicDark_DiamondDraw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (CVar_GetS32("gUseSpellsCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gNL_Diamond_ColR",170), CVar_GetS32("gNL_Diamond_ColG",255), CVar_GetS32("gNL_Diamond_ColB",255), (s32)(this->primAlpha * 0.6f) & 0xFF);
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gNL_Diamond_EnvR",100), CVar_GetS32("gNL_Diamond_EnvG",100), CVar_GetS32("gNL_Diamond_EnvB",255), 128);
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 255, 255, (s32)(this->primAlpha * 0.6f) & 0xFF);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128);
}
gSPDisplayList(POLY_XLU_DISP++, sDiamondMaterialDL);
gSPDisplayList(POLY_XLU_DISP++,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, gameplayFrames * -4, 32, 32, 1,

View File

@ -227,8 +227,13 @@ void MagicFire_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE);
gDPFillRectangle(POLY_XLU_DISP++, 0, 0, 319, 239);
func_80093D84(globalCtx->state.gfxCtx);
if (CVar_GetS32("gUseSpellsCol",0)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, CVar_GetS32("gDF_ColR",255), CVar_GetS32("gDF_ColG",200), CVar_GetS32("gDF_ColB",0), (u8)(this->alphaMultiplier * 255));
gDPSetEnvColor(POLY_XLU_DISP++, CVar_GetS32("gDF_EnvR",255), CVar_GetS32("gDF_EnvG",0), CVar_GetS32("gDF_EnvB",0), (u8)(this->alphaMultiplier * 255));
} else {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 128, 255, 200, 0, (u8)(this->alphaMultiplier * 255));
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, (u8)(this->alphaMultiplier * 255));
}
Matrix_Scale(0.15f, 0.15f, 0.15f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -10415,29 +10415,69 @@ void func_80848EF8(Player* this, GlobalContext* globalCtx) {
/*Prevent it on horse, while jumping and on title screen.
If you fly around no stone of agony for you! */
if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) {
int rectLeft = OTRGetRectDimensionFromLeftEdge(26); //Left X Pos
int rectTop = 60; //Top Y Pos
s16 Top_Margins = (CVar_GetS32("gHUDMargin_T", 0)*-1);
s16 Left_Margins = CVar_GetS32("gHUDMargin_L", 0);
s16 Right_Margins = CVar_GetS32("gHUDMargin_R", 0);
s16 X_Margins_VSOA;
s16 Y_Margins_VSOA;
if (CVar_GetS32("gVSOAUseMargins", 0) != 0) {
if (CVar_GetS32("gVSOAPosType", 0) == 0) {X_Margins_VSOA = Left_Margins;};
Y_Margins_VSOA = Top_Margins;
} else {
X_Margins_VSOA = 0;
Y_Margins_VSOA = 0;
}
s16 PosX_VSOA_ori = OTRGetRectDimensionFromLeftEdge(26)+X_Margins_VSOA;
s16 PosY_VSOA_ori = 60+Y_Margins_VSOA;
s16 PosX_VSOA;
s16 PosY_VSOA;
if (CVar_GetS32("gVSOAPosType", 0) != 0) {
PosY_VSOA = CVar_GetS32("gVSOAPosY", 0)+Y_Margins_VSOA;
if (CVar_GetS32("gVSOAPosType", 0) == 1) {//Anchor Left
if (CVar_GetS32("gVSOAUseMargins", 0) != 0) {X_Margins_VSOA = Left_Margins;};
PosX_VSOA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gVSOAPosX", 0)+X_Margins_VSOA);
} else if (CVar_GetS32("gVSOAPosType", 0) == 2) {//Anchor Right
if (CVar_GetS32("gVSOAUseMargins", 0) != 0) {X_Margins_VSOA = Right_Margins;};
PosX_VSOA = OTRGetDimensionFromRightEdge(CVar_GetS32("gVSOAPosX", 0)+X_Margins_VSOA);
} else if (CVar_GetS32("gVSOAPosType", 0) == 3) {//Anchor None
PosX_VSOA = CVar_GetS32("gVSOAPosX", 0);
} else if (CVar_GetS32("gVSOAPosType", 0) == 4) {//Hidden
PosX_VSOA = -9999;
}
} else {
PosY_VSOA = PosY_VSOA_ori;
PosX_VSOA = PosX_VSOA_ori;
}
int rectLeft = PosX_VSOA; //Left X Pos
int rectTop = PosY_VSOA; //Top Y Pos
int rectWidth = 24; //Texture Width
int rectHeight = 24; //Texture Heigh
int DefaultIconA= 50; //Default icon alphe (55 on 255)
if (CVar_GetS32("gHUDMargins", 0) != 0) {
rectLeft = OTRGetRectDimensionFromLeftEdge(26+(CVar_GetS32("gHUDMargin_L", 0)*-1));
rectTop = 60+(CVar_GetS32("gHUDMargin_T", 0)*-1);
} else {
rectTop = 60;
rectLeft = OTRGetRectDimensionFromLeftEdge(26);
}
int DefaultIconA= 50; //Default icon alpha (55 on 255)
OPEN_DISPS(globalCtx->state.gfxCtx);
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
if (this->unk_6A0 > 4000000.0f) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), DefaultIconA);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
}
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
if (this->unk_6A0 > 4000000.0f) {
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), 255);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
}
} else {
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCVSOAPrimR", 255), CVar_GetS32("gCCVSOAPrimG", 255), CVar_GetS32("gCCVSOAPrimB", 255), DefaultIconA);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
}
}
if (temp == 0 || temp <= 0.1f) {
/*Fail check, it is used to draw off the icon when
link is standing out range but do not refresh unk_6A0.

View File

@ -506,8 +506,16 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[sp218]);
} else if (D_8082A124[sp218] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 160), CVar_GetS32("gCCCUBtnPrimB", 0), D_8082A150[sp218]);
} else if (D_8082A124[sp218] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 160), CVar_GetS32("gCCCLBtnPrimB", 0), D_8082A150[sp218]);
} else if (D_8082A124[sp218] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 160), CVar_GetS32("gCCCRBtnPrimB", 0), D_8082A150[sp218]);
} else if (D_8082A124[sp218] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 160), CVar_GetS32("gCCCDBtnPrimB", 0), D_8082A150[sp218]);
}
}
@ -548,8 +556,16 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), 200);
} else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), 200);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 160), CVar_GetS32("gCCCUBtnPrimB", 0), 200);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 160), CVar_GetS32("gCCCLBtnPrimB", 0), 200);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 160), CVar_GetS32("gCCCRBtnPrimB", 0), 200);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 160), CVar_GetS32("gCCCDBtnPrimB", 0), 200);
}
}
} else {
@ -604,7 +620,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
if (D_8082A124[phi_s3] == 0) {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, D_8082A150[phi_s3]);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, 200);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
@ -612,11 +628,17 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
}
} else {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[phi_s3]);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200);
} else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[phi_s3]);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_UP && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCUBtnPrimR", 255), CVar_GetS32("gCCCUBtnPrimG", 255), CVar_GetS32("gCCCUBtnPrimB", 0), D_8082A150[phi_s3]);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_LEFT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", 255), CVar_GetS32("gCCCLBtnPrimG", 255), CVar_GetS32("gCCCLBtnPrimB", 0), D_8082A150[phi_s3]);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_RIGHT && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", 255), CVar_GetS32("gCCCRBtnPrimG", 255), CVar_GetS32("gCCCRBtnPrimB", 0), D_8082A150[phi_s3]);
} else if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == OCARINA_NOTE_C_DOWN && CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", 255), CVar_GetS32("gCCCDBtnPrimG", 255), CVar_GetS32("gCCCDBtnPrimB", 0), D_8082A150[phi_s3]);
}
}

View File

@ -1947,23 +1947,56 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] =
D_8082ADD8[gSaveContext.language] << 5;
s16 PosX; //General Pos of C button icon
if (gSaveContext.language == 0) { //eng
PosX = 112;
} else if (gSaveContext.language == 1) { //ger
PosX = 175;
} else {//baguettes
PosX = 98;
}
s16 PosY = 200; //General Pos of C button icon
s16 icon_w = 46; // Original texture size
s16 icon_h = 16;
s32 icon_x_offset;
s16 icon_w_crop = 17.0f; //Left
int height = icon_h * 1.0f; //Adjust Height with scale
int width = icon_w * 1.0f; //Adjust Width with scale
int width_crop = icon_w_crop * 1.0f; //Adjust Width with scale
int height_factor = (1 << 10) * icon_h / height;
int width_factor = (1 << 10) * icon_w / width;
if (CVar_GetS32("gHudColors", 1) == 2 && CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255);
for (s16 i=0; i < 3; i++) {
if (i == 0) {
icon_x_offset = width_crop*3-3;
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCRBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCRBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCRBtnPrimB", R_C_BTN_COLOR(2)), 255);
} else if (i == 1) {
icon_x_offset = width_crop*2-3;
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCDBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCDBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCDBtnPrimB", R_C_BTN_COLOR(2)), 255);
} else if (i == 2) {
icon_x_offset = width_crop;
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCLBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCLBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCLBtnPrimB", R_C_BTN_COLOR(2)), 255);
}
gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, icon_w, icon_h, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
//gSPScisTextureRectangle(POLY_KAL_DISP++,PosX << 2, PosY << 2, (PosX + icon_x_offset) << 2, (PosY + height) << 2, G_TX_RENDERTILE, 0, 0, width_factor, height_factor);
gSPWideTextureRectangle(POLY_KAL_DISP++, PosX << 2, PosY << 2, (PosX + icon_x_offset) << 2, (PosY + height) << 2, G_TX_WRAP, 0, 0, width_factor, height_factor);
}
} else {
if (CVar_GetS32("gHudColors", 1) == 0) {//To equip text C button icon
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
} else if (CVar_GetS32("gHudColors", 1) == 2 && !CVar_GetS32("gCCparated", 0)) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255);
}
if (gSaveContext.inventory.items[pauseCtx->cursorSlot[PAUSE_ITEM]] != ITEM_NONE) {
//gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); //Same reason for every A button, to be able to recolor them.
gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, icon_w, icon_h, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPWideTextureRectangle(POLY_KAL_DISP++, PosX << 2, PosY << 2, (PosX + width) << 2, (PosY + height) << 2, G_TX_RENDERTILE, 0, 0, width_factor, height_factor);
}
gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255);
POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sToEquipTextures[gSaveContext.language],
D_8082ADD8[gSaveContext.language], 16, 4);
}
} else if ((pauseCtx->pageIndex == PAUSE_MAP) && sInDungeonScene) {
} else if ((pauseCtx->pageIndex == PAUSE_QUEST) && (pauseCtx->cursorSlot[PAUSE_QUEST] >= 6) &&