mirror of
https://github.com/zeldaret/ss
synced 2026-06-15 14:21:31 -04:00
lyt_common match
This commit is contained in:
@@ -0,0 +1,197 @@
|
||||
#include "nw4r/lyt/lyt_arcResourceAccessor.h"
|
||||
#include "nw4r/ut/ut_Font.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// FindNameResource__37@unnamed@lyt_arcResourceAccessor_cpp@FP9ARCHandlePCc
|
||||
s32 FindResourcename(ARCHandle *pArcHandle, const char *resName) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// GetResourceSub__37@unnamed@lyt_arcResourceAccessor_cpp@FP9ARCHandlePCcUlPCcPUl
|
||||
void *GetResourceSub(ARCHandle *pArcHandle, const char *resRootDir, u32 resType, const char *name, u32 *pSize) {}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
// __ct__Q34nw4r3lyt11FontRefLinkFv
|
||||
FontRefLink::FontRefLink() {}
|
||||
|
||||
// Set__Q34nw4r3lyt11FontRefLinkFPCcPQ34nw4r2ut4Font
|
||||
void FontRefLink::Set(const char *name, ut::Font *pFont) {}
|
||||
|
||||
// __ct__Q34nw4r3lyt19ArcResourceAccessorFv
|
||||
ArcResourceAccessor::ArcResourceAccessor() {}
|
||||
|
||||
// Attach__Q34nw4r3lyt19ArcResourceAccessorFPvPCc
|
||||
bool ArcResourceAccessor::Attach(void *archiveStart, const char *resourceRootDirectory) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detach__Q34nw4r3lyt19ArcResourceAccessorFv
|
||||
|
||||
// GetResource__Q34nw4r3lyt19ArcResourceAccessorFUlPCcPUl
|
||||
|
||||
// RegistFont__Q34nw4r3lyt19ArcResourceAccessorFPQ34nw4r3lyt11FontRefLink
|
||||
|
||||
// UnregistFont__Q34nw4r3lyt19ArcResourceAccessorFPQ34nw4r3lyt11FontRefLink
|
||||
|
||||
// GetFont__Q34nw4r3lyt19ArcResourceAccessorFPCc
|
||||
|
||||
// __dt__Q34nw4r3lyt24MultiArcResourceAccessorFv
|
||||
|
||||
} // namespace lyt
|
||||
} // namespace nw4r
|
||||
|
||||
// 29c03b: <88> TAG_global_subroutine
|
||||
// AT_sibling(0x29c0dc)
|
||||
// AT_name("Detach")
|
||||
// AT_lo_user("Detach__Q34nw4r3lyt19ArcResourceAccessorFv")
|
||||
// AT_member(0x16271)
|
||||
// AT_fund_type(FT_pointer)
|
||||
// AT_low_pc(0x802d50c8)
|
||||
// AT_high_pc(0x802d5158)
|
||||
|
||||
// 29c093: <38> TAG_formal_parameter
|
||||
// AT_sibling(0x29c0b9)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x16271)
|
||||
// AT_location(<5>OP_REG(0x1f) )
|
||||
|
||||
// 29c0dc: <105> TAG_global_subroutine
|
||||
// AT_sibling(0x29c1ec)
|
||||
// AT_name("GetResource")
|
||||
// AT_lo_user("GetResource__Q34nw4r3lyt19ArcResourceAccessorFUlPCcPUl")
|
||||
// AT_member(0x16271)
|
||||
// AT_fund_type(FT_pointer)
|
||||
// AT_low_pc(0x802d5158)
|
||||
// AT_high_pc(0x802d51a4)
|
||||
|
||||
// 29c145: <38> TAG_formal_parameter
|
||||
// AT_sibling(0x29c16b)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x16271)
|
||||
// AT_location(<5>OP_REG(0x1f) )
|
||||
|
||||
// 29c16b: <41> TAG_formal_parameter
|
||||
// AT_sibling(0x29c194)
|
||||
// AT_name("resType")
|
||||
// AT_fund_type(FT_unsigned_long)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0x8) OP_ADD )
|
||||
|
||||
// 29c194: <42> TAG_formal_parameter
|
||||
// AT_sibling(0x29c1be)
|
||||
// AT_name("name")
|
||||
// AT_mod_fund_type(<4>MOD_pointer_to MOD_const FT_char)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0xc) OP_ADD )
|
||||
|
||||
// 29c1be: <42> TAG_formal_parameter
|
||||
// AT_sibling(0x29c1e8)
|
||||
// AT_name("pSize")
|
||||
// AT_mod_fund_type(<3>MOD_pointer_to FT_unsigned_long)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0x10) OP_ADD )
|
||||
// 29c1e8: <4>
|
||||
|
||||
// 29c1ec: <116> TAG_global_subroutine
|
||||
// AT_sibling(0x29c2b6)
|
||||
// AT_name("RegistFont")
|
||||
// AT_lo_user("RegistFont__Q34nw4r3lyt19ArcResourceAccessorFPQ34nw4r3lyt11FontRefLink")
|
||||
// AT_member(0x16271)
|
||||
// AT_low_pc(0x802d51a4)
|
||||
// AT_high_pc(0x802d5228)
|
||||
|
||||
// 29c260: <44> TAG_formal_parameter
|
||||
// AT_sibling(0x29c28c)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x16271)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0x8) OP_ADD )
|
||||
|
||||
// 29c28c: <38> TAG_formal_parameter
|
||||
// AT_sibling(0x29c2b2)
|
||||
// AT_name("pLink")
|
||||
// AT_mod_u_d_type(<5>MOD_pointer_to 0x1613f)
|
||||
// AT_location(<5>OP_REG(0x1d) )
|
||||
// 29c2b2: <4>
|
||||
|
||||
// 29c2b6: <120> TAG_global_subroutine
|
||||
// AT_sibling(0x29c384)
|
||||
// AT_name("UnregistFont")
|
||||
// AT_lo_user("UnregistFont__Q34nw4r3lyt19ArcResourceAccessorFPQ34nw4r3lyt11FontRefLink")
|
||||
// AT_member(0x16271)
|
||||
// AT_low_pc(0x802d5228)
|
||||
// AT_high_pc(0x802d52ac)
|
||||
|
||||
// 29c32e: <44> TAG_formal_parameter
|
||||
// AT_sibling(0x29c35a)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x16271)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0x8) OP_ADD )
|
||||
|
||||
// 29c35a: <38> TAG_formal_parameter
|
||||
// AT_sibling(0x29c380)
|
||||
// AT_name("pLink")
|
||||
// AT_mod_u_d_type(<5>MOD_pointer_to 0x1613f)
|
||||
// AT_location(<5>OP_REG(0x1d) )
|
||||
// 29c380: <4>
|
||||
|
||||
// 29c384: <97> TAG_global_subroutine
|
||||
// AT_sibling(0x29c43f)
|
||||
// AT_name("GetFont")
|
||||
// AT_lo_user("GetFont__Q34nw4r3lyt19ArcResourceAccessorFPCc")
|
||||
// AT_member(0x16271)
|
||||
// AT_mod_u_d_type(<5>MOD_pointer_to 0x15c72)
|
||||
// AT_low_pc(0x802d52ac)
|
||||
// AT_high_pc(0x802d52e0)
|
||||
|
||||
// 29c3e5: <44> TAG_formal_parameter
|
||||
// AT_sibling(0x29c411)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x16271)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0x8) OP_ADD )
|
||||
|
||||
// 29c411: <42> TAG_formal_parameter
|
||||
// AT_sibling(0x29c43b)
|
||||
// AT_name("name")
|
||||
// AT_mod_fund_type(<4>MOD_pointer_to MOD_const FT_char)
|
||||
// AT_location(<11>OP_BASEREG(0x1) OP_CONST(0xc) OP_ADD )
|
||||
// 29c43b: <4>
|
||||
|
||||
// 29c43f: <95> TAG_global_subroutine
|
||||
// AT_sibling(0x29c4c8)
|
||||
// AT_name("__dt")
|
||||
// AT_lo_user("__dt__Q34nw4r3lyt24MultiArcResourceAccessorFv")
|
||||
// AT_member(0x63219)
|
||||
// AT_fund_type(FT_pointer)
|
||||
// AT_low_pc(0x802d533c)
|
||||
// AT_high_pc(0x802d53cc)
|
||||
// (0x29c83e)
|
||||
|
||||
// 29c49e: <38> TAG_formal_parameter
|
||||
// AT_sibling(0x29c4c4)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x63219)
|
||||
// AT_location(<5>OP_REG(0x1f) )
|
||||
// 29c4c4: <4>
|
||||
|
||||
// AT_name("DetachAll")
|
||||
// AT_lo_user("DetachAll__Q34nw4r3lyt24MultiArcResourceAccessorFv")
|
||||
|
||||
// AT_name("GetResource")
|
||||
// AT_lo_user("GetResource__Q34nw4r3lyt24MultiArcResourceAccessorFUlPCcPUl")
|
||||
// AT_fund_type(FT_pointer)
|
||||
// AT_name("this")
|
||||
// AT_mod_u_d_type(<6>MOD_const MOD_pointer_to 0x63219)
|
||||
// AT_name("resType")
|
||||
// AT_fund_type(FT_unsigned_long)
|
||||
// AT_name("name")
|
||||
// AT_mod_fund_type(<4>MOD_pointer_to MOD_const FT_char)
|
||||
// AT_name("pSize")
|
||||
// AT_mod_fund_type(<3>MOD_pointer_to FT_unsigned_long)
|
||||
|
||||
// AT_lo_user("GetFont__Q34nw4r3lyt24MultiArcResourceAccessorFPCc")
|
||||
// AT_name("name")
|
||||
// AT_mod_fund_type(<4>MOD_pointer_to MOD_const FT_char)
|
||||
|
||||
// "__vt__Q34nw4r3lyt24MultiArcResourceAccessor"
|
||||
// "__vt__Q34nw4r3lyt19ArcResourceAccessor"
|
||||
@@ -0,0 +1,189 @@
|
||||
#include "nw4r/lyt/lyt_common.h"
|
||||
#include "nw4r/lyt/lyt_layout.h"
|
||||
#include "nw4r/lyt/lyt_pane.h"
|
||||
#include "nw4r/ut/ut_Color.h"
|
||||
#include "nw4r/ut/ut_algorithm.h"
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
using namespace math;
|
||||
using namespace ut;
|
||||
|
||||
// EqualsResName__Q34nw4r3lyt6detailFPCcPCc
|
||||
bool detail::EqualsResName(const char *name1, const char *name2) {
|
||||
return strncmp(name1, name2, NW4R_RES_NAME_SIZE) == 0;
|
||||
;
|
||||
}
|
||||
|
||||
// EqualsMaterialName__Q34nw4r3lyt6detailFPCcPCc
|
||||
bool detail::EqualsMaterialName(const char *name1, const char *name2) {
|
||||
return strncmp(name1, name2, NW4R_MAT_NAME_SIZE) == 0;
|
||||
}
|
||||
|
||||
// TestFileHeader__Q34nw4r3lyt6detailFRCQ44nw4r3lyt3res16BinaryFileHeaderUl
|
||||
bool detail::TestFileHeader(const res::BinaryFileHeader &fileHeader, u32 testSig) {
|
||||
return ((testSig == fileHeader.magic) && (fileHeader.byteOrder == NW4R_BYTEORDER_BIG));
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
// __ct__Q44nw4r3lyt6detail11TexCoordAryFv
|
||||
TexCoordAry::TexCoordAry() : mpData(nullptr), mCap(0), mNum(0) {}
|
||||
|
||||
// Free__Q44nw4r3lyt6detail11TexCoordAryFv
|
||||
void TexCoordAry::Free() {
|
||||
if (this->mpData) {
|
||||
Layout::DeleteArray<VEC2>(*this->mpData, this->mNum * TEXCOORD_VTX_COUNT);
|
||||
this->mpData = nullptr;
|
||||
this->mCap = 0;
|
||||
this->mNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Reserve__Q44nw4r3lyt6detail11TexCoordAryFUc
|
||||
void TexCoordAry::Reserve(u8 num) {
|
||||
if (mCap < num) {
|
||||
Free();
|
||||
const TexCoordData *pData = (TexCoordData *)Layout::NewArray<VEC2>(num * TEXCOORD_VTX_COUNT);
|
||||
this->mpData = pData ? const_cast<TexCoordData *>(pData) : nullptr;
|
||||
if (mpData != NULL) {
|
||||
mCap = num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetSize__Q44nw4r3lyt6detail11TexCoordAryFUc
|
||||
void TexCoordAry::SetSize(u8 num) {
|
||||
if (this->mpData != nullptr && num <= this->mCap) {
|
||||
static TexCoordData texCoords = {VEC2(0.0f, 0.0f), VEC2(1.0f, 0.0f), VEC2(0.0f, 1.0f), VEC2(1.0f, 1.0f)};
|
||||
|
||||
for (int i = mNum; i < num; i++) {
|
||||
for (int j = 0; j < TEXCOORD_VTX_COUNT; j++) {
|
||||
this->mpData[i][j] = texCoords[j];
|
||||
}
|
||||
}
|
||||
this->mNum = num;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy__Q44nw4r3lyt6detail11TexCoordAryFPCvUc
|
||||
void TexCoordAry::Copy(const void *pResTexCoord, u8 texCoordNum) {
|
||||
mNum = Max<u8>(mNum, texCoordNum);
|
||||
|
||||
const TexCoordData *src = static_cast<const TexCoordData *>(pResTexCoord);
|
||||
for (int i = 0; i < texCoordNum; i++) {
|
||||
for (int j = 0; j < TEXCOORD_VTX_COUNT; j++) {
|
||||
mpData[i][j] = src[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// IsModulateVertexColor__Q34nw4r3lyt6detailFPQ34nw4r2ut5ColorUc
|
||||
bool detail::IsModulateVertexColor(ut::Color *vtxColors, u8 glbAlpha) {
|
||||
if (glbAlpha != 0xFF) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((vtxColors != NULL) &&
|
||||
((vtxColors[0] != 0xFFFFFFFF) || (vtxColors[1] != 0xFFFFFFFF) || (vtxColors[2] != 0xFFFFFFFF) ||
|
||||
(vtxColors[3] != 0xFFFFFFFF))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// MultipleAlpha__Q34nw4r3lyt6detailFQ34nw4r2ut5ColorUc
|
||||
ut::Color detail::MultipleAlpha(ut::Color col, u8 alpha) {
|
||||
ut::Color ret = col;
|
||||
if (alpha != 0xFF) {
|
||||
ret.a = (col.a * alpha) / 0xFF;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// MultipleAlpha__Q34nw4r3lyt6detailFPQ34nw4r2ut5ColorPCQ34nw4r2ut5ColorUc
|
||||
void detail::MultipleAlpha(ut::Color *dst, const ut::Color *src, u8 alpha) {
|
||||
for (int i = 0; i < TEXCOORD_VTX_COUNT; i++) {
|
||||
dst[i] = MultipleAlpha(src[i], alpha);
|
||||
}
|
||||
}
|
||||
|
||||
// SetVertexFormat__Q34nw4r3lyt6detailFbUc
|
||||
void detail::SetVertexFormat(bool bModulate, u8 textCoordNum) {
|
||||
GXClearVtxDesc();
|
||||
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
if (bModulate) {
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||
}
|
||||
|
||||
for (int i = 0; i < textCoordNum; i++) {
|
||||
GXSetVtxDesc((GXAttr)(GX_VA_TEX0 + i), GX_DIRECT);
|
||||
}
|
||||
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0);
|
||||
if (bModulate) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < textCoordNum; i++) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, (GXAttr)(GX_VA_TEX0 + i), GX_TEX_ST, GX_F32, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// DrawQuad__Q34nw4r3lyt6detailFRCQ34nw4r4math4VEC2RCQ34nw4r3lyt4SizeUcPA4_CQ34nw4r4math4VEC2PCQ34nw4r2ut5Color
|
||||
void detail::DrawQuad(const math::VEC2 &basePt, const Size &size, u8 texCoordNum, const TexCoordData *texCoords,
|
||||
const ut::Color *vtxColors) {
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
GXPosition2f32(basePt.x, basePt.y);
|
||||
if (vtxColors != NULL) {
|
||||
GXColor1u32(vtxColors[0]);
|
||||
}
|
||||
for (int i = 0; i < texCoordNum; i++) {
|
||||
GXTexCoord2f32(texCoords[i][0].x, texCoords[i][0].y);
|
||||
}
|
||||
|
||||
GXPosition2f32(basePt.x + size.x, basePt.y);
|
||||
if (vtxColors != NULL) {
|
||||
GXColor1u32(vtxColors[1]);
|
||||
}
|
||||
for (int i = 0; i < texCoordNum; i++) {
|
||||
GXTexCoord2f32(texCoords[i][1].x, texCoords[i][1].y);
|
||||
}
|
||||
|
||||
GXPosition2f32(basePt.x + size.x, basePt.y - size.y);
|
||||
if (vtxColors != NULL) {
|
||||
GXColor1u32(vtxColors[3]);
|
||||
}
|
||||
for (int i = 0; i < texCoordNum; i++) {
|
||||
GXTexCoord2f32(texCoords[i][3].x, texCoords[i][3].y);
|
||||
}
|
||||
|
||||
GXPosition2f32(basePt.x, basePt.y - size.y);
|
||||
if (vtxColors != NULL) {
|
||||
GXColor1u32(vtxColors[2]);
|
||||
}
|
||||
for (int i = 0; i < texCoordNum; i++) {
|
||||
GXTexCoord2f32(texCoords[i][2].x, texCoords[i][2].y);
|
||||
}
|
||||
}
|
||||
|
||||
// DrawQuad__Q34nw4r3lyt6detailFRCQ34nw4r4math4VEC2RCQ34nw4r3lyt4SizeUcPA4_CQ34nw4r4math4VEC2PCQ34nw4r2ut5ColorUc
|
||||
void detail::DrawQuad(const math::VEC2 &basePt, const Size &size, u8 texCoordNum, const TexCoordData *texCoords,
|
||||
const ut::Color *vtxColors, u8 alpha) {
|
||||
ut::Color wkVtxColors[4];
|
||||
if (vtxColors) {
|
||||
MultipleAlpha(wkVtxColors, vtxColors, alpha);
|
||||
}
|
||||
DrawQuad(basePt, size, texCoordNum, texCoords, vtxColors ? wkVtxColors : nullptr);
|
||||
}
|
||||
|
||||
// DrawLine__Q34nw4r3lyt6detailFRCQ34nw4r4math4VEC2RCQ34nw4r3lyt4SizeQ34nw4r2ut5Color
|
||||
void detail::DrawLine(const math::VEC2 &pos, const Size &size, ut::Color color) {
|
||||
// Not Impl in SS
|
||||
}
|
||||
} // namespace lyt
|
||||
} // namespace nw4r
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
#include <nw4r/lyt/lyt_animation.h>
|
||||
#include <nw4r/lyt/lyt_group.h>
|
||||
#include <nw4r/math/math_geometry.h>
|
||||
#include <nw4r/ut/ut_Rect.h>
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
|
||||
namespace {
|
||||
// Contains__Q34nw4r3lyt22@unnamed@lyt_util_cpp@FRCQ34nw4r2ut4RectRCQ34nw4r4math4VEC2
|
||||
bool Contains(const ut::Rect &rect, const math::VEC2 &point) {}
|
||||
} // namespace
|
||||
|
||||
// BindAnimation__Q24nw4r3lytFPQ34nw4r3lyt5GroupPQ34nw4r3lyt13AnimTransformbb
|
||||
void BindAnimation(Group *pGroup, AnimTransform *pAnimTrans, bool bRecursive, bool bDisable) {}
|
||||
|
||||
// SetAnimationEnable__Q24nw4r3lytFPQ34nw4r3lyt5GroupPQ34nw4r3lyt13AnimTransformbb
|
||||
void SetAnimationEnable(Group *pGroup, nw4r::lyt::AnimTransform *pAnimTrans, bool bEnable, bool bRecursive) {}
|
||||
|
||||
// IsContain__Q24nw4r3lytFPQ34nw4r3lyt4PaneRCQ34nw4r4math4VEC2
|
||||
bool IsContain(Pane *pPane, const math::VEC2 &pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// FindHitPane__Q24nw4r3lytFPQ34nw4r3lyt4PaneRCQ34nw4r4math4VEC2
|
||||
Pane *FindHitPane(Pane *pPane, const math::VEC2 &pos) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace lyt
|
||||
|
||||
} // namespace nw4r
|
||||
Reference in New Issue
Block a user