From cc1e055c99bfe7ec5ef95a3ce4894191e7ca080d Mon Sep 17 00:00:00 2001 From: Rgeditv1 Date: Thu, 1 Oct 2026 16:29:45 -0400 Subject: [PATCH] increase shadow draw --- include/d/d_drawlist.h | 13 +++++++++++-- src/d/d_drawlist.cpp | 27 +++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 4baf6ed324..ce03326e65 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -287,6 +287,11 @@ class dDlst_shadowReal_c { /* 0x2550 */ dDlst_shadowReal_c* mZsortNext; }; // Size: 0x2554 +#if TARGET_PC +static const int REAL_SHADOW_MAX = 16; +static const int REAL_SHADOW_TEX_NUM = REAL_SHADOW_MAX / 4; +#endif + class dDlst_shadowControl_c { public: dDlst_shadowControl_c() { field_0x0 = 0; } @@ -310,11 +315,15 @@ class dDlst_shadowControl_c { /* 0x00008 */ dDlst_shadowReal_c* field_0x8; /* 0x0000C */ dDlst_shadowSimple_c mSimple[128]; /* 0x0340C */ int mNextID; + #if TARGET_PC + /* 0x03410 */ dDlst_shadowReal_c mReal[REAL_SHADOW_MAX]; + /* 0x15EB0 */ TGXTexObj mShadowTexObj[REAL_SHADOW_MAX]; + /* 0x15EF0 */ void* mShadowTexData[REAL_SHADOW_TEX_NUM]; + int mTexResScale; + #else /* 0x03410 */ dDlst_shadowReal_c mReal[8]; /* 0x15EB0 */ TGXTexObj mShadowTexObj[2]; /* 0x15EF0 */ void* mShadowTexData[2]; - #if TARGET_PC - int mTexResScale; #endif }; diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index d50c0500f3..ee6f0fec07 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -1497,18 +1497,26 @@ void dDlst_shadowControl_c::init() { #if TARGET_PC mTexResScale = dusk::getSettings().game.shadowResolutionMultiplier; // Increase shadow map resolution - u16 l_realImageSize[2] = + u16 l_realImageSize[REAL_SHADOW_TEX_NUM] = { - static_cast(192 * mTexResScale), - static_cast(64 * mTexResScale) + static_cast(192 * mTexResScale), + static_cast(192 * mTexResScale), + static_cast(64 * mTexResScale), + static_cast(64 * mTexResScale), }; #else static u16 l_realImageSize[2] = {192, 64}; #endif +#ifdef TARGET_PC + for (int i = 0; i < REAL_SHADOW_TEX_NUM; i++) { +#else for (int i = 0; i < 2; i++) { + +#endif u16 size = l_realImageSize[i]; + #ifdef TARGET_PC u32 buffer_size = 0x20; // No need to allocate memory for texture #else @@ -1528,8 +1536,11 @@ void dDlst_shadowControl_c::init() { void dDlst_shadowControl_c::reset() { dDlst_shadowReal_c* shadowReal = mReal; - +#ifdef TARGET_PC + for (int i = 0; i < REAL_SHADOW_MAX; i++) { +#else for (int i = 0; i < 8; i++) { +#endif shadowReal->reset(); shadowReal++; } @@ -1746,7 +1757,11 @@ int dDlst_shadowControl_c::setReal(u32 param_1, s8 param_2, J3DModel* param_3, c } } dDlst_shadowReal_c* pdVar12; +#if TARGET_PC + if (mRealNum >= REAL_SHADOW_MAX) { +#else if (mRealNum >= 8) { +#endif if (pdVar10 == NULL) { return 0; } @@ -1761,7 +1776,11 @@ int dDlst_shadowControl_c::setReal(u32 param_1, s8 param_2, J3DModel* param_3, c mRealNum--; } else { pdVar12 = mReal; +#ifdef TARGET_PC + for (int i = 0; i < REAL_SHADOW_MAX; i++, pdVar12++) { +#else for (int i = 0; i < 8; i++, pdVar12++) { +#endif if (pdVar12->isNoUse()) { break; }