mirror of
https://github.com/zeldaret/ss
synced 2026-08-21 06:28:25 -04:00
lyt_group matching
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
#include <nw4r/lyt/lyt_group.h>
|
||||
#include <nw4r/lyt/lyt_layout.h>
|
||||
|
||||
namespace nw4r {
|
||||
|
||||
namespace lyt {
|
||||
|
||||
// __ct__Q34nw4r3lyt5GroupFPCQ44nw4r3lyt3res5GroupPQ34nw4r3lyt4Pane
|
||||
Group::Group(const res::Group *pResGroup, Pane *pRootPane) : mLink(), mPaneListLink() {
|
||||
Init();
|
||||
strncpy(this->mName, pResGroup->mName, NW4R_RES_NAME_SIZE);
|
||||
this->mName[NW4R_RES_NAME_SIZE] = '\0';
|
||||
const char *paneNameBase = (char *)(&pResGroup[1]);
|
||||
for (int i = 0; i < pResGroup->paneNum; i++) {
|
||||
Pane *pFindPane = pRootPane->FindPaneByName(paneNameBase + i * NW4R_RES_NAME_SIZE, true);
|
||||
if (pFindPane) {
|
||||
AppendPane(pFindPane);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Init__Q34nw4r3lyt5GroupFv
|
||||
void Group::Init() {
|
||||
this->mbUserAllocated = false;
|
||||
}
|
||||
|
||||
// __dt__Q34nw4r3lyt5GroupFv
|
||||
Group::~Group() {
|
||||
ut::LinkList<detail::PaneLink, 0>::Iterator it = this->mPaneListLink.GetBeginIter();
|
||||
while (it != this->mPaneListLink.GetEndIter()) {
|
||||
ut::LinkList<detail::PaneLink, 0>::Iterator currIt = it++;
|
||||
this->mPaneListLink.Erase(currIt);
|
||||
Layout::DeleteObj<detail::PaneLink>(&*currIt);
|
||||
}
|
||||
}
|
||||
|
||||
// AppendPane__Q34nw4r3lyt5GroupFPQ34nw4r3lyt4Pane
|
||||
void Group::AppendPane(Pane *pPane) {
|
||||
detail::PaneLink *pPaneLink = Layout::NewObj<detail::PaneLink>();
|
||||
if (pPaneLink) {
|
||||
pPaneLink->mTarget = pPane;
|
||||
this->mPaneListLink.PushBack(pPaneLink);
|
||||
}
|
||||
}
|
||||
|
||||
//__dt__Q34nw4r3lyt14GroupContainerFv
|
||||
GroupContainer::~GroupContainer() {
|
||||
ut::LinkList<Group, 4>::Iterator it = this->mGroupList.GetBeginIter();
|
||||
while (it != this->mGroupList.GetEndIter()) {
|
||||
ut::LinkList<Group, 4>::Iterator currIt = it++;
|
||||
this->mGroupList.Erase(currIt);
|
||||
if (!currIt->mbUserAllocated) {
|
||||
Layout::DeleteObj<Group>(&*currIt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// AppendGroup__Q34nw4r3lyt14GroupContainerFPQ34nw4r3lyt5Group
|
||||
void GroupContainer::AppendGroup(Group *pGroup) {
|
||||
this->mGroupList.PushBack(pGroup);
|
||||
}
|
||||
|
||||
// FindGroupByName__Q34nw4r3lyt14GroupContainerFPCc
|
||||
Group *GroupContainer::FindGroupByName(const char *findName) {
|
||||
for (ut::LinkList<Group, 4>::Iterator it = this->mGroupList.GetBeginIter(); it != this->mGroupList.GetEndIter();
|
||||
it++) {
|
||||
if (detail::EqualsResName(it->mName, findName)) {
|
||||
return &*it;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace lyt
|
||||
|
||||
} // namespace nw4r
|
||||
|
||||
@@ -28,13 +28,13 @@ PaneBase::~PaneBase() {}
|
||||
|
||||
NW4R_UT_RTTI_DEF_BASE(Pane);
|
||||
|
||||
// 80486a70
|
||||
// __ct__Q34nw4r3lyt4PaneFv
|
||||
|
||||
// __dt__Q34nw4r2ut38LinkList<Q34nw4r3lyt13AnimationLink,0>Fv
|
||||
|
||||
// __dt__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv
|
||||
|
||||
// 80486a70
|
||||
// __ct__Q34nw4r3lyt4PaneFPCQ44nw4r3lyt3res4Pane
|
||||
Pane::Pane(const res::Pane *pBlock) : mChildList(), mAnimList(), mSize() {
|
||||
this->mpParent = nullptr;
|
||||
@@ -205,6 +205,8 @@ Material *Pane::FindMaterialByName(const char *findName, bool bRecursive) {
|
||||
}
|
||||
|
||||
// CalculateMtx__Q34nw4r3lyt4PaneFRCQ34nw4r3lyt8DrawInfo
|
||||
// Matches for SS, applying the rotation and scale seems to be different accross versions.
|
||||
// Also look out for the Bottom CalculateMtxChild section. In other version this is actually seperated differently
|
||||
void Pane::CalculateMtx(const DrawInfo &drawInfo) {
|
||||
if (!IsVisible() && !drawInfo.IsInvisiblePaneCalculateMtx()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user