mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fea4f02ed | |||
| 35ea13c53a | |||
| 5fab665f21 | |||
| 109f0a50e5 | |||
| 746910c59f | |||
| ae4806ae4f | |||
| 1c00e2cdde | |||
| 78301a8a83 | |||
| ca798049b3 | |||
| daf4b1dfeb | |||
| 5bdd31a5af | |||
| 3cb5e5172b | |||
| 1e6e1976e3 |
Vendored
+1
-1
Submodule extern/aurora updated: 524b683fe0...9ff83bcb97
@@ -127,6 +127,7 @@ struct UserSettings {
|
||||
ConfigVar<bool> wasPresetChosen;
|
||||
ConfigVar<bool> enableCrashReporting;
|
||||
ConfigVar<bool> duskMenuOpen;
|
||||
ConfigVar<int> cardFileType;
|
||||
} backend;
|
||||
};
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
|
||||
#if TARGET_PC
|
||||
case Z2WOLFHOWL_TIMESONG:
|
||||
cPitchUp = 1.3348f;
|
||||
cPitchCenter = 1.0f;
|
||||
cPitchCenter = 0.8909f;
|
||||
cPitchDown = 0.7937f;
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -149,6 +149,23 @@ void daAlink_c::changeWolf() {
|
||||
|
||||
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 14)), 0x20200);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Wolf Link's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpLinkModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpLinkModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != NULL && strcmp(tex_name, "wl_eyeball") == 0) {
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
J3DModelData* chainModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 15));
|
||||
for (u16 i = 0; i < 4; i++) {
|
||||
mpWlChainModels[i] = initModel(chainModelData, 0);
|
||||
@@ -162,6 +179,23 @@ void daAlink_c::changeWolf() {
|
||||
mpWlMidnaHairModel =
|
||||
initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 11)), 0x1000000);
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Midna's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpWlMidnaModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpWlMidnaModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != NULL && strcmp(tex_name, "midona_eyeball") == 0) {
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mpDMidnaBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 18));
|
||||
mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData());
|
||||
mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk);
|
||||
@@ -342,6 +376,26 @@ void daAlink_c::changeLink(int param_0) {
|
||||
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "zl_face.bmd")), 0x20200);
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
// Update Adult Link's eye maxLOD to prevent the eyes from disappearing
|
||||
{
|
||||
J3DTexture* tex = mpLinkFaceModel->getModelData()->getTexture();
|
||||
JUTNameTab* nametable = mpLinkFaceModel->getModelData()->getTextureName();
|
||||
if (tex != nullptr && nametable != nullptr) {
|
||||
for (u16 i = 0; i < tex->getNum(); i++) {
|
||||
const char* tex_name = nametable->getName(i);
|
||||
if (tex_name != nullptr &&
|
||||
(strcmp(tex_name, "al_eyeball") == 0 || strcmp(tex_name, "highlight02") == 0 ||
|
||||
strcmp(tex_name, "eye_kage01") == 0))
|
||||
{
|
||||
ResTIMG* timg = tex->getResTIMG(i);
|
||||
timg->maxLOD = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"));
|
||||
u16 i;
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
@@ -2855,7 +2855,7 @@ void* daMP_Reader(void*) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static u8 daMP_ReadThreadStack[0x2000];
|
||||
static u8 daMP_ReadThreadStack[DUSK_IF_ELSE(8, 0x2000)];
|
||||
|
||||
#if TARGET_PC
|
||||
static BOOL VideoThreadCancelled;
|
||||
@@ -2880,7 +2880,7 @@ static BOOL daMP_CreateReadThread(s32 param_0) {
|
||||
|
||||
static OSThread daMP_VideoDecodeThread;
|
||||
|
||||
static u8 daMP_VideoDecodeThreadStack[0x64000];
|
||||
static u8 daMP_VideoDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
|
||||
|
||||
static OSMessageQueue daMP_FreeTextureSetQueue;
|
||||
|
||||
@@ -3132,7 +3132,7 @@ static BOOL AudioThreadCancelled;
|
||||
|
||||
static OSThread daMP_AudioDecodeThread;
|
||||
|
||||
static u8 daMP_AudioDecodeThreadStack[0x64000];
|
||||
static u8 daMP_AudioDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
|
||||
|
||||
static OSMessageQueue daMP_FreeAudioBufferQueue;
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
|
||||
cM3dGPla plane;
|
||||
|
||||
@@ -31,6 +35,27 @@ static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
static void d_a_obj_item_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
daItem_c* item = static_cast<daItem_c*>(pUserWork);
|
||||
if (item == NULL || item->mpModel == NULL || !item->chkDraw()) {
|
||||
return;
|
||||
}
|
||||
item->setTevStr();
|
||||
if (item->mpBrkAnm != NULL) {
|
||||
s8 tevFrm = item->getTevFrm();
|
||||
if (tevFrm != -1) {
|
||||
item->mpBrkAnm->entry(item->mpModel->getModelData(), tevFrm);
|
||||
} else {
|
||||
item->mpBrkAnm->entry(item->mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
if (item->chkFlag(4)) {
|
||||
fopAcM_setEffectMtx(item, item->mpModel->getModelData());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const daItemBase_data& daItemBase_c::getData() {
|
||||
return m_data;
|
||||
}
|
||||
@@ -353,6 +378,10 @@ int daItem_c::_daItem_draw() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::add_interpolation_callback(&d_a_obj_item_interp_callback, this);
|
||||
#endif
|
||||
|
||||
if (chkDraw()) {
|
||||
return DrawBase();
|
||||
}
|
||||
|
||||
@@ -292,12 +292,20 @@ void interp_view(::view_class* view) {
|
||||
return;
|
||||
|
||||
const f32 step = get_interpolation_step();
|
||||
const bool is_cam_curr_authoritative = g_is_sim_frame && step <= 0.0f;
|
||||
|
||||
cXyz eye;
|
||||
cXyz center;
|
||||
cXyz up;
|
||||
lerp_xyz(&eye, s_cam_prev.eye, s_cam_curr.eye, step);
|
||||
lerp_xyz(¢er, s_cam_prev.center, s_cam_curr.center, step);
|
||||
lerp_xyz(&up, s_cam_prev.up, s_cam_curr.up, step);
|
||||
if (is_cam_curr_authoritative) {
|
||||
eye = s_cam_curr.eye;
|
||||
center = s_cam_curr.center;
|
||||
up = s_cam_curr.up;
|
||||
} else {
|
||||
lerp_xyz(&eye, s_cam_prev.eye, s_cam_curr.eye, step);
|
||||
lerp_xyz(¢er, s_cam_prev.center, s_cam_curr.center, step);
|
||||
lerp_xyz(&up, s_cam_prev.up, s_cam_curr.up, step);
|
||||
}
|
||||
if (!up.normalizeRS()) {
|
||||
up = s_cam_curr.up;
|
||||
up.normalizeRS();
|
||||
@@ -306,19 +314,25 @@ void interp_view(::view_class* view) {
|
||||
view->lookat.eye = eye;
|
||||
view->lookat.center = center;
|
||||
view->lookat.up = up;
|
||||
view->bank = lerp_bank(s_cam_prev.bank, s_cam_curr.bank, step);
|
||||
view->fovy = s_cam_prev.fovy + (s_cam_curr.fovy - s_cam_prev.fovy) * step;
|
||||
view->aspect = s_cam_prev.aspect + (s_cam_curr.aspect - s_cam_prev.aspect) * step;
|
||||
view->near_ = s_cam_prev.near_ + (s_cam_curr.near_ - s_cam_prev.near_) * step;
|
||||
view->far_ = s_cam_prev.far_ + (s_cam_curr.far_ - s_cam_prev.far_) * step;
|
||||
if (is_cam_curr_authoritative) {
|
||||
view->bank = s_cam_curr.bank;
|
||||
view->fovy = s_cam_curr.fovy;
|
||||
view->aspect = s_cam_curr.aspect;
|
||||
view->near_ = s_cam_curr.near_;
|
||||
view->far_ = s_cam_curr.far_;
|
||||
} else {
|
||||
view->bank = lerp_bank(s_cam_prev.bank, s_cam_curr.bank, step);
|
||||
view->fovy = s_cam_prev.fovy + (s_cam_curr.fovy - s_cam_prev.fovy) * step;
|
||||
view->aspect = s_cam_prev.aspect + (s_cam_curr.aspect - s_cam_prev.aspect) * step;
|
||||
view->near_ = s_cam_prev.near_ + (s_cam_curr.near_ - s_cam_prev.near_) * step;
|
||||
view->far_ = s_cam_prev.far_ + (s_cam_curr.far_ - s_cam_prev.far_) * step;
|
||||
}
|
||||
|
||||
// FRAME INTERP TODO: It might be better if I rewired the game to not clear this flag until the
|
||||
// next sim frame, but I don't care enough to right now
|
||||
#if WIDESCREEN_SUPPORT
|
||||
if (mDoGph_gInf_c::isWide() && !mDoGph_gInf_c::isWideZoom() && step >= 0.5f ?
|
||||
s_cam_curr.wideZoom :
|
||||
s_cam_prev.wideZoom)
|
||||
{
|
||||
const f32 wide_step = is_cam_curr_authoritative ? 1.0f : step;
|
||||
if (mDoGph_gInf_c::isWide() && !mDoGph_gInf_c::isWideZoom() && wide_step >= 0.5f ? s_cam_curr.wideZoom : s_cam_prev.wideZoom) {
|
||||
mDoGph_gInf_c::onWideZoom();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,17 @@ static std::string ShowIsoInvalidError(const iso::ValidationError code) {
|
||||
}
|
||||
}
|
||||
|
||||
static std::string_view card_type_name(CARDFileType type) {
|
||||
switch (type) {
|
||||
case CARD_GCIFOLDER:
|
||||
return "GCI Folder"sv;
|
||||
case CARD_RAWIMAGE:
|
||||
return "Card Image"sv;
|
||||
default:
|
||||
return ""sv;
|
||||
}
|
||||
}
|
||||
|
||||
void fileDialogCallback(void* userdata, const char* path, const char* error) {
|
||||
auto* self = static_cast<ImGuiPreLaunchWindow*>(userdata);
|
||||
if (error != nullptr) {
|
||||
@@ -216,6 +227,23 @@ void ImGuiPreLaunchWindow::drawOptions() {
|
||||
if (configuredBackendId != m_initialGraphicsBackend) {
|
||||
ImGui::TextDisabled("Restart Required");
|
||||
}
|
||||
auto curFileType = (CARDFileType)getSettings().backend.cardFileType.getValue();
|
||||
|
||||
if (ImGui::BeginCombo("Save File Type", card_type_name(curFileType).data())) {
|
||||
|
||||
if (ImGui::Selectable("GCI Folder", curFileType == CARD_GCIFOLDER)) {
|
||||
getSettings().backend.cardFileType.setValue(CARD_GCIFOLDER);
|
||||
config::Save();
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Card Image", curFileType == CARD_RAWIMAGE)) {
|
||||
getSettings().backend.cardFileType.setValue(CARD_RAWIMAGE);
|
||||
config::Save();
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
|
||||
@@ -1491,11 +1491,11 @@ namespace dusk {
|
||||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(e.flagName.c_str());
|
||||
ImGuiStringViewText(e.flagName);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(e.location.c_str());
|
||||
ImGuiStringViewText(e.location);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(e.description.c_str());
|
||||
ImGuiStringViewText(e.description);
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ UserSettings g_userSettings = {
|
||||
.showPipelineCompilation {"backend.showPipelineCompilation", false},
|
||||
.wasPresetChosen {"backend.wasPresetChosen", false},
|
||||
.enableCrashReporting {"backend.enableCrashReporting", true},
|
||||
.duskMenuOpen {"backend.duskMenuOpen", false}
|
||||
.duskMenuOpen {"backend.duskMenuOpen", false},
|
||||
.cardFileType {"backend.cardFileType", static_cast<int>(CARD_GCIFOLDER)}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -185,6 +186,7 @@ void registerSettings() {
|
||||
Register(g_userSettings.backend.wasPresetChosen);
|
||||
Register(g_userSettings.backend.enableCrashReporting);
|
||||
Register(g_userSettings.backend.duskMenuOpen);
|
||||
Register(g_userSettings.backend.cardFileType);
|
||||
}
|
||||
|
||||
// Transient settings
|
||||
|
||||
@@ -77,6 +77,8 @@ static OSThread MemCardThread;
|
||||
|
||||
void mDoMemCd_Ctrl_c::ThdInit() {
|
||||
#if !PLATFORM_SHIELD
|
||||
CARDSetLoadType((CARDFileType)dusk::getSettings().backend.cardFileType.getValue());
|
||||
|
||||
CARDInit(DUSK_GAME_NAME, DUSK_GAME_VERSION);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1029,15 +1029,8 @@ static void drawDepth2(view_class* param_0, view_port_class* param_1, int param_
|
||||
GX_FALSE, 0);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
// use full size for pc for higher quality background elements
|
||||
u16 halfWidth = width;
|
||||
u16 halfHeight = height;
|
||||
#else
|
||||
u16 halfWidth = width >> 1;
|
||||
u16 halfHeight = height >> 1;
|
||||
#endif
|
||||
|
||||
GXRenderModeObj* sp24 = JUTGetVideoManager()->getRenderMode();
|
||||
GXSetCopyFilter(GX_FALSE, NULL, GX_TRUE, sp24->vfilter);
|
||||
GXSetTexCopySrc(x_orig, y_orig_pos, width, height);
|
||||
|
||||
Reference in New Issue
Block a user