mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-18 04:48:21 -04:00
Take item scales from TP HD, fix file select. Skip main2d.arc and Field0.arc from HD for now to get full map and GC buttons at the the upper right working
This commit is contained in:
@@ -58,7 +58,11 @@ struct dItem_data {
|
||||
|
||||
static s16 getTexture(u8 index) { return item_resource[index].mTexture; }
|
||||
|
||||
static u8 getTexScale (u8 index) { return item_resource[index].mTexScale; }
|
||||
#if TARGET_PC
|
||||
static u8 getTexScale(u8 index);
|
||||
#else
|
||||
static u8 getTexScale(u8 index) { return item_resource[index].mTexScale; }
|
||||
#endif
|
||||
|
||||
static const char* getFieldArc(u8 index) { return field_item_res[index].mFieldArc; }
|
||||
|
||||
|
||||
+26
-1
@@ -24,6 +24,10 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "dusk/version.hpp"
|
||||
#if DUSK_TPHD
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/tphd/HdAssetLayer.hpp"
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/menu_pointer.h"
|
||||
@@ -5904,7 +5908,14 @@ void dFile_select3D_c::_move() {
|
||||
|
||||
cXyz stack_20;
|
||||
Vec stack_8 = mPaneMgr->getGlobalVtxCenter(false, 0);
|
||||
toItem3Dpos(oREG_F(0) + (stack_8.x + field_0x03b8.x), oREG_F(1) + (stack_8.y + field_0x03b8.y), oREG_F(2) + 720.0f, &stack_20);
|
||||
f32 itemY = stack_8.y + field_0x03b8.y;
|
||||
#if DUSK_TPHD
|
||||
if (dusk::tphd_active()) {
|
||||
itemY += 87.0f;
|
||||
}
|
||||
#endif
|
||||
toItem3Dpos(oREG_F(0) + (stack_8.x + field_0x03b8.x), oREG_F(1) + itemY,
|
||||
oREG_F(2) + 720.0f, &stack_20);
|
||||
field_0x03a4.set(stack_20);
|
||||
field_0x03b0.set(0, 0, 0);
|
||||
animePlay();
|
||||
@@ -5951,6 +5962,10 @@ void dFile_select3D_c::setJ3D(char const* param_0, char const* param_1, char con
|
||||
JUT_ASSERT(5285, bmdRes != NULL);
|
||||
|
||||
void* bmdWork = make_work_copy(bmdRes);
|
||||
#if DUSK_TPHD
|
||||
dusk::tphd::register_copied_hd_resource(
|
||||
archive->mEntryNum, param_0, bmdWork, archive->getResSize(bmdRes));
|
||||
#endif
|
||||
modelData = J3DModelLoaderDataBase::load(bmdWork, 0x51020010);
|
||||
JUT_ASSERT(5290, modelData != NULL);
|
||||
|
||||
@@ -6059,6 +6074,11 @@ void dFile_select3D_c::createMaskModel() {
|
||||
field_0x03b8.x = m_kamen_offset_x[mMaskIdx];
|
||||
field_0x03b8.y = m_kamen_offset_y[mMaskIdx];
|
||||
field_0x03b8.z = m_kamen_scale[mMaskIdx];
|
||||
#if DUSK_TPHD
|
||||
if (dusk::tphd_active() && mMaskIdx != 0) {
|
||||
field_0x03b8.x = -25.0f;
|
||||
}
|
||||
#endif
|
||||
field_0x03a4.set(0.0f, 0.0f, 0.0f);
|
||||
field_0x03b0.set(0, 0, 0);
|
||||
mpModel = NULL;
|
||||
@@ -6102,6 +6122,11 @@ void dFile_select3D_c::createMirrorModel() {
|
||||
field_0x03b8.x = m_mirror_offset_x[mMirrorIdx];
|
||||
field_0x03b8.y = m_mirror_offset_y[mMirrorIdx];
|
||||
field_0x03b8.z = m_mirror_scale[mMirrorIdx];
|
||||
#if DUSK_TPHD
|
||||
if (dusk::tphd_active() && mMirrorIdx != 0) {
|
||||
field_0x03b8.x = -25.0f;
|
||||
}
|
||||
#endif
|
||||
field_0x03a4.set(0.0f, 0.0f, 0.0f);
|
||||
field_0x03b0.set(0, 0, 0);
|
||||
mpModel = NULL;
|
||||
|
||||
@@ -2,6 +2,45 @@
|
||||
|
||||
#include "d/d_item_data.h"
|
||||
|
||||
#if TARGET_PC && DUSK_TPHD
|
||||
#include "dusk/settings.h"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr u8 kTphdItemTexScale[] = {
|
||||
0x2C, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x2C, 0x2C, 0x26, 0x26, 0x26, 0x26, 0x2C, 0x2C,
|
||||
0x2C, 0x2C, 0x26, 0x64, 0x64, 0x64, 0x26, 0x26, 0x26, 0x26, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C,
|
||||
0x26, 0x1F, 0x1F, 0x25, 0x26, 0x1F, 0x26, 0x1F, 0x29, 0x29, 0x29, 0x29, 0x26, 0x3E, 0x20, 0x20,
|
||||
0x20, 0x26, 0x2C, 0x1F, 0x26, 0x26, 0x26, 0x1F, 0x1F, 0x1F, 0x1F, 0x64, 0x64, 0x1F, 0x26, 0x29,
|
||||
0x29, 0x1E, 0x35, 0x26, 0x26, 0x26, 0x22, 0x2D, 0x2B, 0x29, 0x28, 0x29, 0x22, 0x64, 0x64, 0x1F,
|
||||
0x1F, 0x1F, 0x64, 0x2C, 0x26, 0x26, 0x26, 0x64, 0x28, 0x26, 0x26, 0x28, 0x28, 0x28, 0x28, 0x28,
|
||||
0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x2B, 0x2B,
|
||||
0x26, 0x26, 0x2C, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
|
||||
0x26, 0x26, 0x32, 0x32, 0x32, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
|
||||
0x3E, 0x3E, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x32, 0x32, 0x32, 0x2B, 0x19, 0x19, 0x19,
|
||||
0x2C, 0x26, 0x26, 0x26, 0x26, 0x2C, 0x2C, 0x2C, 0x32, 0x32, 0x32, 0x32, 0x28, 0x1E, 0x1E, 0x1E,
|
||||
0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x1E, 0x28, 0x2D, 0x2D, 0x2D, 0x2D, 0x21, 0x28, 0x3C, 0x3C,
|
||||
0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50,
|
||||
0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x3C, 0x23, 0x26, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C,
|
||||
0x26, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x26, 0x26, 0x26, 0x26, 0x1F, 0x1B, 0x26, 0x19,
|
||||
0x19, 0x19, 0x19, 0x26, 0x26, 0x26, 0x26, 0x26, 0x2B, 0x35, 0x35, 0x35, 0x26, 0x2C, 0x26,
|
||||
};
|
||||
static_assert(sizeof(kTphdItemTexScale) == 0xFF);
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
u8 dItem_data::getTexScale(u8 index) {
|
||||
#if TARGET_PC && DUSK_TPHD
|
||||
if (dusk::tphd_active() && index < sizeof(kTphdItemTexScale)) {
|
||||
return kTphdItemTexScale[index];
|
||||
}
|
||||
#endif
|
||||
return item_resource[index].mTexScale;
|
||||
}
|
||||
#endif
|
||||
|
||||
DUSK_GAME_DATA dItem_itemResource dItem_data::item_resource[] = {
|
||||
{"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000},
|
||||
{"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x3C, 0x0000},
|
||||
|
||||
@@ -707,14 +707,10 @@ void register_hd_textures_for_arc(std::span<u8> arcBytes, const std::vector<ArcF
|
||||
|
||||
// HD arcs whose Wii-U layouts don't match the GC UI pipeline.
|
||||
constexpr std::string_view kHdSkipList[] = {
|
||||
"res/Object/fileSel.arc",
|
||||
"res/Layout/main2D.arc",
|
||||
"res/FieldMap/Field0.arc",
|
||||
};
|
||||
|
||||
bool is_layout_arc_path(std::string_view resPath) {
|
||||
return resPath.starts_with("res/Layout/") ||
|
||||
resPath.starts_with("res/LayoutRevo/");
|
||||
}
|
||||
|
||||
std::filesystem::path hd_pack_path_for_arc(std::string_view resPath) {
|
||||
std::filesystem::path packPath = g_contentPath / std::string(resPath);
|
||||
packPath.replace_extension(".pack.gz");
|
||||
@@ -738,26 +734,7 @@ std::filesystem::path hd_pack_path_for_arc(std::string_view resPath) {
|
||||
return packPath;
|
||||
}
|
||||
|
||||
// Layout arcs to mount from HD content instead of the ISO.
|
||||
constexpr std::string_view kHdLayoutMountList[] = {
|
||||
"res/Layout/clctres.arc",
|
||||
"res/Layout/fishres.arc",
|
||||
"res/Layout/insectRes.arc",
|
||||
"res/Layout/letres.arc",
|
||||
"res/Layout/ringres.arc",
|
||||
"res/Layout/skillres.arc",
|
||||
};
|
||||
|
||||
bool should_skip_hd_arc_mount(std::string_view resPath) {
|
||||
return false;
|
||||
|
||||
// Layout arcs mount only via kHdLayoutMountList.
|
||||
if (is_layout_arc_path(resPath)) {
|
||||
for (auto mount : kHdLayoutMountList) {
|
||||
if (resPath == mount) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
for (auto skip : kHdSkipList) {
|
||||
if (resPath == skip) return true;
|
||||
}
|
||||
@@ -765,7 +742,7 @@ bool should_skip_hd_arc_mount(std::string_view resPath) {
|
||||
}
|
||||
|
||||
bool should_register_hd_pack_for_vanilla_arc(std::string_view resPath) {
|
||||
return resPath.starts_with("res/Layout/");
|
||||
return resPath.starts_with("res/Layout/") || resPath == "res/FieldMap/Field0.arc";
|
||||
}
|
||||
|
||||
std::filesystem::path fallback_path_for_arc(std::string_view resPath,
|
||||
|
||||
Reference in New Issue
Block a user