mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-05 01:26:17 -04:00
Merge branch 'better-tools' of https://github.com/TakaRikka/dusk into better-tools
This commit is contained in:
+46
-18
@@ -12734,7 +12734,19 @@ void daAlink_c::setMagicArmorBrk(int i_status) {
|
||||
|
||||
BOOL daAlink_c::checkMagicArmorHeavy() const {
|
||||
#if TARGET_PC
|
||||
return checkMagicArmorWearAbility() && (dComIfGs_getRupee() == 0 && !dusk::getSettings().game.freeMagicArmor);
|
||||
if(!checkMagicArmorWearAbility()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(dusk::getSettings().game.armorRupeeDrain) {
|
||||
case dusk::MagicArmorMode::NORMAL:
|
||||
return dComIfGs_getRupee() == 0;
|
||||
case dusk::MagicArmorMode::ON_DAMAGE:
|
||||
case dusk::MagicArmorMode::DOUBLE_DEFENSE:
|
||||
case dusk::MagicArmorMode::INVINCIBLE:
|
||||
case dusk::MagicArmorMode::COSMETIC:
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
return checkMagicArmorWearAbility() && dComIfGs_getRupee() == 0;
|
||||
#endif
|
||||
@@ -14796,6 +14808,8 @@ void daAlink_c::deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera) {
|
||||
#if TARGET_PC
|
||||
mIBChainInterpPrevValid = false;
|
||||
mIBChainInterpCurrValid = false;
|
||||
mHsChainInterpPrevValid = false;
|
||||
mHsChainInterpCurrValid = false;
|
||||
#endif
|
||||
field_0x0774 = NULL;
|
||||
field_0x0778 = NULL;
|
||||
@@ -18707,7 +18721,7 @@ int daAlink_c::execute() {
|
||||
#if TARGET_PC
|
||||
// This handles rupee drain and transitions between rupees/no rupees
|
||||
// We can skip all of that if the magic armor doesn't use rupees
|
||||
if (!dusk::getSettings().game.freeMagicArmor && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) {
|
||||
if (dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::NORMAL && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) {
|
||||
#else
|
||||
if (checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) {
|
||||
#endif
|
||||
@@ -19768,23 +19782,37 @@ int daAlink_c::draw() {
|
||||
dComIfGd_getOpaListDark()->entryImm(mpHookChain, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled() &&
|
||||
mEquipItem == dItemNo_IRONBALL_e &&
|
||||
mIronBallChainPos != NULL && mIronBallChainAngle != NULL)
|
||||
{
|
||||
if (mIBChainInterpCurrValid) {
|
||||
memcpy(mIBChainInterpPrevPos, mIBChainInterpCurrPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz));
|
||||
memcpy(mIBChainInterpPrevAngle, mIBChainInterpCurrAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz));
|
||||
mIBChainInterpPrevHandRoot = mIBChainInterpCurrHandRoot;
|
||||
mIBChainInterpPrevValid = true;
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
if (mEquipItem == dItemNo_IRONBALL_e &&
|
||||
mIronBallChainPos != NULL && mIronBallChainAngle != NULL)
|
||||
{
|
||||
if (mIBChainInterpCurrValid) {
|
||||
memcpy(mIBChainInterpPrevPos, mIBChainInterpCurrPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz));
|
||||
memcpy(mIBChainInterpPrevAngle, mIBChainInterpCurrAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz));
|
||||
mIBChainInterpPrevHandRoot = mIBChainInterpCurrHandRoot;
|
||||
mIBChainInterpPrevValid = true;
|
||||
}
|
||||
|
||||
memcpy(mIBChainInterpCurrPos, mIronBallChainPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz));
|
||||
memcpy(mIBChainInterpCurrAngle, mIronBallChainAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz));
|
||||
mIBChainInterpCurrHandRoot = mHookshotTopPos;
|
||||
mIBChainInterpCurrValid = true;
|
||||
|
||||
dusk::frame_interp::add_interpolation_callback(&ironBallChainInterpCallback, this);
|
||||
} else {
|
||||
if (mHsChainInterpCurrValid) {
|
||||
mHsChainInterpPrevTop = mHsChainInterpCurrTop;
|
||||
mHsChainInterpPrevRoot = mHsChainInterpCurrRoot;
|
||||
mHsChainInterpPrevSubRoot = mHsChainInterpCurrSubRoot;
|
||||
mHsChainInterpPrevSubTop = mHsChainInterpCurrSubTop;
|
||||
mHsChainInterpPrevValid = true;
|
||||
}
|
||||
mHsChainInterpCurrTop = mHookshotTopPos;
|
||||
mHsChainInterpCurrRoot = mHeldItemRootPos;
|
||||
mHsChainInterpCurrSubRoot = field_0x3810;
|
||||
mHsChainInterpCurrSubTop = mIronBallBgChkPos;
|
||||
mHsChainInterpCurrValid = true;
|
||||
}
|
||||
|
||||
memcpy(mIBChainInterpCurrPos, mIronBallChainPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz));
|
||||
memcpy(mIBChainInterpCurrAngle, mIronBallChainAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz));
|
||||
mIBChainInterpCurrHandRoot = mHookshotTopPos;
|
||||
mIBChainInterpCurrValid = true;
|
||||
|
||||
dusk::frame_interp::add_interpolation_callback(&ironBallChainInterpCallback, this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm
|
||||
|
||||
if (checkMagicArmorNoDamage()) {
|
||||
#if TARGET_PC
|
||||
if(dusk::getSettings().game.freeMagicArmor) {
|
||||
if(dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::INVINCIBLE) {
|
||||
i_dmgAmount = 0;
|
||||
}
|
||||
#endif
|
||||
@@ -202,6 +202,11 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm
|
||||
if (!mpHIO->mDamage.m.mInvincible && g_debugHpMode == 0)
|
||||
#endif
|
||||
{
|
||||
#if TARGET_PC
|
||||
if(checkMagicArmorWearAbility() && dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::DOUBLE_DEFENSE) {
|
||||
i_dmgAmount /= 2;
|
||||
}
|
||||
#endif
|
||||
dComIfGp_setItemLifeCount(-i_dmgAmount, 0);
|
||||
}
|
||||
|
||||
@@ -281,7 +286,26 @@ BOOL daAlink_c::checkIcePolygonDamage(cBgS_PolyInfo* i_poly) {
|
||||
}
|
||||
|
||||
BOOL daAlink_c::checkMagicArmorNoDamage() {
|
||||
#ifdef TARGET_PC
|
||||
if (!checkMagicArmorWearAbility()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(dusk::getSettings().game.armorRupeeDrain) {
|
||||
case dusk::MagicArmorMode::NORMAL:
|
||||
return !checkMagicArmorHeavy();
|
||||
case dusk::MagicArmorMode::ON_DAMAGE:
|
||||
return dComIfGs_getRupee() != 0;
|
||||
case dusk::MagicArmorMode::DOUBLE_DEFENSE:
|
||||
return false;
|
||||
case dusk::MagicArmorMode::INVINCIBLE:
|
||||
return true;
|
||||
case dusk::MagicArmorMode::COSMETIC:
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
return checkMagicArmorWearAbility() && !checkMagicArmorHeavy();
|
||||
#endif
|
||||
}
|
||||
|
||||
int daAlink_c::checkPolyDamage() {
|
||||
|
||||
@@ -2028,11 +2028,10 @@ void daAlink_blur_c::traceBlur(cXyz const* param_0, cXyz const* param_1, s16 par
|
||||
}
|
||||
|
||||
void daAlink_blur_c::draw() {
|
||||
ZoneScoped;
|
||||
j3dSys.reinitGX();
|
||||
|
||||
#ifdef TARGET_PC
|
||||
TGXTexObj texObj;
|
||||
#else
|
||||
#if !TARGET_PC
|
||||
static TGXTexObj texObj;
|
||||
#endif
|
||||
static GXColor nColor0 = {0xFF, 0xFF, 0xFF, 0x14};
|
||||
@@ -2040,11 +2039,25 @@ void daAlink_blur_c::draw() {
|
||||
GXSetNumIndStages(0);
|
||||
nColor0.a = field_0x20;
|
||||
|
||||
#if TARGET_PC
|
||||
if (mpCachedBlurTex != m_blurTex) {
|
||||
mBlurTexObj.reset();
|
||||
GXInitTexObj(&mBlurTexObj,
|
||||
reinterpret_cast<void*>(
|
||||
reinterpret_cast<uintptr_t>(m_blurTex) + m_blurTex->imageOffset),
|
||||
16, 4, GX_TF_I4, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(
|
||||
&mBlurTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
mpCachedBlurTex = m_blurTex;
|
||||
}
|
||||
GXLoadTexObj(&mBlurTexObj, GX_TEXMAP0);
|
||||
#else
|
||||
GXInitTexObj(&texObj, (void*)((uintptr_t)m_blurTex + m_blurTex->imageOffset), 16, 4, GX_TF_I4,
|
||||
GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE,
|
||||
GX_ANISO_1);
|
||||
GXLoadTexObj(&texObj, GX_TEXMAP0);
|
||||
#endif
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8);
|
||||
GXClearVtxDesc();
|
||||
|
||||
@@ -136,8 +136,26 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
cXyz hsInterpTop, hsInterpRoot, hsInterpSubRoot, hsInterpSubTop;
|
||||
if (dusk::frame_interp::is_enabled() && alink->mHsChainInterpPrevValid && alink->mHsChainInterpCurrValid) {
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
hsInterpTop = alink->mHsChainInterpPrevTop + (alink->mHsChainInterpCurrTop - alink->mHsChainInterpPrevTop) * alpha;
|
||||
hsInterpRoot = alink->mHsChainInterpPrevRoot + (alink->mHsChainInterpCurrRoot - alink->mHsChainInterpPrevRoot) * alpha;
|
||||
hsInterpSubRoot = alink->mHsChainInterpPrevSubRoot + (alink->mHsChainInterpCurrSubRoot - alink->mHsChainInterpPrevSubRoot) * alpha;
|
||||
hsInterpSubTop = alink->mHsChainInterpPrevSubTop + (alink->mHsChainInterpCurrSubTop - alink->mHsChainInterpPrevSubTop) * alpha;
|
||||
} else {
|
||||
hsInterpTop = alink->getHsChainTopPos();
|
||||
hsInterpRoot = alink->getHsChainRootPos();
|
||||
hsInterpSubRoot = alink->getHsSubChainRootPos();
|
||||
hsInterpSubTop = alink->getHsSubChainTopPos();
|
||||
}
|
||||
const cXyz& chainRootPos = hsInterpRoot;
|
||||
const cXyz& chainTopPos = hsInterpTop;
|
||||
#else
|
||||
const cXyz& chainRootPos = alink->getHsChainRootPos();
|
||||
const cXyz& chainTopPos = alink->getHsChainTopPos();
|
||||
#endif
|
||||
cXyz maxDistance = chainRootPos - chainTopPos;
|
||||
|
||||
f32 maxDistanceF = maxDistance.abs();
|
||||
@@ -200,8 +218,13 @@ void daAlink_c::hsChainShape_c::draw() {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const cXyz& subChainRootPos = hsInterpSubRoot;
|
||||
const cXyz& subChainTopPos = hsInterpSubTop;
|
||||
#else
|
||||
const cXyz& subChainRootPos = alink->getHsSubChainRootPos();
|
||||
const cXyz& subChainTopPos = alink->getHsSubChainTopPos();
|
||||
#endif
|
||||
maxDistance = subChainRootPos - subChainTopPos;
|
||||
|
||||
maxDistanceF = maxDistance.abs();
|
||||
|
||||
@@ -348,7 +348,7 @@ void daAlink_c::changeLink(int param_0) {
|
||||
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_mArcName, "al_hands.bmd")), 0);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor)
|
||||
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.armorRupeeDrain.getValue() != dusk::MagicArmorMode::NORMAL)
|
||||
#else
|
||||
if (dComIfGs_getRupee() != 0)
|
||||
#endif
|
||||
@@ -458,7 +458,7 @@ void daAlink_c::changeLink(int param_0) {
|
||||
field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape();
|
||||
|
||||
#if TARGET_PC
|
||||
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) {
|
||||
if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.armorRupeeDrain.getValue() != dusk::MagicArmorMode::NORMAL) {
|
||||
#else
|
||||
if (dComIfGs_getRupee() != 0) {
|
||||
#endif
|
||||
|
||||
@@ -5472,6 +5472,15 @@ int daB_ZANT_c::create() {
|
||||
fopAcM_ct(this, daB_ZANT_c);
|
||||
OS_REPORT("B_ZANT PARAM %x\n", fopAcM_GetParam(this));
|
||||
|
||||
#if TARGET_PC
|
||||
// Due to our loads being so much faster, Zant can initialize *before* the player
|
||||
// This breaks respawning in the final phase of the fight when it tries
|
||||
// to load the player's position
|
||||
if (daPy_getPlayerActorClass() == NULL) {
|
||||
return cPhs_INIT_e;
|
||||
}
|
||||
#endif
|
||||
|
||||
mSwbit = fopAcM_GetParam(this);
|
||||
if (mSwbit != 0xFF) {
|
||||
if (dComIfGs_isSwitch(mSwbit, fopAcM_GetRoomNo(this))) {
|
||||
|
||||
@@ -923,6 +923,14 @@ static void damage_check(e_sm2_class* i_this) {
|
||||
sm_hit_actor->mode = 10;
|
||||
|
||||
u8 new_color_type = new_col_d[(sm_hit_actor->type * 7) + i_this->type];
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.restoreWiiGlitches &&
|
||||
((sm_hit_actor->type == TYPE_BLUE && i_this->type == TYPE_YELLOW) ||
|
||||
(sm_hit_actor->type == TYPE_YELLOW && i_this->type == TYPE_BLUE)))
|
||||
{
|
||||
new_color_type = TYPE_GREEN;
|
||||
}
|
||||
#endif
|
||||
i_this->type = new_color_type;
|
||||
sm_hit_actor->type = new_color_type;
|
||||
|
||||
|
||||
+60
-231
@@ -16,12 +16,30 @@
|
||||
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; }
|
||||
// keep the original version of the cape texture const so we don't need to reload the file
|
||||
static u8 const * l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}}, 0x4000), true); return buf; }
|
||||
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}}, 0x60), true); return buf; }
|
||||
#define l_Egnd_mantTEX (l_Egnd_mantTEX_get())
|
||||
#define l_Egnd_mantTEX_U (l_Egnd_mantTEX_U_get())
|
||||
#define l_Egnd_mantPAL (l_Egnd_mantPAL_get())
|
||||
|
||||
// make a copy of the cape texture that can be overwritten with the tears
|
||||
static u8 l_Egnd_mantTEX_copy[0x4000];
|
||||
|
||||
// keep our cached texture objects out here so that we can update them from multiple places
|
||||
static bool textureObjsInitialized = false;
|
||||
static TGXTlutObj tlutObj;
|
||||
static TGXTexObj mainTexObj;
|
||||
static TGXTexObj undersideTexObj;
|
||||
|
||||
// l_pos is unused
|
||||
//static f32* l_pos_get() { alignas(32) static f32 buf[507]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA44C}, {GameVersion::GcnPal, 0xA44C}}, sizeof(buf)), true); return buf; }
|
||||
static f32* l_normal_get() { alignas(32) static f32 buf[3]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C60}, {GameVersion::GcnPal, 0x9C60}}, sizeof(buf)), true); return buf; }
|
||||
static f32* l_texCoord_get() { alignas(32) static f32 buf[338]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA458}, {GameVersion::GcnPal, 0xA458}}, sizeof(buf)), true); return buf; }
|
||||
//#define l_pos (l_pos_get())
|
||||
#define l_normal (l_normal_get())
|
||||
#define l_texCoord (l_texCoord_get())
|
||||
#else
|
||||
#include "assets/l_Egnd_mantTEX.h"
|
||||
|
||||
@@ -31,228 +49,6 @@ static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bo
|
||||
#endif
|
||||
#include "d/d_s_play.h"
|
||||
|
||||
static u32 l_pos[507] = {
|
||||
0x42480000, 0x3F5CFC93, 0xC365BD9C, 0x4226AAAA,
|
||||
0x3F5CFC93, 0xC365BD9C, 0x42055556, 0x3F5CFC93,
|
||||
0xC365BD9C, 0x41C80000, 0x3F5CFC93, 0xC365BD9C,
|
||||
0x41855556, 0x3F5CFC93, 0xC365BD9C, 0x41055556,
|
||||
0x3F5CFC93, 0xC365BD9C, 0x358637BD, 0x3F5CFC93,
|
||||
0xC365BD9C, 0xC1055554, 0x3F5CFC93, 0xC365BD9C,
|
||||
0xC1855554, 0x3F5CFC93, 0xC365BD9C, 0xC1C7FFFF,
|
||||
0x3F5CFC93, 0xC365BD9C, 0xC2055554, 0x3F5CFC93,
|
||||
0xC365BD9C, 0xC226AAAA, 0x3F5CFC93, 0xC365BD9C,
|
||||
0xC2480000, 0x3F5CFC93, 0xC365BD9C, 0x42480000,
|
||||
0x3F5CFC93, 0xC35292F0, 0x4226AAAA, 0x3F5CFC93,
|
||||
0xC35292F0, 0x42055556, 0x3F5CFC93, 0xC35292F0,
|
||||
0x41C80000, 0x3F5CFC93, 0xC35292F0, 0x41855556,
|
||||
0x3F5CFC93, 0xC35292F0, 0x41055556, 0x3F5CFC93,
|
||||
0xC35292F0, 0x358637BD, 0x3F5CFC93, 0xC35292F0,
|
||||
0xC1055554, 0x3F5CFC93, 0xC35292F0, 0xC1855554,
|
||||
0x3F5CFC93, 0xC35292F0, 0xC1C7FFFF, 0x3F5CFC93,
|
||||
0xC35292F0, 0xC2055554, 0x3F5CFC93, 0xC35292F0,
|
||||
0xC226AAAA, 0x3F5CFC93, 0xC35292F0, 0xC2480000,
|
||||
0x3F5CFC93, 0xC35292F0, 0x42480000, 0x3F5CFC93,
|
||||
0xC33F6846, 0x4226AAAA, 0x3F5CFC93, 0xC33F6846,
|
||||
0x42055556, 0x3F5CFC93, 0xC33F6846, 0x41C80000,
|
||||
0x3F5CFC93, 0xC33F6846, 0x41855556, 0x3F5CFC93,
|
||||
0xC33F6846, 0x41055556, 0x3F5CFC93, 0xC33F6846,
|
||||
0x358637BD, 0x3F5CFC93, 0xC33F6846, 0xC1055554,
|
||||
0x3F5CFC93, 0xC33F6846, 0xC1855554, 0x3F5CFC93,
|
||||
0xC33F6846, 0xC1C7FFFF, 0x3F5CFC93, 0xC33F6846,
|
||||
0xC2055554, 0x3F5CFC93, 0xC33F6846, 0xC226AAAA,
|
||||
0x3F5CFC93, 0xC33F6846, 0xC2480000, 0x3F5CFC93,
|
||||
0xC33F6846, 0x42480000, 0x3F5CFC93, 0xC32C3D9C,
|
||||
0x4226AAAA, 0x3F5CFC93, 0xC32C3D9C, 0x42055556,
|
||||
0x3F5CFC93, 0xC32C3D9C, 0x41C80000, 0x3F5CFC93,
|
||||
0xC32C3D9C, 0x41855556, 0x3F5CFC93, 0xC32C3D9C,
|
||||
0x41055556, 0x3F5CFC93, 0xC32C3D9C, 0x358637BD,
|
||||
0x3F5CFC93, 0xC32C3D9C, 0xC1055554, 0x3F5CFC93,
|
||||
0xC32C3D9C, 0xC1855554, 0x3F5CFC93, 0xC32C3D9C,
|
||||
0xC1C7FFFF, 0x3F5CFC93, 0xC32C3D9C, 0xC2055554,
|
||||
0x3F5CFC93, 0xC32C3D9C, 0xC226AAAA, 0x3F5CFC93,
|
||||
0xC32C3D9C, 0xC2480000, 0x3F5CFC93, 0xC32C3D9C,
|
||||
0x42480000, 0x3F5CFC93, 0xC31912F1, 0x4226AAAA,
|
||||
0x3F5CFC93, 0xC31912F1, 0x42055556, 0x3F5CFC93,
|
||||
0xC31912F1, 0x41C80000, 0x3F5CFC93, 0xC31912F1,
|
||||
0x41855556, 0x3F5CFC93, 0xC31912F1, 0x41055556,
|
||||
0x3F5CFC93, 0xC31912F1, 0x358637BD, 0x3F5CFC93,
|
||||
0xC31912F1, 0xC1055554, 0x3F5CFC93, 0xC31912F1,
|
||||
0xC1855554, 0x3F5CFC93, 0xC31912F1, 0xC1C7FFFF,
|
||||
0x3F5CFC93, 0xC31912F1, 0xC2055554, 0x3F5CFC93,
|
||||
0xC31912F1, 0xC226AAAA, 0x3F5CFC93, 0xC31912F1,
|
||||
0xC2480000, 0x3F5CFC93, 0xC31912F1, 0x42480000,
|
||||
0x3F5CFC93, 0xC305E846, 0x4226AAAA, 0x3F5CFC93,
|
||||
0xC305E846, 0x42055556, 0x3F5CFC93, 0xC305E846,
|
||||
0x41C80000, 0x3F5CFC93, 0xC305E846, 0x41855556,
|
||||
0x3F5CFC93, 0xC305E846, 0x41055556, 0x3F5CFC93,
|
||||
0xC305E846, 0x358637BD, 0x3F5CFC93, 0xC305E846,
|
||||
0xC1055554, 0x3F5CFC93, 0xC305E846, 0xC1855554,
|
||||
0x3F5CFC93, 0xC305E846, 0xC1C7FFFF, 0x3F5CFC93,
|
||||
0xC305E846, 0xC2055554, 0x3F5CFC93, 0xC305E846,
|
||||
0xC226AAAA, 0x3F5CFC93, 0xC305E846, 0xC2480000,
|
||||
0x3F5CFC93, 0xC305E846, 0x42480000, 0x3F5CFC93,
|
||||
0xC2E57B38, 0x4226AAAA, 0x3F5CFC93, 0xC2E57B38,
|
||||
0x42055556, 0x3F5CFC93, 0xC2E57B38, 0x41C80000,
|
||||
0x3F5CFC93, 0xC2E57B38, 0x41855556, 0x3F5CFC93,
|
||||
0xC2E57B38, 0x41055556, 0x3F5CFC93, 0xC2E57B38,
|
||||
0x358637BD, 0x3F5CFC93, 0xC2E57B38, 0xC1055554,
|
||||
0x3F5CFC93, 0xC2E57B38, 0xC1855554, 0x3F5CFC93,
|
||||
0xC2E57B38, 0xC1C7FFFF, 0x3F5CFC93, 0xC2E57B38,
|
||||
0xC2055554, 0x3F5CFC93, 0xC2E57B38, 0xC226AAAA,
|
||||
0x3F5CFC93, 0xC2E57B38, 0xC2480000, 0x3F5CFC93,
|
||||
0xC2E57B38, 0x42480000, 0x3F5CFC93, 0xC2BF25E2,
|
||||
0x4226AAAA, 0x3F5CFC93, 0xC2BF25E2, 0x42055556,
|
||||
0x3F5CFC93, 0xC2BF25E2, 0x41C80000, 0x3F5CFC93,
|
||||
0xC2BF25E2, 0x41855556, 0x3F5CFC93, 0xC2BF25E2,
|
||||
0x41055556, 0x3F5CFC93, 0xC2BF25E2, 0x358637BD,
|
||||
0x3F5CFC93, 0xC2BF25E2, 0xC1055554, 0x3F5CFC93,
|
||||
0xC2BF25E2, 0xC1855554, 0x3F5CFC93, 0xC2BF25E2,
|
||||
0xC1C7FFFF, 0x3F5CFC93, 0xC2BF25E2, 0xC2055554,
|
||||
0x3F5CFC93, 0xC2BF25E2, 0xC226AAAA, 0x3F5CFC93,
|
||||
0xC2BF25E2, 0xC2480000, 0x3F5CFC93, 0xC2BF25E2,
|
||||
0x42480000, 0x3F5CFC93, 0xC298D08D, 0x4226AAAA,
|
||||
0x3F5CFC93, 0xC298D08D, 0x42055556, 0x3F5CFC93,
|
||||
0xC298D08D, 0x41C80000, 0x3F5CFC93, 0xC298D08D,
|
||||
0x41855556, 0x3F5CFC93, 0xC298D08D, 0x41055556,
|
||||
0x3F5CFC93, 0xC298D08D, 0x358637BD, 0x3F5CFC93,
|
||||
0xC298D08D, 0xC1055554, 0x3F5CFC93, 0xC298D08D,
|
||||
0xC1855554, 0x3F5CFC93, 0xC298D08D, 0xC1C7FFFF,
|
||||
0x3F5CFC93, 0xC298D08D, 0xC2055554, 0x3F5CFC93,
|
||||
0xC298D08D, 0xC226AAAA, 0x3F5CFC93, 0xC298D08D,
|
||||
0xC2480000, 0x3F5CFC93, 0xC298D08D, 0x42480000,
|
||||
0x3F5CFC93, 0xC264F66F, 0x4226AAAA, 0x3F5CFC93,
|
||||
0xC264F66F, 0x42055556, 0x3F5CFC93, 0xC264F66F,
|
||||
0x41C80000, 0x3F5CFC93, 0xC264F66F, 0x41855556,
|
||||
0x3F5CFC93, 0xC264F66F, 0x41055556, 0x3F5CFC93,
|
||||
0xC264F66F, 0x358637BD, 0x3F5CFC93, 0xC264F66F,
|
||||
0xC1055554, 0x3F5CFC93, 0xC264F66F, 0xC1855554,
|
||||
0x3F5CFC93, 0xC264F66F, 0xC1C7FFFF, 0x3F5CFC93,
|
||||
0xC264F66F, 0xC2055554, 0x3F5CFC93, 0xC264F66F,
|
||||
0xC226AAAA, 0x3F5CFC93, 0xC264F66F, 0xC2480000,
|
||||
0x3F5CFC93, 0xC264F66F, 0x42480000, 0x3F5CFC93,
|
||||
0xC2184BC4, 0x4226AAAA, 0x3F5CFC93, 0xC2184BC4,
|
||||
0x42055556, 0x3F5CFC93, 0xC2184BC4, 0x41C80000,
|
||||
0x3F5CFC93, 0xC2184BC4, 0x41855556, 0x3F5CFC93,
|
||||
0xC2184BC4, 0x41055556, 0x3F5CFC93, 0xC2184BC4,
|
||||
0x358637BD, 0x3F5CFC93, 0xC2184BC4, 0xC1055554,
|
||||
0x3F5CFC93, 0xC2184BC4, 0xC1855554, 0x3F5CFC93,
|
||||
0xC2184BC4, 0xC1C7FFFF, 0x3F5CFC93, 0xC2184BC4,
|
||||
0xC2055554, 0x3F5CFC93, 0xC2184BC4, 0xC226AAAA,
|
||||
0x3F5CFC93, 0xC2184BC4, 0xC2480000, 0x3F5CFC93,
|
||||
0xC2184BC4, 0x42480000, 0x3F5CFC93, 0xC1974231,
|
||||
0x4226AAAA, 0x3F5CFC93, 0xC1974231, 0x42055556,
|
||||
0x3F5CFC93, 0xC1974231, 0x41C80000, 0x3F5CFC93,
|
||||
0xC1974231, 0x41855556, 0x3F5CFC93, 0xC1974231,
|
||||
0x41055556, 0x3F5CFC93, 0xC1974231, 0x358637BD,
|
||||
0x3F5CFC93, 0xC1974231, 0xC1055554, 0x3F5CFC93,
|
||||
0xC1974231, 0xC1855554, 0x3F5CFC93, 0xC1974231,
|
||||
0xC1C7FFFF, 0x3F5CFC93, 0xC1974231, 0xC2055554,
|
||||
0x3F5CFC93, 0xC1974231, 0xC226AAAA, 0x3F5CFC93,
|
||||
0xC1974231, 0xC2480000, 0x3F5CFC93, 0xC1974231,
|
||||
0x42480000, 0x3F5CFC93, 0x3E84C964, 0x4226AAAA,
|
||||
0x3F5CFC93, 0x3E84C964, 0x42055556, 0x3F5CFC93,
|
||||
0x3E84C964, 0x41C80000, 0x3F5CFC93, 0x3E84C964,
|
||||
0x41855556, 0x3F5CFC93, 0x3E84C964, 0x41055556,
|
||||
0x3F5CFC93, 0x3E84C964, 0x358637BD, 0x3F5CFC93,
|
||||
0x3E84C964, 0xC1055554, 0x3F5CFC93, 0x3E84C964,
|
||||
0xC1855554, 0x3F5CFC93, 0x3E84C964, 0xC1C7FFFF,
|
||||
0x3F5CFC93, 0x3E84C964, 0xC2055554, 0x3F5CFC93,
|
||||
0x3E84C964, 0xC226AAAA, 0x3F5CFC93, 0x3E84C964,
|
||||
0xC2480000, 0x3F5CFC93, 0x3E84C964,
|
||||
};
|
||||
|
||||
static u32 l_normal[3] = {
|
||||
0x00000000, 0x3F800000, 0x00000000,
|
||||
};
|
||||
|
||||
static u32 l_texCoord[338] = {
|
||||
0x00000000, 0x3F6AAAB0, 0x3DAAAA7E, 0x3F6AAAB0,
|
||||
0x3DAAAA7E, 0x3F800000, 0x00000000, 0x3F800000,
|
||||
0x3E2AAAC1, 0x3F6AAAB0, 0x3E2AAAC1, 0x3F800000,
|
||||
0x3E800000, 0x3F6AAAB0, 0x3E800000, 0x3F800000,
|
||||
0x3EAAAA9F, 0x3F6AAAB0, 0x3EAAAA9F, 0x3F800000,
|
||||
0x3ED55561, 0x3F6AAAB0, 0x3ED55561, 0x3F800000,
|
||||
0x3F000000, 0x3F6AAAB0, 0x3F000000, 0x3F800000,
|
||||
0x3F155550, 0x3F6AAAB0, 0x3F155550, 0x3F800000,
|
||||
0x3F2AAAB0, 0x3F6AAAB0, 0x3F2AAAB0, 0x3F800000,
|
||||
0x3F400000, 0x3F6AAAB0, 0x3F400000, 0x3F800000,
|
||||
0x3F555550, 0x3F6AAAB0, 0x3F555550, 0x3F800000,
|
||||
0x3F6AAAB0, 0x3F6AAAB0, 0x3F6AAAB0, 0x3F800000,
|
||||
0x3F800000, 0x3F6AAAB0, 0x3F800000, 0x3F800000,
|
||||
0x00000000, 0x3F555550, 0x3DAAAA7E, 0x3F555550,
|
||||
0x3E2AAAC1, 0x3F555550, 0x3E800000, 0x3F555550,
|
||||
0x3EAAAA9F, 0x3F555550, 0x3ED55561, 0x3F555550,
|
||||
0x3F000000, 0x3F555550, 0x3F155550, 0x3F555550,
|
||||
0x3F2AAAB0, 0x3F555550, 0x3F400000, 0x3F555550,
|
||||
0x3F555550, 0x3F555550, 0x3F6AAAB0, 0x3F555550,
|
||||
0x3F800000, 0x3F555550, 0x00000000, 0x3F400000,
|
||||
0x3DAAAA7E, 0x3F400000, 0x3E2AAAC1, 0x3F400000,
|
||||
0x3E800000, 0x3F400000, 0x3EAAAA9F, 0x3F400000,
|
||||
0x3ED55561, 0x3F400000, 0x3F000000, 0x3F400000,
|
||||
0x3F155550, 0x3F400000, 0x3F2AAAB0, 0x3F400000,
|
||||
0x3F400000, 0x3F400000, 0x3F555550, 0x3F400000,
|
||||
0x3F6AAAB0, 0x3F400000, 0x3F800000, 0x3F400000,
|
||||
0x00000000, 0x3F2AAAB0, 0x3DAAAA7E, 0x3F2AAAB0,
|
||||
0x3E2AAAC1, 0x3F2AAAB0, 0x3E800000, 0x3F2AAAB0,
|
||||
0x3EAAAA9F, 0x3F2AAAB0, 0x3ED55561, 0x3F2AAAB0,
|
||||
0x3F000000, 0x3F2AAAB0, 0x3F155550, 0x3F2AAAB0,
|
||||
0x3F2AAAB0, 0x3F2AAAB0, 0x3F400000, 0x3F2AAAB0,
|
||||
0x3F555550, 0x3F2AAAB0, 0x3F6AAAB0, 0x3F2AAAB0,
|
||||
0x3F800000, 0x3F2AAAB0, 0x00000000, 0x3F155550,
|
||||
0x3DAAAA7E, 0x3F155550, 0x3E2AAAC1, 0x3F155550,
|
||||
0x3E800000, 0x3F155550, 0x3EAAAA9F, 0x3F155550,
|
||||
0x3ED55561, 0x3F155550, 0x3F000000, 0x3F155550,
|
||||
0x3F155550, 0x3F155550, 0x3F2AAAB0, 0x3F155550,
|
||||
0x3F400000, 0x3F155550, 0x3F555550, 0x3F155550,
|
||||
0x3F6AAAB0, 0x3F155550, 0x3F800000, 0x3F155550,
|
||||
0x00000000, 0x3F000000, 0x3DAAAA7E, 0x3F000000,
|
||||
0x3E2AAAC1, 0x3F000000, 0x3E800000, 0x3F000000,
|
||||
0x3EAAAA9F, 0x3F000000, 0x3ED55561, 0x3F000000,
|
||||
0x3F000000, 0x3F000000, 0x3F155550, 0x3F000000,
|
||||
0x3F2AAAB0, 0x3F000000, 0x3F400000, 0x3F000000,
|
||||
0x3F555550, 0x3F000000, 0x3F6AAAB0, 0x3F000000,
|
||||
0x3F800000, 0x3F000000, 0x00000000, 0x3ED55561,
|
||||
0x3DAAAA7E, 0x3ED55561, 0x3E2AAAC1, 0x3ED55561,
|
||||
0x3E800000, 0x3ED55561, 0x3EAAAA9F, 0x3ED55561,
|
||||
0x3ED55561, 0x3ED55561, 0x3F000000, 0x3ED55561,
|
||||
0x3F155550, 0x3ED55561, 0x3F2AAAB0, 0x3ED55561,
|
||||
0x3F400000, 0x3ED55561, 0x3F555550, 0x3ED55561,
|
||||
0x3F6AAAB0, 0x3ED55561, 0x3F800000, 0x3ED55561,
|
||||
0x00000000, 0x3EAAAA9F, 0x3DAAAA7E, 0x3EAAAA9F,
|
||||
0x3E2AAAC1, 0x3EAAAA9F, 0x3E800000, 0x3EAAAA9F,
|
||||
0x3EAAAA9F, 0x3EAAAA9F, 0x3ED55561, 0x3EAAAA9F,
|
||||
0x3F000000, 0x3EAAAA9F, 0x3F155550, 0x3EAAAA9F,
|
||||
0x3F2AAAB0, 0x3EAAAA9F, 0x3F400000, 0x3EAAAA9F,
|
||||
0x3F555550, 0x3EAAAA9F, 0x3F6AAAB0, 0x3EAAAA9F,
|
||||
0x3F800000, 0x3EAAAA9F, 0x00000000, 0x3E800000,
|
||||
0x3DAAAA7E, 0x3E800000, 0x3E2AAAC1, 0x3E800000,
|
||||
0x3E800000, 0x3E800000, 0x3EAAAA9F, 0x3E800000,
|
||||
0x3ED55561, 0x3E800000, 0x3F000000, 0x3E800000,
|
||||
0x3F155550, 0x3E800000, 0x3F2AAAB0, 0x3E800000,
|
||||
0x3F400000, 0x3E800000, 0x3F555550, 0x3E800000,
|
||||
0x3F6AAAB0, 0x3E800000, 0x3F800000, 0x3E800000,
|
||||
0x00000000, 0x3E2AAAC1, 0x3DAAAA7E, 0x3E2AAAC1,
|
||||
0x3E2AAAC1, 0x3E2AAAC1, 0x3E800000, 0x3E2AAAC1,
|
||||
0x3EAAAA9F, 0x3E2AAAC1, 0x3ED55561, 0x3E2AAAC1,
|
||||
0x3F000000, 0x3E2AAAC1, 0x3F155550, 0x3E2AAAC1,
|
||||
0x3F2AAAB0, 0x3E2AAAC1, 0x3F400000, 0x3E2AAAC1,
|
||||
0x3F555550, 0x3E2AAAC1, 0x3F6AAAB0, 0x3E2AAAC1,
|
||||
0x3F800000, 0x3E2AAAC1, 0x00000000, 0x3DAAAA7E,
|
||||
0x3DAAAA7E, 0x3DAAAA7E, 0x3E2AAAC1, 0x3DAAAA7E,
|
||||
0x3E800000, 0x3DAAAA7E, 0x3EAAAA9F, 0x3DAAAA7E,
|
||||
0x3ED55561, 0x3DAAAA7E, 0x3F000000, 0x3DAAAA7E,
|
||||
0x3F155550, 0x3DAAAA7E, 0x3F2AAAB0, 0x3DAAAA7E,
|
||||
0x3F400000, 0x3DAAAA7E, 0x3F555550, 0x3DAAAA7E,
|
||||
0x3F6AAAB0, 0x3DAAAA7E, 0x3F800000, 0x3DAAAA7E,
|
||||
0x00000000, 0x00000000, 0x3DAAAA7E, 0x00000000,
|
||||
0x3E2AAAC1, 0x00000000, 0x3E800000, 0x00000000,
|
||||
0x3EAAAA9F, 0x00000000, 0x3ED55561, 0x00000000,
|
||||
0x3F000000, 0x00000000, 0x3F155550, 0x00000000,
|
||||
0x3F2AAAB0, 0x00000000, 0x3F400000, 0x00000000,
|
||||
0x3F555550, 0x00000000, 0x3F6AAAB0, 0x00000000,
|
||||
0x3F800000, 0x00000000,
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
using GameVersion = dusk::version::GameVersion;
|
||||
|
||||
@@ -305,8 +101,9 @@ static void mant_build_anchor_frame(const cXyz& anchor_a, const cXyz& anchor_b,
|
||||
#endif
|
||||
|
||||
void daMant_packet_c::draw() {
|
||||
ZoneScoped;
|
||||
#if TARGET_PC
|
||||
void* image = l_Egnd_mantTEX;
|
||||
void* image = l_Egnd_mantTEX_copy;
|
||||
void* lut = l_Egnd_mantPAL;
|
||||
#else
|
||||
void* image = tex_d[0];
|
||||
@@ -388,12 +185,12 @@ void daMant_packet_c::draw() {
|
||||
}
|
||||
}
|
||||
GXSETARRAY(GX_VA_POS, draw_pos, sizeof(mNrm[0]), 12, true);
|
||||
GXSETARRAY(GX_VA_NRM, &l_normal, sizeof(l_normal), 12, false);
|
||||
GXSETARRAY(GX_VA_NRM, l_normal, sizeof(f32) * 3, 12, false);
|
||||
#else
|
||||
GXSETARRAY(GX_VA_POS, this->getPos(), sizeof(mPos[0]), 12, true);
|
||||
GXSETARRAY(GX_VA_NRM, this->getNrm(), sizeof(mNrm[0]), 12, true);
|
||||
#endif
|
||||
GXSETARRAY(GX_VA_TEX0, &l_texCoord, sizeof(l_texCoord), 8, false); // TODO: set to true when converted to float literals
|
||||
GXSETARRAY(GX_VA_TEX0, l_texCoord, sizeof(f32) * 338, 8, false);
|
||||
|
||||
GXSetZCompLoc(0);
|
||||
GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_ENABLE);
|
||||
@@ -418,15 +215,32 @@ void daMant_packet_c::draw() {
|
||||
GXSetTevKAlphaSel(GX_TEVSTAGE0, GX_TEV_KASEL_K3_A);
|
||||
GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
if (!textureObjsInitialized) {
|
||||
GXInitTlutObj(&tlutObj, lut, GX_TL_RGB5A3, 0x100);
|
||||
GXInitTexObjCI(&mainTexObj, image, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&mainTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
GXInitTexObjCI(
|
||||
&undersideTexObj, l_Egnd_mantTEX_U, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&undersideTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
textureObjsInitialized = true;
|
||||
}
|
||||
#else
|
||||
GXTlutObj GStack_80;
|
||||
GXInitTlutObj(&GStack_80, lut, GX_TL_RGB5A3, 0x100);
|
||||
|
||||
TGXTexObj GStack_74;
|
||||
GXInitTexObjCI(&GStack_74, image, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
#endif
|
||||
|
||||
GXLoadTlut(&GStack_80, 0);
|
||||
#if TARGET_PC
|
||||
GXLoadTlut(&tlutObj, GX_TLUT0);
|
||||
GXLoadTexObj(&mainTexObj, GX_TEXMAP0);
|
||||
#else
|
||||
GXLoadTlut(&GStack_80, GX_TLUT0);
|
||||
GXLoadTexObj(&GStack_74, GX_TEXMAP0);
|
||||
#endif
|
||||
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
|
||||
@@ -442,12 +256,13 @@ void daMant_packet_c::draw() {
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
GStack_74.reset();
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(&undersideTexObj, GX_TEXMAP0);
|
||||
#else
|
||||
GXInitTexObjCI(&GStack_74, l_Egnd_mantTEX_U, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
GXLoadTexObj(&GStack_74, GX_TEXMAP0);
|
||||
#endif
|
||||
|
||||
GXSetTevColor(GX_TEVREG0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
||||
GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0});
|
||||
@@ -894,8 +709,14 @@ static int daMant_Execute(mant_class* i_this) {
|
||||
|
||||
if (0 <= uVar1 && uVar1 < 0x4000) {
|
||||
int iVar5 = (uVar1 & 7) + (uVar1 & 0x78) * 4 + (uVar1 >> 4 & 0x18) + (uVar1 & 0x3e00);
|
||||
l_Egnd_mantTEX[iVar5] = l_Egnd_mantTEX_U[iVar5] = 0;
|
||||
DUSK_IF_ELSE(l_Egnd_mantTEX_copy[iVar5], l_Egnd_mantTEX[iVar5]) = l_Egnd_mantTEX_U[iVar5] = 0;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if(textureObjsInitialized) {
|
||||
GXInitTlutObjData(&tlutObj, l_Egnd_mantPAL); // make sure the cached textures are updated
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,6 +754,14 @@ static int daMant_Create(fopAc_ac_c* i_this) {
|
||||
l_Egnd_mantTEX_U[i] = 6;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
memcpy(l_Egnd_mantTEX_copy, l_Egnd_mantTEX, sizeof(l_Egnd_mantTEX_copy));
|
||||
|
||||
if(textureObjsInitialized) {
|
||||
GXInitTlutObjData(&tlutObj, l_Egnd_mantPAL); // make sure the cached textures are updated
|
||||
}
|
||||
#endif
|
||||
|
||||
lbl_277_bss_0 = 0;
|
||||
daMant_Execute(m_this);
|
||||
return 4;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/version.hpp"
|
||||
#endif
|
||||
@@ -180,6 +181,25 @@ static int Worm_nodeCallBack(J3DJoint* i_joint, int param_1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void dmg_rod_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
dmg_rod_class* i_this = (dmg_rod_class*)pUserWork;
|
||||
if (!i_this->mLineInterpPrevValid || !i_this->mLineInterpCurrValid) {
|
||||
return;
|
||||
}
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
const int count = i_this->kind == MG_ROD_KIND_LURE ? MG_ROD_LURE_LINE_LEN : MG_ROD_UKI_LINE_LEN;
|
||||
cXyz* dst = i_this->linemat.getPos(0);
|
||||
for (int i = 0; i < count; i++) {
|
||||
const cXyz& p0 = i_this->mLineInterpPrev[i];
|
||||
const cXyz& p1 = i_this->mLineInterpCurr[i];
|
||||
dst[i] = p0 + (p1 - p0) * alpha;
|
||||
}
|
||||
static GXColor l_color = {0xFF, 0xFF, 0x96, 0xFF};
|
||||
i_this->linemat.update(count, l_color, &i_this->actor.tevStr);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int dmg_rod_Draw(dmg_rod_class* i_this) {
|
||||
int unused;
|
||||
fopAc_ac_c* actor = &i_this->actor;
|
||||
@@ -220,6 +240,18 @@ static int dmg_rod_Draw(dmg_rod_class* i_this) {
|
||||
i_this->linemat.update(MG_ROD_LURE_LINE_LEN, l_color, &i_this->actor.tevStr);
|
||||
dComIfGd_set3DlineMat(&i_this->linemat);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
if (i_this->mLineInterpCurrValid) {
|
||||
memcpy(i_this->mLineInterpPrev, i_this->mLineInterpCurr, MG_ROD_LURE_LINE_LEN * sizeof(cXyz));
|
||||
i_this->mLineInterpPrevValid = true;
|
||||
}
|
||||
memcpy(i_this->mLineInterpCurr, i_this->linemat.getPos(0), MG_ROD_LURE_LINE_LEN * sizeof(cXyz));
|
||||
i_this->mLineInterpCurrValid = true;
|
||||
dusk::frame_interp::add_interpolation_callback(&dmg_rod_interp_callback, i_this);
|
||||
}
|
||||
#endif
|
||||
|
||||
model = i_this->rod_modelMorf->getModel();
|
||||
g_env_light.setLightTevColorType_MAJI(model, &i_this->actor.tevStr);
|
||||
i_this->rod_modelMorf->entryDL();
|
||||
@@ -244,6 +276,18 @@ static int dmg_rod_Draw(dmg_rod_class* i_this) {
|
||||
i_this->linemat.update(MG_ROD_UKI_LINE_LEN, l_color, &i_this->actor.tevStr);
|
||||
dComIfGd_set3DlineMat(&i_this->linemat);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
if (i_this->mLineInterpCurrValid) {
|
||||
memcpy(i_this->mLineInterpPrev, i_this->mLineInterpCurr, MG_ROD_UKI_LINE_LEN * sizeof(cXyz));
|
||||
i_this->mLineInterpPrevValid = true;
|
||||
}
|
||||
memcpy(i_this->mLineInterpCurr, i_this->linemat.getPos(0), MG_ROD_UKI_LINE_LEN * sizeof(cXyz));
|
||||
i_this->mLineInterpCurrValid = true;
|
||||
dusk::frame_interp::add_interpolation_callback(&dmg_rod_interp_callback, i_this);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 15; i++) {
|
||||
g_env_light.setLightTevColorType_MAJI(i_this->rod_uki_model[i], &actor->tevStr);
|
||||
mDoExt_modelUpdateDL(i_this->rod_uki_model[i]);
|
||||
@@ -5755,6 +5799,12 @@ static void play_camera_u(dmg_rod_class* i_this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
BOOL item_any_fishing_rod(int itemId) {
|
||||
return itemId == dItemNo_FISHING_ROD_1_e || (itemId >= dItemNo_BEE_ROD_e && itemId <= dItemNo_JEWEL_WORM_ROD_e);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int dmg_rod_Execute(dmg_rod_class* i_this) {
|
||||
fopAc_ac_c* actor = &i_this->actor;
|
||||
|
||||
@@ -5821,6 +5871,17 @@ static int dmg_rod_Execute(dmg_rod_class* i_this) {
|
||||
i_this->prev_rod_substick_y = i_this->rod_substick_y;
|
||||
i_this->rod_substick_y = mDoCPd_c::getSubStickY(PAD_1);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.buttonFishing) {
|
||||
if ((item_any_fishing_rod(dComIfGp_getSelectItem(0)) && mDoCPd_c::getHoldX(PAD_1)) ||
|
||||
(item_any_fishing_rod(dComIfGp_getSelectItem(1)) && mDoCPd_c::getHoldY(PAD_1)))
|
||||
{
|
||||
i_this->rod_stick_y = -1.0f;
|
||||
i_this->rod_substick_y = -1.0f;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
i_this->reel_speed = 5.0f;
|
||||
i_this->reel_btn_flags = mDoCPd_c::getHoldB(PAD_1) | mDoCPd_c::getHoldDown(PAD_1);
|
||||
if (mDoCPd_c::getHoldDown(PAD_1)) {
|
||||
@@ -6388,6 +6449,11 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
rod->mLineInterpPrevValid = false;
|
||||
rod->mLineInterpCurrValid = false;
|
||||
#endif
|
||||
|
||||
OS_REPORT("//////////////MG_ROD SET 2 !!\n");
|
||||
if (!hio_set) {
|
||||
rod->HIOInit = TRUE;
|
||||
|
||||
@@ -105,6 +105,7 @@ int dMirror_packet_c::entryModel(J3DModel* i_model) {
|
||||
|
||||
void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3,
|
||||
f32 param_4, f32 param_5, f32 param_6, f32 param_7) {
|
||||
ZoneScoped;
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetNumTexGens(0);
|
||||
@@ -265,6 +266,7 @@ void dMirror_packet_c::modelDraw(J3DModel* i_model, Mtx param_1) {
|
||||
}
|
||||
|
||||
void dMirror_packet_c::mainDraw() {
|
||||
ZoneScoped;
|
||||
j3dSys.reinitGX();
|
||||
|
||||
cXyz sp19C[5];
|
||||
|
||||
@@ -328,13 +328,13 @@ int daNpcImpal_c::step(s16 i_angle, int i_animate) {
|
||||
}
|
||||
|
||||
void daNpcImpal_c::playExpression() {
|
||||
daNpcF_anmPlayData dat0 = {ANM_1, mpHIO->m.common.morf_frame, 1};
|
||||
daNpcF_anmPlayData dat0 = {ANM_1, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)};
|
||||
daNpcF_anmPlayData* pDat0[1] = {&dat0};
|
||||
daNpcF_anmPlayData dat1 = {ANM_5, mpHIO->m.common.morf_frame, 1};
|
||||
daNpcF_anmPlayData dat1 = {ANM_5, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)};
|
||||
daNpcF_anmPlayData* pDat1[1] = {&dat1};
|
||||
daNpcF_anmPlayData dat2 = {ANM_4, mpHIO->m.common.morf_frame, 1};
|
||||
daNpcF_anmPlayData dat2 = {ANM_4, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)};
|
||||
daNpcF_anmPlayData* pDat2[1] = {&dat2};
|
||||
daNpcF_anmPlayData dat3 = {ANM_6, mpHIO->m.common.morf_frame, 1};
|
||||
daNpcF_anmPlayData dat3 = {ANM_6, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)};
|
||||
daNpcF_anmPlayData* pDat3[1] = {&dat3};
|
||||
daNpcF_anmPlayData dat4 = {ANM_8, mpHIO->m.common.morf_frame, 0};
|
||||
daNpcF_anmPlayData* pDat4[1] = {&dat4};
|
||||
|
||||
@@ -178,7 +178,7 @@ static void anm_init(npc_ks_class* i_this, int param_2, f32 i_morf, u8 i_attr, f
|
||||
param_2 = 42;
|
||||
} else {
|
||||
// bug: developers meant to set equal to 44?
|
||||
param_2 == 44;
|
||||
IF_NOT_DUSK(param_2 == 44);
|
||||
dComIfGs_shake_kandelaar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,6 +261,7 @@ void FlagCloth_c::execute() {
|
||||
}
|
||||
|
||||
void FlagCloth_c::draw() {
|
||||
ZoneScoped;
|
||||
j3dSys.reinitGX();
|
||||
GXSetNumIndStages(0);
|
||||
dKy_setLight_again();
|
||||
|
||||
@@ -220,6 +220,7 @@ void FlagCloth2_c::initCcSphere(fopAc_ac_c*) {
|
||||
}
|
||||
|
||||
inline void FlagCloth2_c::draw() {
|
||||
ZoneScoped;
|
||||
j3dSys.reinitGX();
|
||||
GXSetNumIndStages(0);
|
||||
dKy_setLight_again();
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "d/d_s_play.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
daObj_Keyhole_HIO_c::daObj_Keyhole_HIO_c() {
|
||||
id = -1;
|
||||
@@ -53,6 +56,21 @@ static int daObj_Keyhole_Draw(obj_keyhole_class* i_this) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
kh_chain_s* chain_s = &i_this->chain_s[i];
|
||||
for (int j = 0; j < i_this->chain_num; j++) {
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled() && i_this->mChainInterpPrevValid && i_this->mChainInterpCurrValid) {
|
||||
const f32 alpha = dusk::frame_interp::get_interpolation_step();
|
||||
Mtx mtx;
|
||||
const f32* p0 = (const f32*)i_this->mChainInterpPrev[i][j];
|
||||
const f32* p1 = (const f32*)i_this->mChainInterpCurr[i][j];
|
||||
f32* dst = (f32*)mtx;
|
||||
for (int k = 0; k < 12; k++) {
|
||||
dst[k] = p0[k] + (p1[k] - p0[k]) * alpha;
|
||||
}
|
||||
chain_s->model[j]->setBaseTRMtx(mtx);
|
||||
g_env_light.setLightTevColorType_MAJI(chain_s->model[j], &actor->tevStr);
|
||||
mDoExt_modelUpdateDL(chain_s->model[j]);
|
||||
} else
|
||||
#endif
|
||||
dComIfGp_entrySimpleModel(chain_s->model[j], fopAcM_GetRoomNo(actor));
|
||||
}
|
||||
}
|
||||
@@ -370,6 +388,21 @@ static void chain_move(obj_keyhole_class* i_this) {
|
||||
ANGLE_ADD(sp8, TREG_S(0) + 0x3D00);
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
if (i_this->mChainInterpCurrValid) {
|
||||
memcpy(i_this->mChainInterpPrev, i_this->mChainInterpCurr, sizeof(i_this->mChainInterpCurr));
|
||||
i_this->mChainInterpPrevValid = true;
|
||||
}
|
||||
for (int i = 0; i < 6; i++) {
|
||||
for (int j = 0; j < i_this->chain_num; j++) {
|
||||
MTXCopy(i_this->chain_s[i].model[j]->getBaseTRMtx(), i_this->mChainInterpCurr[i][j]);
|
||||
}
|
||||
}
|
||||
i_this->mChainInterpCurrValid = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void open(obj_keyhole_class* i_this) {
|
||||
@@ -750,6 +783,11 @@ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
i_this->mChainInterpPrevValid = false;
|
||||
i_this->mChainInterpCurrValid = false;
|
||||
#endif
|
||||
|
||||
OS_REPORT("//////////////OBJ_KEYHOLE SET 2 !!\n");
|
||||
|
||||
if (i_this->arg0 == 3) {
|
||||
|
||||
@@ -392,7 +392,10 @@ static const u8* l_sightDL_get() {
|
||||
#endif
|
||||
|
||||
void daPy_sightPacket_c::draw() {
|
||||
ZoneScoped;
|
||||
#if !TARGET_PC
|
||||
TGXTexObj texObj;
|
||||
#endif
|
||||
|
||||
j3dSys.reinitGX();
|
||||
GXSetNumIndStages(0);
|
||||
@@ -407,10 +410,24 @@ void daPy_sightPacket_c::draw() {
|
||||
|
||||
GXSetTevColor(GX_TEVREG0, reg0);
|
||||
GXSetTevColor(GX_TEVREG1, reg1);
|
||||
#if TARGET_PC
|
||||
if (mpCachedImg != mpImg) {
|
||||
mTexObj.reset();
|
||||
GXInitTexObj(&mTexObj, mpData, mpImg->width, mpImg->height,
|
||||
static_cast<GXTexFmt>(mpImg->format), static_cast<GXTexWrapMode>(mpImg->wrapS),
|
||||
static_cast<GXTexWrapMode>(mpImg->wrapT),
|
||||
mpImg->mipmapCount > 1 ? GX_ENABLE : GX_DISABLE);
|
||||
GXInitTexObjLOD(
|
||||
&mTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
mpCachedImg = mpImg;
|
||||
}
|
||||
GXLoadTexObj(&mTexObj, GX_TEXMAP0);
|
||||
#else
|
||||
GXInitTexObj(&texObj, mpData, mpImg->width, mpImg->height, (GXTexFmt)mpImg->format,
|
||||
(GXTexWrapMode)mpImg->wrapS, (GXTexWrapMode)mpImg->wrapT, mpImg->mipmapCount > 1 ? GX_ENABLE : GX_DISABLE);
|
||||
GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
GXLoadTexObj(&texObj, GX_TEXMAP0);
|
||||
#endif
|
||||
GXLoadPosMtxImm(mProjMtx, GX_PNMTX0);
|
||||
GXSetCurrentMtx(0);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
|
||||
@@ -598,6 +598,7 @@ dFlower_packet_c::dFlower_packet_c() {
|
||||
}
|
||||
|
||||
void dFlower_packet_c::draw() {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* kankyo = dKy_getEnvlight();
|
||||
j3dSys.reinitGX();
|
||||
|
||||
|
||||
@@ -518,6 +518,7 @@ dGrass_packet_c::dGrass_packet_c() {
|
||||
}
|
||||
|
||||
void dGrass_packet_c::draw() {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* kankyo = dKy_getEnvlight();
|
||||
cXyz spB4;
|
||||
cXyz spA8;
|
||||
|
||||
+17
-6
@@ -41,12 +41,12 @@ public:
|
||||
/* 0x14 */ GXColor field_0x14;
|
||||
/* 0x18 */ GXColor field_0x18;
|
||||
/* 0x1C */ TGXTexObj field_0x1c;
|
||||
/* 0x3C */ GXTlutObj field_0x3c;
|
||||
/* 0x3C */ TGXTlutObj field_0x3c;
|
||||
/* 0x48 */ s16 field_0x48;
|
||||
/* 0x4A */ s16 field_0x4a;
|
||||
/* 0x4C */ u8 field_0x4c;
|
||||
/* 0x50 */ TGXTexObj field_0x50;
|
||||
/* 0x70 */ GXTlutObj field_0x70;
|
||||
/* 0x70 */ TGXTlutObj field_0x70;
|
||||
/* 0x7C */ s16 field_0x7c;
|
||||
/* 0x7E */ s16 field_0x7e;
|
||||
/* 0x80 */ u8 field_0x80;
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
u8 check() { return field_0x0; }
|
||||
int getCI() { return mCI; }
|
||||
TGXTexObj* getTexObj() { return &mTexObj; }
|
||||
GXTlutObj* getTlutObj() { return &mTlutObj; }
|
||||
TGXTlutObj* getTlutObj() { return &mTlutObj; }
|
||||
GXColor* getColor() { return &mColor; }
|
||||
f32 getS() { return mS; }
|
||||
f32 getT() { return mT; }
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x01 */ u8 mCI;
|
||||
/* 0x04 */ TGXTexObj mTexObj;
|
||||
/* 0x24 */ GXTlutObj mTlutObj;
|
||||
/* 0x24 */ TGXTlutObj mTlutObj;
|
||||
/* 0x30 */ GXColor mColor;
|
||||
/* 0x34 */ f32 mS;
|
||||
/* 0x38 */ f32 mT;
|
||||
@@ -188,6 +188,7 @@ void dDlst_window_c::setScissor(f32 xOrig, f32 yOrig, f32 width, f32 height) {
|
||||
}
|
||||
|
||||
void dDlst_2DTri_c::draw() {
|
||||
ZoneScoped;
|
||||
f32 f4;
|
||||
f32 f5;
|
||||
f32 f2 = cM_scos(field_0xc);
|
||||
@@ -224,6 +225,7 @@ void dDlst_2DTri_c::draw() {
|
||||
}
|
||||
|
||||
void dDlst_2DQuad_c::draw() {
|
||||
ZoneScoped;
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
@@ -247,6 +249,7 @@ void dDlst_2DQuad_c::draw() {
|
||||
}
|
||||
|
||||
void dDlst_2DPoint_c::draw() {
|
||||
ZoneScoped;
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
@@ -268,6 +271,7 @@ void dDlst_2DPoint_c::draw() {
|
||||
}
|
||||
|
||||
void dDlst_2DT_c::draw() {
|
||||
ZoneScoped;
|
||||
static GXColor l_color = {0xFF, 0xFF, 0xFF, 0xE0};
|
||||
f32 var5 = field_0xe;
|
||||
f32 var6 = field_0x10;
|
||||
@@ -326,6 +330,7 @@ void dDlst_2DT_c::draw() {
|
||||
}
|
||||
|
||||
void dDlst_2DT2_c::draw() {
|
||||
ZoneScoped;
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA6, 0);
|
||||
GXClearVtxDesc();
|
||||
@@ -665,6 +670,7 @@ void dDlst_2DT2_c::init(ResTIMG* i_timg, f32 param_1, f32 param_2, f32 param_3,
|
||||
}
|
||||
|
||||
void dDlst_2DM_c::draw() {
|
||||
ZoneScoped;
|
||||
s16 r31 = field_0x22;
|
||||
s16 r30 = field_0x24;
|
||||
int r29 = field_0x22 + 256.0f;
|
||||
@@ -728,6 +734,7 @@ void dDlst_2DM_c::draw() {
|
||||
|
||||
|
||||
void dDlst_2Dm_c::draw() {
|
||||
ZoneScoped;
|
||||
s16 r31 = field_0x48;
|
||||
s16 r30 = field_0x4a;
|
||||
int r29 = field_0x48 + 256.0f;
|
||||
@@ -794,6 +801,7 @@ void dDlst_2Dm_c::draw() {
|
||||
|
||||
|
||||
void dDlst_2DMt_c::draw() {
|
||||
ZoneScoped;
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
@@ -933,6 +941,7 @@ f32 cM_rnd_c::getValue(f32 param_0, f32 param_1) {
|
||||
}
|
||||
|
||||
void dDlst_effectLine_c::draw() {
|
||||
ZoneScoped;
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
@@ -1034,6 +1043,7 @@ void dDlst_shadowPoly_c::draw() {
|
||||
return;
|
||||
#endif
|
||||
|
||||
ZoneScoped;
|
||||
dDlst_shadowTri_c* tri = getTri();
|
||||
|
||||
GXBegin(GX_TRIANGLES, GX_VTXFMT0, mCount * 3);
|
||||
@@ -1610,6 +1620,7 @@ void dDlst_shadowControl_c::imageDraw(Mtx param_0) {
|
||||
}
|
||||
|
||||
void dDlst_shadowControl_c::draw(Mtx param_0) {
|
||||
ZoneScoped;
|
||||
static GXTevColorChan l_tevColorChan[4] = {
|
||||
GX_CH_RED,
|
||||
GX_CH_GREEN,
|
||||
@@ -1985,7 +1996,7 @@ int dDlst_list_c::set(dDlst_base_c**& p_start, dDlst_base_c**& p_end, dDlst_base
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG)
|
||||
#if DUSK_GFX_DEBUG_GROUPS
|
||||
static absl::flat_hash_map<std::type_index, const char*> typeDrawNames;
|
||||
|
||||
static const char* getTypeDrawName(dDlst_base_c* dlst) {
|
||||
@@ -2008,7 +2019,7 @@ void dDlst_list_c::draw(dDlst_base_c** p_start, dDlst_base_c** p_end) {
|
||||
for (; p_start < p_end; p_start++) {
|
||||
dDlst_base_c* dlst = *p_start;
|
||||
|
||||
#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG)
|
||||
#if DUSK_GFX_DEBUG_GROUPS
|
||||
const auto name = getTypeDrawName(dlst);
|
||||
GXScopedDebugGroup scope(name);
|
||||
#endif
|
||||
|
||||
+246
-31
@@ -94,6 +94,39 @@ static void dKyr_set_btitex(TGXTexObj* i_obj, ResTIMG* i_img) {
|
||||
dKyr_set_btitex_common(i_obj, i_img, GX_TEXMAP0);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
template <int N>
|
||||
struct CachedTexObjs {
|
||||
TGXTexObj texObj[N];
|
||||
ResTIMG* timg[N] = {};
|
||||
};
|
||||
|
||||
template <int N>
|
||||
static GXTexObj* load_cached_tex(CachedTexObjs<N>& cache, ResTIMG* img, GXTexMapID mapID) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (img != nullptr && cache.timg[i] == img) {
|
||||
GXLoadTexObj(&cache.texObj[i], mapID);
|
||||
return &cache.texObj[i];
|
||||
}
|
||||
}
|
||||
|
||||
int slot = 0;
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (cache.timg[i] == nullptr) {
|
||||
slot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cache.timg[slot] != nullptr) {
|
||||
cache.texObj[slot].reset();
|
||||
}
|
||||
cache.timg[slot] = img;
|
||||
dKyr_set_btitex_common(&cache.texObj[slot], img, mapID);
|
||||
return &cache.texObj[slot];
|
||||
}
|
||||
#endif
|
||||
|
||||
void dKyr_lenzflare_move() {
|
||||
dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket;
|
||||
dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket;
|
||||
@@ -929,7 +962,7 @@ void dKyr_housi_move() {
|
||||
if (g_env_light.mHousiCount != 0 ||
|
||||
(g_env_light.mHousiCount == 0 && housi_packet->field_0x5de8 <= 0.0f))
|
||||
{
|
||||
housi_packet->field_0x5dec = g_env_light.mHousiCount;
|
||||
housi_packet->mHousiCount = g_env_light.mHousiCount;
|
||||
}
|
||||
|
||||
if (g_env_light.mHousiCount != 0) {
|
||||
@@ -938,7 +971,7 @@ void dKyr_housi_move() {
|
||||
cLib_addCalc(&housi_packet->field_0x5de8, 0.0f, 0.2f, 0.05f, 0.01f);
|
||||
}
|
||||
|
||||
if (housi_packet->field_0x5dec == 0) {
|
||||
if (housi_packet->mHousiCount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -977,7 +1010,7 @@ void dKyr_housi_move() {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = housi_packet->field_0x5dec - 1; i >= 0; i--) {
|
||||
for (int i = housi_packet->mHousiCount - 1; i >= 0; i--) {
|
||||
f32 var_f26 = 0.4f * housi_packet->field_0x5de8;
|
||||
effect = &housi_packet->mHousiEff[i];
|
||||
|
||||
@@ -2025,16 +2058,27 @@ void vrkumo_move() {
|
||||
}
|
||||
}
|
||||
|
||||
static void dKr_cullVtx_Set() {
|
||||
static void dKr_cullVtx_Set(IF_DUSK(bool const vtxColor = false)) {
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8);
|
||||
#if TARGET_PC
|
||||
if (vtxColor) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
}
|
||||
#endif
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
#if TARGET_PC
|
||||
if (vtxColor) {
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket;
|
||||
dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -2122,10 +2166,17 @@ static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<8> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP1);
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[1], GX_TEXMAP1);
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2);
|
||||
#endif
|
||||
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
@@ -2205,7 +2256,11 @@ static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) {
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (i == 1) {
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)lenz_packet->mpResBall, GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)lenz_packet->mpResBall);
|
||||
#endif
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
@@ -2470,10 +2525,17 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<8> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP1);
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[1], GX_TEXMAP1);
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2);
|
||||
#endif
|
||||
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
@@ -2567,7 +2629,11 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) {
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (i == 1) {
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)lenz_packet->mpResBall, GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)lenz_packet->mpResBall);
|
||||
#endif
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
@@ -2680,6 +2746,7 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) {
|
||||
}
|
||||
|
||||
void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) {
|
||||
ZoneScoped;
|
||||
dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket;
|
||||
dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -2730,8 +2797,13 @@ void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) {
|
||||
|
||||
j3dSys.reinitGX();
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<3> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
@@ -3036,11 +3108,23 @@ void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) {
|
||||
}
|
||||
|
||||
if (i == 1) {
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[2], GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[2]);
|
||||
#endif
|
||||
} else if (i == 2) {
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[3], GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[3]);
|
||||
#endif
|
||||
} else {
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
spE4.x = -var_f31;
|
||||
@@ -3131,8 +3215,13 @@ void dKyr_drawRain(Mtx drawMtx, u8** tex) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
GXSetNumTexGens(1);
|
||||
@@ -3296,8 +3385,13 @@ void dKyr_drawSibuki(Mtx drawMtx, u8** tex) {
|
||||
color.b = 0xC8;
|
||||
color.a = rain_packet->mSibukiAlpha * alphaFade;
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[1]);
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color);
|
||||
GXSetTevColor(GX_TEVREG1, color);
|
||||
@@ -3378,21 +3472,26 @@ void dKyr_drawSibuki(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
|
||||
void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dKankyo_housi_Packet* housi_packet = g_env_light.mpHousiPacket;
|
||||
static f32 rot = 0.0f;
|
||||
|
||||
Mtx camMtx;
|
||||
Mtx rotMtx;
|
||||
cXyz pos[4];
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
#else
|
||||
TGXTexObj spDC;
|
||||
#endif
|
||||
cXyz spD0;
|
||||
Vec spC4;
|
||||
Vec spB8;
|
||||
|
||||
bool var_r28 = 0;
|
||||
if (housi_packet->field_0x5dec != 0) {
|
||||
bool isPalaceOfTwilight = 0;
|
||||
if (housi_packet->mHousiCount != 0) {
|
||||
if (strcmp(dComIfGp_getStartStageName(), "D_MN08") == 0) {
|
||||
var_r28 = 1;
|
||||
isPalaceOfTwilight = 1;
|
||||
}
|
||||
|
||||
if (strcmp(dComIfGp_getStartStageName(), "D_MN08") != 0 ||
|
||||
@@ -3419,7 +3518,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
color_reg1.b = 0xCA;
|
||||
color_reg1.a = 0xFF;
|
||||
|
||||
if (dKy_darkworld_check() == 1 || var_r28 == 1) {
|
||||
if (dKy_darkworld_check() == 1 || isPalaceOfTwilight == 1) {
|
||||
color_reg0.r = 0;
|
||||
color_reg0.g = 0;
|
||||
color_reg0.b = 0;
|
||||
@@ -3471,18 +3570,27 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
f32 temp_f24 = 6.5f;
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
dKyr_set_btitex(&spDC, (ResTIMG*)*tex);
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)*tex, GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)*tex);
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
|
||||
#else
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
#endif
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, DUSK_IF_ELSE(GX_COLOR0A0, GX_COLOR_NULL));
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE,
|
||||
GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_CA), GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE,
|
||||
GX_TEVPREV);
|
||||
|
||||
@@ -3505,7 +3613,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
|
||||
GXSetClipMode(GX_CLIP_DISABLE);
|
||||
GXSetNumIndStages(0);
|
||||
dKr_cullVtx_Set();
|
||||
dKr_cullVtx_Set(IF_DUSK(true));
|
||||
|
||||
rot += 1.2f;
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
@@ -3514,7 +3622,13 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
|
||||
for (int j = 0; j < housi_packet->field_0x5dec; j++) {
|
||||
#if TARGET_PC
|
||||
// Dusklight optimization: we submit a single large draw call, rather than hundreds.
|
||||
u32 vertCount = 4 * housi_packet->mHousiCount;
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, vertCount);
|
||||
#endif
|
||||
|
||||
for (int j = 0; j < housi_packet->mHousiCount; j++) {
|
||||
fopAc_ac_c* player = dComIfGp_getPlayer(0);
|
||||
|
||||
spD0.x =
|
||||
@@ -3525,6 +3639,10 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
housi_packet->mHousiEff[j].mBasePos.z + housi_packet->mHousiEff[j].mPosition.z;
|
||||
|
||||
if (i == 1 && j == 0) {
|
||||
#if TARGET_PC
|
||||
// Never gets hit I think?
|
||||
abort();
|
||||
#endif
|
||||
color_reg0.r = 0;
|
||||
color_reg0.g = 0;
|
||||
color_reg0.b = 0;
|
||||
@@ -3553,8 +3671,10 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
color_reg0.a = housi_packet->mHousiEff[j].mAlpha * var_f25;
|
||||
|
||||
block_14:
|
||||
GXLoadTexObj(&spDC, GX_TEXMAP0);
|
||||
#if !TARGET_PC // GXLoadTextObj does nothing, TEV colors replaced with vertex colors
|
||||
GXLoadTexObj(&texobj, GX_TEXMAP0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
#endif
|
||||
|
||||
f32 var_f27 = housi_packet->mHousiEff[j].field_0x48 * 9.0f;
|
||||
if (g_env_light.field_0xea9 == 1) {
|
||||
@@ -3566,7 +3686,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
f32 temp_f30 =
|
||||
(var_f27 * 0.2f) * cM_fcos(housi_packet->mHousiEff[j].mScale.y * 6.0f);
|
||||
|
||||
if (dKy_darkworld_check() == 1 || var_r28 == 1) {
|
||||
if (dKy_darkworld_check() == 1 || isPalaceOfTwilight == 1) {
|
||||
cXyz sp7C[] = {
|
||||
cXyz(-1.0f, -0.5f, 0.0f),
|
||||
cXyz(-1.0f, 1.5f, 0.0f),
|
||||
@@ -3711,24 +3831,34 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
pos[3].z = spD0.z + spB8.z;
|
||||
}
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
IF_NOT_DUSK(GXBegin(GX_QUADS, GX_VTXFMT0, 4));
|
||||
|
||||
s16 var_r17 = 0x1FF;
|
||||
if (dKy_darkworld_check() == true || var_r28 == 1) {
|
||||
if (dKy_darkworld_check() == true || isPalaceOfTwilight == 1) {
|
||||
var_r17 = 0xFA;
|
||||
}
|
||||
|
||||
GXPosition3f32(pos[0].x, pos[0].y, pos[0].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXPosition3f32(pos[1].x, pos[1].y, pos[1].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(var_r17, 0);
|
||||
GXPosition3f32(pos[2].x, pos[2].y, pos[2].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(var_r17, var_r17);
|
||||
GXPosition3f32(pos[3].x, pos[3].y, pos[3].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, var_r17);
|
||||
GXEnd();
|
||||
|
||||
|
||||
IF_NOT_DUSK(GXEnd());
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
GXEnd();
|
||||
#endif
|
||||
}
|
||||
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
@@ -3738,6 +3868,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
|
||||
void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
dKankyo_snow_Packet* snow_packet = g_env_light.mpSnowPacket;
|
||||
|
||||
@@ -3801,25 +3932,37 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
|
||||
if (tex[0] != NULL) {
|
||||
TGXTexObj spA0;
|
||||
dKyr_set_btitex(&spA0, (ResTIMG*)tex[0]);
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
#if TARGET_PC
|
||||
// Dusklight optimization: enable draw call merging
|
||||
// by using vertex color instead of GX_TEVREG0
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
|
||||
#else
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
#endif
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, DUSK_IF_ELSE(GX_COLOR0A0, GX_COLOR_NULL));
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_TEXC, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_CA), GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_ONE, GX_LO_COPY);
|
||||
GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
|
||||
GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_DISABLE);
|
||||
GXSetClipMode(GX_CLIP_DISABLE);
|
||||
GXSetNumIndStages(0);
|
||||
dKr_cullVtx_Set();
|
||||
dKr_cullVtx_Set(IF_DUSK(true));
|
||||
|
||||
Mtx rotMtx;
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
@@ -3896,7 +4039,7 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
}
|
||||
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0));
|
||||
f32 sp38 = 2.0f * (i / 500.0f) * snow_packet->field_0x6d80;
|
||||
f32 sp68 = sp50 * (camera->view.lookat.eye.abs(sp7C) / 1000.0f);
|
||||
if (sp68 > 1.0f) {
|
||||
@@ -3944,19 +4087,23 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
|
||||
for (int k = 0; k < spC; k++) {
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(pos[0].x + (temp_f31 * add_table[k].x), pos[0].y + (temp_f31 * add_table[k].y), pos[0].z + (temp_f31 * add_table[k].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXPosition3f32(pos[1].x + (temp_f31 * add_table[k].x), pos[1].y + (temp_f31 * add_table[k].y), pos[1].z + (temp_f31 * add_table[k].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0);
|
||||
GXPosition3f32(pos[2].x + (temp_f31 * add_table[k].x), pos[2].y + (temp_f31 * add_table[k].y), pos[2].z + (temp_f31 * add_table[k].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0xFF);
|
||||
GXPosition3f32(pos[3].x + (temp_f31 * add_table[k].x), pos[3].y + (temp_f31 * add_table[k].y), pos[3].z + (temp_f31 * add_table[k].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0xFF);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
if ((g_env_light.field_0xe90 != 0 && dComIfGp_roomControl_getStayNo() == 0 && sp7C.z < 3000.0f) || dComIfGp_roomControl_getStayNo() == 3 || dComIfGp_roomControl_getStayNo() == 6 || dComIfGp_roomControl_getStayNo() == 9 || dComIfGp_roomControl_getStayNo() == 13) {
|
||||
color_reg0.a = 255.0f * ((0.4f * snow_packet->mSnowEff[i].field_0x30) + temp_f29);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0));
|
||||
|
||||
f32 sp34;
|
||||
f32 sp30;
|
||||
@@ -4012,12 +4159,16 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) {
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
int var_r27 = 0;
|
||||
GXPosition3f32(pos[0].x + (temp_f31 * add_table[var_r27].x), pos[0].y + (temp_f31 * add_table[var_r27].y), pos[0].z + (temp_f31 * add_table[var_r27].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXPosition3f32(pos[1].x + (temp_f31 * add_table[var_r27].x), pos[1].y + (temp_f31 * add_table[var_r27].y), pos[1].z + (temp_f31 * add_table[var_r27].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0);
|
||||
GXPosition3f32(pos[2].x + (temp_f31 * add_table[var_r27].x), pos[2].y + (temp_f31 * add_table[var_r27].y), pos[2].z + (temp_f31 * add_table[var_r27].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0xFF);
|
||||
GXPosition3f32(pos[3].x + (temp_f31 * add_table[var_r27].x), pos[3].y + (temp_f31 * add_table[var_r27].y), pos[3].z + (temp_f31 * add_table[var_r27].z));
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0xFF);
|
||||
GXEnd();
|
||||
}
|
||||
@@ -4353,6 +4504,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) {
|
||||
}
|
||||
|
||||
void drawCloudShadow(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* envlight = dKy_getEnvlight();
|
||||
dKankyo_cloud_Packet* cloud_packet = g_env_light.mpCloudPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -4388,7 +4540,12 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) {
|
||||
|
||||
GXSetClipMode(GX_CLIP_DISABLE);
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
TGXTexObj fb_texobj;
|
||||
#else
|
||||
TGXTexObj texobj, fb_texobj;
|
||||
#endif
|
||||
if (g_env_light.mMoyaMode < 50) {
|
||||
dKy_ParticleColor_get_bg(&camera->view.lookat.eye, NULL, &sp48, &sp44, &sp40, &sp3C, 0.0f);
|
||||
f32 temp_f30 = 0.4f;
|
||||
@@ -4401,7 +4558,11 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) {
|
||||
color_reg1.g = (0.45f * sp38.g) + (0.55f * sp44.g);
|
||||
color_reg1.b = (0.45f * sp38.b) + (0.55f * sp44.b);
|
||||
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
@@ -4446,7 +4607,11 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) {
|
||||
color_reg1.b = 0;
|
||||
color_reg1.a = 0xFF;
|
||||
|
||||
#if TARGET_PC
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP1);
|
||||
#else
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP1);
|
||||
#endif
|
||||
|
||||
ResTIMG* fb_timg = mDoGph_gInf_c::getFrameBufferTimg();
|
||||
dDlst_window_c* window = dComIfGp_getWindow(0);
|
||||
@@ -4593,7 +4758,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
Mtx camMtx;
|
||||
Mtx rotMtx;
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<3> texobj;
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
#endif
|
||||
cXyz proj;
|
||||
|
||||
f32 rot;
|
||||
@@ -4703,7 +4872,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
color_reg1.r = 0;
|
||||
color_reg1.g = 0;
|
||||
color_reg1.b = 0;
|
||||
#if TARGET_PC
|
||||
auto* loaded_texobj = load_cached_tex(texobj, (ResTIMG*)tex[j], GX_TEXMAP0);
|
||||
#else
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[j]);
|
||||
#endif
|
||||
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color);
|
||||
@@ -4808,7 +4981,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) {
|
||||
}
|
||||
|
||||
if (!(vrkumo_packet->mVrkumoEff[k].mAlpha <= 0.000001f)) {
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(loaded_texobj, GX_TEXMAP0);
|
||||
#else
|
||||
GXLoadTexObj(&texobj, GX_TEXMAP0);
|
||||
#endif
|
||||
GXSetTevColor(GX_TEVREG0, color);
|
||||
|
||||
sp60 = sp68 * (0.2f + (0.2f * (k / 100.0f)));
|
||||
@@ -5341,6 +5518,7 @@ void dKyr_odour_move() {
|
||||
}
|
||||
|
||||
void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* envlight = dKy_getEnvlight();
|
||||
dKankyo_odour_Packet* odour_packet = envlight->mOdourData.mpOdourPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -5429,8 +5607,14 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
break;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
TGXTexObj fb_texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP1);
|
||||
#else
|
||||
TGXTexObj texobj, fb_texobj;
|
||||
dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP1);
|
||||
#endif
|
||||
|
||||
ResTIMG* fb_timg = mDoGph_gInf_c::getFrameBufferTimg();
|
||||
dDlst_window_c* window = dComIfGp_getWindow(0);
|
||||
@@ -5445,18 +5629,23 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
|
||||
MTXConcat(camMtx, rotMtx, camMtx);
|
||||
|
||||
// Dusklight opt: enable draw call merging
|
||||
// by using vertex color instead of GX_TEVREG0
|
||||
|
||||
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
GXLoadTexMtxImm(spF0, GX_TEXMTX0, GX_MTX3x4);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_CLR_RGBA, GX_RGBA4, 8);
|
||||
IF_DUSK(GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0));
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX1, GX_DIRECT);
|
||||
IF_DUSK(GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT));
|
||||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, DUSK_IF_ELSE(GX_SRC_VTX, GX_SRC_REG), GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
GXSetTevColor(GX_TEVREG1, color_reg1);
|
||||
GXSetNumTexGens(2);
|
||||
@@ -5464,14 +5653,14 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
GXSetTexCoordGen(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY);
|
||||
GXSetNumTevStages(2);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_C0, GX_CC_C1);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_C1);
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_TEXA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR0A0);
|
||||
GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_CPREV, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_A0), GX_CA_TEXA, GX_CA_ZERO);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_COPY);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0);
|
||||
@@ -5513,7 +5702,7 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
if (effect->mStatus != 0) {
|
||||
if (!(temp_f29 <= 0.000001f)) {
|
||||
color_reg0.a = 255.0f * temp_f29;
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0));
|
||||
|
||||
sp70 = sp4C;
|
||||
|
||||
@@ -5551,15 +5740,19 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) {
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(pos[0].x, pos[0].y, pos[0].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXTexCoord2s16(0, 0);
|
||||
GXPosition3f32(pos[1].x, pos[1].y, pos[1].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0);
|
||||
GXTexCoord2s16(0xFF, 0);
|
||||
GXPosition3f32(pos[2].x, pos[2].y, pos[2].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0xFF, 0xFF);
|
||||
GXTexCoord2s16(0xFF, 0xFF);
|
||||
GXPosition3f32(pos[3].x, pos[3].y, pos[3].z);
|
||||
IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a));
|
||||
GXTexCoord2s16(0, 0xFF);
|
||||
GXTexCoord2s16(0, 0xFF);
|
||||
GXEnd();
|
||||
@@ -5730,6 +5923,7 @@ void dKyr_mud_move() {
|
||||
}
|
||||
|
||||
void dKyr_mud_draw(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dKankyo_mud_Packet* mud_packet = g_env_light.mpMudPacket;
|
||||
dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket;
|
||||
|
||||
@@ -5823,8 +6017,13 @@ void dKyr_mud_draw(Mtx drawMtx, u8** tex) {
|
||||
|
||||
if (g_env_light.camera_water_in_status == 0) {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj_cache;
|
||||
auto* texobj = load_cached_tex(texobj_cache, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
|
||||
GXSetNumChans(0);
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
@@ -5864,7 +6063,11 @@ void dKyr_mud_draw(Mtx drawMtx, u8** tex) {
|
||||
|
||||
color_reg0.a = mud_packet->mEffect[j].field_0x38 * var_f31;
|
||||
|
||||
#if TARGET_PC
|
||||
GXLoadTexObj(texobj, GX_TEXMAP0);
|
||||
#else
|
||||
GXLoadTexObj(&texobj, GX_TEXMAP0);
|
||||
#endif
|
||||
GXSetTevColor(GX_TEVREG0, color_reg0);
|
||||
|
||||
f32 sp30 = 1.0f;
|
||||
@@ -5949,6 +6152,7 @@ void dKyr_evil_move() {
|
||||
}
|
||||
|
||||
static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* envlight = dKy_getEnvlight();
|
||||
dKankyo_evil_Packet* evil_packet = envlight->mpEvilPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -5985,8 +6189,13 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) {
|
||||
color_reg0.b = 0x87;
|
||||
color_reg0.a = 0xFF;
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[1]);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
@@ -6187,6 +6396,7 @@ static f32 dKyr_near_bosslight_check(cXyz pos) {
|
||||
}
|
||||
|
||||
void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
ZoneScoped;
|
||||
dScnKy_env_light_c* envlight = dKy_getEnvlight();
|
||||
dKankyo_evil_Packet* evil_packet = envlight->mpEvilPacket;
|
||||
camera_class* camera = (camera_class*)dComIfGp_getCamera(0);
|
||||
@@ -6223,8 +6433,13 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) {
|
||||
color_reg1.b = 10;
|
||||
color_reg1.a = 255;
|
||||
|
||||
#if TARGET_PC
|
||||
static CachedTexObjs<1> texobj;
|
||||
load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0);
|
||||
#else
|
||||
TGXTexObj texobj;
|
||||
dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]);
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::frame_interp::get_ui_tick_pending())
|
||||
|
||||
@@ -79,7 +79,7 @@ SNOW_EFF::~SNOW_EFF() {}
|
||||
SNOW_EFF::SNOW_EFF() {}
|
||||
|
||||
void dKankyo_snow_Packet::draw() {
|
||||
dKyr_drawSnow(j3dSys.getViewMtx(), &mpTex);
|
||||
GX_DEBUG_GROUP(dKyr_drawSnow, j3dSys.getViewMtx(), &mpTex);
|
||||
}
|
||||
|
||||
STAR_EFF::~STAR_EFF() {}
|
||||
@@ -103,7 +103,7 @@ HOUSI_EFF::~HOUSI_EFF() {}
|
||||
HOUSI_EFF::HOUSI_EFF() {}
|
||||
|
||||
void dKankyo_housi_Packet::draw() {
|
||||
dKyr_drawHousi(j3dSys.getViewMtx(), &mpResTex);
|
||||
GX_DEBUG_GROUP(dKyr_drawHousi, j3dSys.getViewMtx(), &mpResTex);
|
||||
}
|
||||
|
||||
VRKUMO_EFF::~VRKUMO_EFF() {}
|
||||
@@ -119,7 +119,7 @@ EF_ODOUR_EFF::~EF_ODOUR_EFF() {}
|
||||
EF_ODOUR_EFF::EF_ODOUR_EFF() {}
|
||||
|
||||
void dKankyo_odour_Packet::draw() {
|
||||
dKyr_odour_draw(j3dSys.getViewMtx(), &mpResTex);
|
||||
GX_DEBUG_GROUP(dKyr_odour_draw, j3dSys.getViewMtx(), &mpResTex);
|
||||
}
|
||||
|
||||
EF_MUD_EFF::~EF_MUD_EFF() {}
|
||||
|
||||
@@ -1943,6 +1943,12 @@ void dMenu_Fmap2DBack_c::regionMapMove(STControl* i_stick) {
|
||||
calcAllMapPos2D(mArrowPos3DX + control_xpos - mStageTransX,
|
||||
mArrowPos3DZ + control_ypos - mStageTransZ, &pos_x, &pos_y);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
pos_x = getMirrorPosX(pos_x, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
mSelectRegion = 0xff;
|
||||
int region = mRegionCursor;
|
||||
if (region != 0xff && region != 7) {
|
||||
|
||||
@@ -23,6 +23,39 @@
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#include <cstring>
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/settings.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace {
|
||||
|
||||
// Reads the user HUD scale setting, clamped to a safe range.
|
||||
f32 dGetUserHudScale() {
|
||||
return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
}
|
||||
|
||||
// The screen corner each HUD group is anchored to. A pane scales around its own origin,
|
||||
// so without correction it drifts away from the screen edge; this names the corner that
|
||||
// must stay put.
|
||||
enum class HudCorner { TopLeft, TopRight, BottomLeft, BottomRight };
|
||||
|
||||
// Adds the paneTrans offset that keeps i_corner pinned in place while the user HUD scale
|
||||
// grows or shrinks the pane. The shift is half the change in size pushed toward the
|
||||
// anchor corner, so it depends only on the pane's size (not its on-screen position) and
|
||||
// works whether the HUD is scaled down or up. i_pull < 1 applies a partial horizontal
|
||||
// push for a pane whose content sits inset from its box edge (the heart row).
|
||||
void dAnchorHudScale(CPaneMgr* i_pane, HudCorner i_corner, f32* io_x, f32* io_y, f32 i_pull = 1.0f) {
|
||||
const f32 half = (1.0f - dGetUserHudScale()) * 0.5f;
|
||||
const f32 dirX =
|
||||
(i_corner == HudCorner::TopRight || i_corner == HudCorner::BottomRight) ? 1.0f : -1.0f;
|
||||
const f32 dirY =
|
||||
(i_corner == HudCorner::BottomLeft || i_corner == HudCorner::BottomRight) ? 1.0f : -1.0f;
|
||||
*io_x += dirX * i_pane->getInitSizeX() * half * i_pull;
|
||||
*io_y += dirY * i_pane->getInitSizeY() * half;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) {
|
||||
OS_REPORT("enter dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap *mp_heap)\n");
|
||||
|
||||
@@ -536,6 +569,12 @@ void dMeter2Draw_c::init() {
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::exec(u32 i_status) {
|
||||
#if TARGET_PC
|
||||
// n_all keeps the vanilla scale. Scaling the root pane shrinks every child toward
|
||||
// its centred origin; per-child scaling in each drawXxx() path keeps each HUD group
|
||||
// anchored to its own pane origin and also pulls it toward the screen corner.
|
||||
const f32 userHudScale = dGetUserHudScale();
|
||||
#endif
|
||||
if (mParentScale != g_drawHIO.mParentScale) {
|
||||
mParentScale = g_drawHIO.mParentScale;
|
||||
mpParent->scale(g_drawHIO.mParentScale, g_drawHIO.mParentScale);
|
||||
@@ -546,6 +585,39 @@ void dMeter2Draw_c::exec(u32 i_status) {
|
||||
mpParent->setAlphaRate(g_drawHIO.mParentAlpha);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (i_status & 0x1000000) {
|
||||
f32 ringPosX = g_drawHIO.mRingHUDButtonsPosX;
|
||||
f32 ringPosY = g_drawHIO.mRingHUDButtonsPosY;
|
||||
dAnchorHudScale(mpButtonParent, HudCorner::TopRight, &ringPosX, &ringPosY);
|
||||
if (mButtonsPosX != ringPosX || mButtonsPosY != ringPosY) {
|
||||
mButtonsPosX = ringPosX;
|
||||
mButtonsPosY = ringPosY;
|
||||
mpButtonParent->paneTrans(ringPosX, ringPosY);
|
||||
}
|
||||
|
||||
const f32 ringButtonsScale = g_drawHIO.mRingHUDButtonsScale * userHudScale;
|
||||
if (mButtonsScale != ringButtonsScale) {
|
||||
mButtonsScale = ringButtonsScale;
|
||||
mpButtonParent->scale(ringButtonsScale, ringButtonsScale);
|
||||
}
|
||||
} else {
|
||||
f32 mainPosX = g_drawHIO.mMainHUDButtonsPosX;
|
||||
f32 mainPosY = g_drawHIO.mMainHUDButtonsPosY;
|
||||
dAnchorHudScale(mpButtonParent, HudCorner::TopRight, &mainPosX, &mainPosY);
|
||||
if (mButtonsPosX != mainPosX || mButtonsPosY != mainPosY) {
|
||||
mButtonsPosX = mainPosX;
|
||||
mButtonsPosY = mainPosY;
|
||||
mpButtonParent->paneTrans(mainPosX, mainPosY);
|
||||
}
|
||||
|
||||
const f32 mainButtonsScale = g_drawHIO.mMainHUDButtonsScale * userHudScale;
|
||||
if (mButtonsScale != mainButtonsScale) {
|
||||
mButtonsScale = mainButtonsScale;
|
||||
mpButtonParent->scale(mainButtonsScale, mainButtonsScale);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (i_status & 0x1000000) {
|
||||
if (mButtonsPosX != g_drawHIO.mRingHUDButtonsPosX ||
|
||||
mButtonsPosY != g_drawHIO.mRingHUDButtonsPosY)
|
||||
@@ -574,6 +646,7 @@ void dMeter2Draw_c::exec(u32 i_status) {
|
||||
mpButtonParent->scale(g_drawHIO.mMainHUDButtonsScale, g_drawHIO.mMainHUDButtonsScale);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::draw() {
|
||||
@@ -588,6 +661,9 @@ void dMeter2Draw_c::draw() {
|
||||
if (mpItemXY[i] != NULL) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
f32 temp_f30 = mItemParams[i].num_scale * 16.0f;
|
||||
#if TARGET_PC
|
||||
temp_f30 *= dGetUserHudScale();
|
||||
#endif
|
||||
|
||||
Vec vtx0 = mpItemXY[i]->getPanePtr()->getGlbVtx(0);
|
||||
Vec vtx3 = mpItemXY[i]->getPanePtr()->getGlbVtx(3);
|
||||
@@ -1478,7 +1554,12 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY)
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 lifeParentScale = g_drawHIO.mLifeParentScale * dGetUserHudScale();
|
||||
mpLifeParent->scale(lifeParentScale, lifeParentScale);
|
||||
#else
|
||||
mpLifeParent->scale(g_drawHIO.mLifeParentScale, g_drawHIO.mLifeParentScale);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
mpHeartMark[i]->scale(g_drawHIO.mHeartMarkScale, g_drawHIO.mHeartMarkScale);
|
||||
@@ -1488,7 +1569,16 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY)
|
||||
mpBigHeart->scale(g_drawHIO.mBigHeartScale, g_drawHIO.mBigHeartScale);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
f32 lifePosX = i_posX;
|
||||
f32 lifePosY = i_posY;
|
||||
// The heart row sits inset from its box's left edge, so use a partial horizontal pull
|
||||
// to keep it from jamming against the screen edge.
|
||||
dAnchorHudScale(mpLifeParent, HudCorner::TopLeft, &lifePosX, &lifePosY, 0.6f);
|
||||
mpLifeParent->paneTrans(lifePosX, lifePosY);
|
||||
#else
|
||||
mpLifeParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaLifeChange(bool param_0) {
|
||||
@@ -1601,9 +1691,22 @@ void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) {
|
||||
mpMagicMeter->resize(field_0x584[i_meterType], field_0x590[i_meterType]);
|
||||
mpMagicFrameR->move(field_0x59c[i_meterType], field_0x5a8[i_meterType]);
|
||||
mpMagicBase->resize(field_0x5b4[i_meterType], field_0x5c0[i_meterType]);
|
||||
#if TARGET_PC
|
||||
const f32 magicUserScale = dGetUserHudScale();
|
||||
mpMagicParent->scale(field_0x5cc[i_meterType] * magicUserScale,
|
||||
field_0x5d8[i_meterType] * magicUserScale);
|
||||
|
||||
f32 magicPosX = field_0x5e4[i_meterType];
|
||||
f32 magicPosY = field_0x5f0[i_meterType];
|
||||
// The oil/magic bar sits inset within its pane box, so use a reduced horizontal pull
|
||||
// (like the heart row) to keep it from overshooting off the left edge when shrunk.
|
||||
dAnchorHudScale(mpMagicParent, HudCorner::TopLeft, &magicPosX, &magicPosY, 0.3f);
|
||||
mpMagicParent->paneTrans(magicPosX, magicPosY);
|
||||
#else
|
||||
mpMagicParent->scale(field_0x5cc[i_meterType], field_0x5d8[i_meterType]);
|
||||
|
||||
mpMagicParent->paneTrans(field_0x5e4[i_meterType], field_0x5f0[i_meterType]);
|
||||
#endif
|
||||
|
||||
mpKanteraScreen->draw(0.0f, 0.0f, graf_ctx);
|
||||
}
|
||||
@@ -1867,10 +1970,21 @@ void dMeter2Draw_c::drawLightDrop(u8 i_num, u8 i_needNum, f32 i_posX, f32 i_posY
|
||||
|
||||
field_0x6fc = param_5;
|
||||
mLightDropVesselScale = i_vesselScale;
|
||||
#if TARGET_PC
|
||||
const f32 lightDropUserScale = dGetUserHudScale();
|
||||
const f32 lightDropScale = mLightDropVesselScale * field_0x6f8 * lightDropUserScale;
|
||||
mpLightDropParent->scale(lightDropScale, lightDropScale);
|
||||
|
||||
f32 lightDropPosX = i_posX;
|
||||
f32 lightDropPosY = i_posY;
|
||||
dAnchorHudScale(mpLightDropParent, HudCorner::TopRight, &lightDropPosX, &lightDropPosY);
|
||||
mpLightDropParent->paneTrans(lightDropPosX, lightDropPosY);
|
||||
#else
|
||||
mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8,
|
||||
mLightDropVesselScale * field_0x6f8);
|
||||
|
||||
mpLightDropParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaLightDropChange(bool unused) {}
|
||||
@@ -1943,8 +2057,13 @@ void dMeter2Draw_c::setAlphaLightDropAnimeMax() {
|
||||
field_0x6f8 = 1.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 dropAnimScale = mLightDropVesselScale * field_0x6f8 * dGetUserHudScale();
|
||||
mpLightDropParent->scale(dropAnimScale, dropAnimScale);
|
||||
#else
|
||||
mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8,
|
||||
mLightDropVesselScale * field_0x6f8);
|
||||
#endif
|
||||
|
||||
if (g_drawHIO.mLightDrop.mDropGetScaleAnimFrameNum == mpLightDropParent->getAlphaTimer()) {
|
||||
dMeter2Info_setLightDropGetFlag(dComIfGp_getStartStageDarkArea(), 0xFF);
|
||||
@@ -2015,10 +2134,22 @@ void dMeter2Draw_c::drawRupee(s16 i_rupeeNum) {
|
||||
static_cast<J2DPicture*>(mpRupeeTexture[0][0]->getPanePtr())->changeTexture(timg, 0);
|
||||
static_cast<J2DPicture*>(mpRupeeTexture[0][1]->getPanePtr())->changeTexture(timg, 0);
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 rupeeKeyUserScale = dGetUserHudScale();
|
||||
const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale * field_0x718 * rupeeKeyUserScale;
|
||||
mpRupeeKeyParent->scale(rupeeKeyScale, rupeeKeyScale);
|
||||
|
||||
f32 rupeeKeyPosX = g_drawHIO.mRupeeKeyPosX;
|
||||
f32 rupeeKeyPosY = g_drawHIO.mRupeeKeyPosY;
|
||||
// Rupees/keys read better anchored to the bottom-right corner than the top-right.
|
||||
dAnchorHudScale(mpRupeeKeyParent, HudCorner::BottomRight, &rupeeKeyPosX, &rupeeKeyPosY);
|
||||
mpRupeeKeyParent->paneTrans(rupeeKeyPosX, rupeeKeyPosY);
|
||||
#else
|
||||
mpRupeeKeyParent->scale(g_drawHIO.mRupeeKeyScale * field_0x718,
|
||||
g_drawHIO.mRupeeKeyScale * field_0x718);
|
||||
|
||||
mpRupeeKeyParent->paneTrans(g_drawHIO.mRupeeKeyPosX, g_drawHIO.mRupeeKeyPosY);
|
||||
#endif
|
||||
|
||||
mpRupeeParent[0]->scale(g_drawHIO.mRupeeScale, g_drawHIO.mRupeeScale);
|
||||
mpRupeeParent[0]->paneTrans(g_drawHIO.mRupeePosX, g_drawHIO.mRupeePosY);
|
||||
@@ -2137,8 +2268,18 @@ void dMeter2Draw_c::drawKey(s16 i_keyNum) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 keyScale = g_drawHIO.mKeyScale * dGetUserHudScale();
|
||||
mpKeyParent->scale(keyScale, keyScale);
|
||||
|
||||
f32 keyPosX = g_drawHIO.mKeyPosX;
|
||||
f32 keyPosY = g_drawHIO.mKeyPosY;
|
||||
dAnchorHudScale(mpKeyParent, HudCorner::BottomRight, &keyPosX, &keyPosY);
|
||||
mpKeyParent->paneTrans(keyPosX, keyPosY);
|
||||
#else
|
||||
mpKeyParent->scale(g_drawHIO.mKeyScale, g_drawHIO.mKeyScale);
|
||||
mpKeyParent->paneTrans(g_drawHIO.mKeyPosX, g_drawHIO.mKeyPosY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaKeyChange(bool param_0) {
|
||||
@@ -2596,11 +2737,24 @@ f32 dMeter2Draw_c::getButtonCrossParentInitTransY() {
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::drawButtonCross(f32 i_posX, f32 i_posY) {
|
||||
#if TARGET_PC
|
||||
const f32 buttonCrossUserScale = dGetUserHudScale();
|
||||
const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale * buttonCrossUserScale;
|
||||
mpButtonCrossParent->scale(buttonCrossScale, buttonCrossScale);
|
||||
#else
|
||||
mpButtonCrossParent->scale(g_drawHIO.mButtonCrossScale, g_drawHIO.mButtonCrossScale);
|
||||
#endif
|
||||
mpTextI->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
|
||||
mpTextM->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
|
||||
|
||||
#if TARGET_PC
|
||||
f32 buttonCrossPosX = i_posX;
|
||||
f32 buttonCrossPosY = i_posY;
|
||||
dAnchorHudScale(mpButtonCrossParent, HudCorner::TopLeft, &buttonCrossPosX, &buttonCrossPosY);
|
||||
mpButtonCrossParent->paneTrans(buttonCrossPosX, buttonCrossPosY);
|
||||
#else
|
||||
mpButtonCrossParent->paneTrans(i_posX, i_posY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void dMeter2Draw_c::setAlphaButtonCrossAnimeMin() {
|
||||
@@ -3505,9 +3659,16 @@ void dMeter2Draw_c::drawKanteraMeter(u8 i_button, f32 i_alphaRate) {
|
||||
Vec vtx0 = pane->getPanePtr()->getGlbVtx(0);
|
||||
Vec vtx3 = pane->getPanePtr()->getGlbVtx(3);
|
||||
|
||||
#if TARGET_PC
|
||||
const f32 oilUserScale = dGetUserHudScale();
|
||||
mpKanteraMeter[i_button]->setPos(((vtx0.x + vtx3.x) * 0.5f) + 9.0f * oilUserScale + sp10[i_button],
|
||||
vtx3.y + sp8[i_button]);
|
||||
mpKanteraMeter[i_button]->setScale(0.6f * oilUserScale, 0.6f * oilUserScale);
|
||||
#else
|
||||
mpKanteraMeter[i_button]->setPos(((vtx0.x + vtx3.x) * 0.5f) + 9.0f + sp10[i_button],
|
||||
vtx3.y + sp8[i_button]);
|
||||
mpKanteraMeter[i_button]->setScale(0.6f, 0.6f);
|
||||
#endif
|
||||
mpKanteraMeter[i_button]->setNowGauge(dComIfGs_getMaxOil(), dComIfGs_getOil());
|
||||
mpKanteraMeter[i_button]->setAlphaRate(i_alphaRate);
|
||||
}
|
||||
|
||||
+14
-2
@@ -16,6 +16,10 @@
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "m_Do/m_Do_controller_pad.h"
|
||||
#include "d/d_camera.h"
|
||||
#if TARGET_PC
|
||||
#include "dusk/settings.h"
|
||||
#include <algorithm>
|
||||
#endif
|
||||
#include <cstring>
|
||||
|
||||
#if (PLATFORM_WII || PLATFORM_SHIELD)
|
||||
@@ -621,8 +625,16 @@ void dMeterMap_c::draw() {
|
||||
mMapJ2DPicture->setAlpha(alpha);
|
||||
|
||||
#if TARGET_PC
|
||||
mMapJ2DPicture->draw(mDoGph_gInf_c::ScaleHUDXLeft(drawPosX), drawPosY, sizeX, sizeY, false,
|
||||
false, false);
|
||||
// Scale the minimap with the user HUD scale and shift down so its bottom-left
|
||||
// corner stays anchored to the same screen position as at scale 1.0.
|
||||
const f32 userHudScale =
|
||||
std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f);
|
||||
const f32 scaledSizeX = sizeX * userHudScale;
|
||||
const f32 scaledSizeY = sizeY * userHudScale;
|
||||
const f32 mapBottomShift = sizeY - scaledSizeY;
|
||||
mMapJ2DPicture->draw(mDoGph_gInf_c::ScaleHUDXLeft(drawPosX),
|
||||
drawPosY + mapBottomShift, scaledSizeX, scaledSizeY,
|
||||
false, false, false);
|
||||
#else
|
||||
mMapJ2DPicture->draw(drawPosX, drawPosY, sizeX, sizeY, false, false, false);
|
||||
#endif
|
||||
|
||||
+72
-3
@@ -604,6 +604,70 @@ int dMsgObject_c::_delete() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
struct MirrorMsgOverride {
|
||||
u32 gcMsgId;
|
||||
u32 wiiMsgId;
|
||||
};
|
||||
|
||||
static const MirrorMsgOverride mirrorMsgOverrides[] = {
|
||||
{0x153a, 0x3c4a},
|
||||
{0x1553, 0x3c63},
|
||||
{0x1558, 0x3c68},
|
||||
{0x155c, 0x3c6c},
|
||||
{0x1569, 0x3c79},
|
||||
{0x156f, 0x3c7f},
|
||||
{0x1f81, 0x4691},
|
||||
{0x232a, 0x4a3a},
|
||||
{0x13f2, 0x3b02},
|
||||
{0x1416, 0x3b26},
|
||||
{0x1417, 0x3b27},
|
||||
{0x1419, 0x3b29},
|
||||
{0x1521, 0x3c31},
|
||||
{0x1614, 0x3d24},
|
||||
{0x1626, 0x3d36},
|
||||
{0x1628, 0x3d38},
|
||||
{0x16aa, 0x3dba},
|
||||
{0x16b8, 0x3dc8},
|
||||
{0x16b9, 0x3dc9},
|
||||
{0x1904, 0x4014},
|
||||
{0x1919, 0x4029},
|
||||
{0x19cd, 0x40dd},
|
||||
{0x19d3, 0x40e3},
|
||||
{0x19d6, 0x40e6},
|
||||
{0x19e6, 0x40f6},
|
||||
{0x19eb, 0x40fb},
|
||||
{0x14b6, 0x3bc6},
|
||||
{0x151a, 0x3c2a},
|
||||
{0x1530, 0x3c40},
|
||||
{0x1532, 0x3c42},
|
||||
{0x2726, 0x4e36},
|
||||
{0x2736, 0x4e46},
|
||||
{0x2739, 0x4e49},
|
||||
{0x274c, 0x4e5c},
|
||||
{0x24da, 0x4bea},
|
||||
{0x24db, 0x4beb},
|
||||
{0x13d8, 0x3ae8},
|
||||
{0x13dc, 0x3aec},
|
||||
{0x13eb, 0x3afb},
|
||||
{0x17df, 0x3eef},
|
||||
{0x17e2, 0x3ef2},
|
||||
{0x1dae, 0x44be},
|
||||
{0x14ca, 0x3bda},
|
||||
{0x470, 0x493},
|
||||
{0x473, 0x492},
|
||||
};
|
||||
|
||||
static u32 getMirrorMsgOverride(u32 msgId) {
|
||||
for (size_t i = 0; i < sizeof(mirrorMsgOverrides) / sizeof(mirrorMsgOverrides[0]); i++) {
|
||||
if (mirrorMsgOverrides[i].gcMsgId == msgId) {
|
||||
return mirrorMsgOverrides[i].wiiMsgId;
|
||||
}
|
||||
}
|
||||
return msgId;
|
||||
}
|
||||
#endif
|
||||
|
||||
void dMsgObject_c::setMessageIndex(u32 revoIndex, u32 param_2, bool param_3) {
|
||||
field_0x158 = revoIndex;
|
||||
revoIndex = getRevoMessageIndex(revoIndex);
|
||||
@@ -692,9 +756,14 @@ u32 dMsgObject_c::getMessageIndex(u32 param_0) {
|
||||
}
|
||||
|
||||
u32 dMsgObject_c::getRevoMessageIndex(u32 param_1) {
|
||||
if (!g_MsgObject_HIO_c.mMessageDisplay) {
|
||||
return param_1;
|
||||
}
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableMirrorMode) {
|
||||
if (!g_MsgObject_HIO_c.mMessageDisplay) { return param_1; } }
|
||||
if (param_1 == getMirrorMsgOverride(param_1)) { return param_1; }
|
||||
#else
|
||||
if (!g_MsgObject_HIO_c.mMessageDisplay) { return param_1; }
|
||||
#endif
|
||||
|
||||
u32 msgIndexCount;
|
||||
JMSMesgInfo_c* pMsg;
|
||||
int i = 0;
|
||||
|
||||
@@ -1359,6 +1359,7 @@ void dPa_control_c::calcMenu() {
|
||||
}
|
||||
|
||||
void dPa_control_c::draw(JPADrawInfo* param_0, u8 param_1) {
|
||||
ZoneScoped;
|
||||
if (mEmitterMng != NULL) {
|
||||
j3dSys.reinitGX();
|
||||
dKy_setLight_again();
|
||||
@@ -1957,6 +1958,7 @@ void dPa_gen_d_light8PcallBack::execute(JPABaseEmitter* i_emitter, JPABasePartic
|
||||
}
|
||||
|
||||
void dPa_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) {
|
||||
ZoneScoped;
|
||||
Mtx local_60;
|
||||
Mtx auStack_90;
|
||||
Mtx auStack_c0;
|
||||
@@ -2084,6 +2086,7 @@ void dPa_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2
|
||||
}
|
||||
|
||||
void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) {
|
||||
ZoneScoped;
|
||||
Mtx local_80;
|
||||
JGeometry::TVec3<f32> local_8c;
|
||||
JGeometry::TVec3<f32> aTStack_98;
|
||||
@@ -2172,6 +2175,7 @@ void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* p
|
||||
}
|
||||
|
||||
void dPa_gen_d_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) {
|
||||
ZoneScoped;
|
||||
Mtx local_60;
|
||||
Mtx auStack_90;
|
||||
Mtx auStack_c0;
|
||||
|
||||
Reference in New Issue
Block a user