Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions include/d/d_drawlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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
};

Expand Down
27 changes: 23 additions & 4 deletions src/d/d_drawlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<u16>(192 * mTexResScale),
static_cast<u16>(64 * mTexResScale)
static_cast<u16>(192 * mTexResScale),
static_cast<u16>(192 * mTexResScale),
static_cast<u16>(64 * mTexResScale),
static_cast<u16>(64 * mTexResScale),
Comment thread
RgeditV1 marked this conversation as resolved.
};
#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
Expand All @@ -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++;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
Loading