mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-11 20:48:21 -04:00
fix los wolfos
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/tphd/LosTable.hpp"
|
||||
#include "dusk/tphd/TphdPack.hpp"
|
||||
|
||||
enum E_ww_RES_File_ID {
|
||||
/* BCK */
|
||||
/* 0x04 */ BCK_WW_APPEAR = 0x4,
|
||||
@@ -466,7 +469,7 @@ f32 daE_WW_c::checkCreateBg(cXyz i_vector) {
|
||||
return -G_CM3D_F_INF;
|
||||
}
|
||||
|
||||
if (dComIfG_Bgsp().GetSpecialCode(gnd_chk) == 5 || dComIfG_Bgsp().GetPolyAtt0(gnd_chk) == 0xD) {
|
||||
if (dComIfG_Bgsp().GetSpecialCode(gnd_chk) == 5 || dComIfG_Bgsp().GetPolyAtt0(gnd_chk) == 0xD IF_DUSK(|| dusk::tphd::is_los_active())) {
|
||||
cXyz temp_r1 = daPy_getPlayerActorClass()->current.pos;
|
||||
temp_r1.y += 100.0f;
|
||||
sp14 = i_vector;
|
||||
@@ -666,8 +669,14 @@ void daE_WW_c::executeMaster() {
|
||||
sp30.set(0.0f, 0.0f, 3000.0f);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::tphd::is_los_active()) {
|
||||
sp30.z = 600.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
cLib_offsetPos(&sp3C, &sp48, fopCamM_GetAngleY(camera), &sp30);
|
||||
if (current.pos.abs(sp3C) < field_0x6a8) {
|
||||
if ((current.pos.abs(sp3C) < field_0x6a8) IF_DUSK(|| (dusk::tphd::is_los_active() && current.pos.y - sp48.y < field_0x6a8))) {
|
||||
f32 temp_f31 = checkCreateBg(sp3C);
|
||||
if (-G_CM3D_F_INF != temp_f31) {
|
||||
sp3C.y = temp_f31;
|
||||
|
||||
+3
-10
@@ -2096,13 +2096,6 @@ static int dStage_doorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum,
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
// D_SB11 (Cave of Shadows, HD): true when the los table is loaded and we are in D_SB11.
|
||||
// Mirrors HD's `g_dComIfG_gameInfo.field4_0x1e448 != 0` gate (set once in phase_1 for D_SB11).
|
||||
static bool isLOSStage() {
|
||||
return dusk::tphd::los_loaded() &&
|
||||
std::strcmp(dComIfGp_getStartStageName(), "D_SB11") == 0;
|
||||
}
|
||||
|
||||
// Mirrors HD FUN_02ab7e94 (los override): the file RTBL is a linear placeholder chain
|
||||
// (r19 -> [19,18,20]); rewrite each room's m_rooms in place from los.bin floor links.
|
||||
// next gets NO 0x80 (floor not yet unlocked) so it is not bg-loaded at stage-create;
|
||||
@@ -2154,7 +2147,7 @@ static void dStage_LOSRoomReadOverride(roomRead_class* p_node) {
|
||||
// No-op outside los stages. This replaces the earlier per-frame RoomCheck reveal (which churned
|
||||
// room loads). HD reveals the next floor at the moment you open the descent gate, not per-frame.
|
||||
void dStage_showLOSNextFloor(int fromRoom) {
|
||||
if (!isLOSStage()) {
|
||||
if (!dusk::tphd::is_los_active()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2201,7 +2194,7 @@ static int dStage_roomReadInit(dStage_dt_c* i_stage, void* i_data, int param_2,
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::tphd_active() && isLOSStage()) {
|
||||
if (dusk::tphd_active() && dusk::tphd::is_los_active()) {
|
||||
dStage_LOSRoomReadOverride(p_node);
|
||||
}
|
||||
#endif
|
||||
@@ -2397,7 +2390,7 @@ static int dStage_mecoInfoInit(dStage_dt_c* i_stage, void* i_data, int param_2,
|
||||
#if TARGET_PC
|
||||
// los stages (D_SB11): the file MEC0 (roomNo%3) collides for los-adjacent floors;
|
||||
// HD re-derives the block from the los floor index instead (FUN_02ab8910).
|
||||
if (dusk::tphd_active() && isLOSStage()) {
|
||||
if (dusk::tphd_active() && dusk::tphd::is_los_active()) {
|
||||
entry_p->m_blockID = (u8)(dusk::tphd::los_floor_index(entry_p->m_roomNo) % 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -116,4 +116,12 @@ int los_floor_index(int roomNo) {
|
||||
return s32(u32(entries()[roomNo].id3));
|
||||
}
|
||||
|
||||
// D_SB11 (Cave of Shadows, HD): true when the los table is loaded and we are in D_SB11.
|
||||
// Mirrors HD's `g_dComIfG_gameInfo.field4_0x1e448 != 0` gate (set once in phase_1 for D_SB11).
|
||||
bool is_los_active() {
|
||||
return tphd_active() &&
|
||||
los_loaded() &&
|
||||
std::strcmp(dComIfGp_getStartStageName(), "D_SB11") == 0;
|
||||
}
|
||||
|
||||
} // namespace dusk::tphd
|
||||
|
||||
@@ -24,6 +24,8 @@ int los_prev_floor(int roomNo);
|
||||
|
||||
int los_floor_index(int roomNo);
|
||||
|
||||
bool is_los_active();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user