mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-12 09:50:50 +00:00
Actor Struct Changes (and a few related things) (#617)
* reformat header * type -> category * done for now i think * some more stuff * first -> head * focus * flag comment * ground -> floor * remove asm, name wrapper funcs * name func, format * review * targetPriority, format * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "0305ec2c2" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "0305ec2c2" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * comment * review * feet flags * horse shadow
This commit is contained in:
parent
20206fba0d
commit
00a5edea71
697 changed files with 8157 additions and 7942 deletions
|
@ -47,6 +47,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex,
|
|||
{
|
||||
entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr));
|
||||
entry->opaqueDList->scene = zRoom->scene;
|
||||
entry->opaqueDList->parent = zRoom->parent;
|
||||
GenDListDeclarations(rawData, entry->opaqueDList);
|
||||
}
|
||||
|
||||
|
@ -54,6 +55,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex,
|
|||
{
|
||||
entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr));
|
||||
entry->translucentDList->scene = zRoom->scene;
|
||||
entry->translucentDList->parent = zRoom->parent;
|
||||
GenDListDeclarations(rawData, entry->translucentDList);
|
||||
}
|
||||
|
||||
|
@ -206,6 +208,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex,
|
|||
{
|
||||
entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr));
|
||||
entry->opaqueDList->scene = zRoom->scene;
|
||||
entry->opaqueDList->parent = zRoom->parent;
|
||||
GenDListDeclarations(rawData, entry->opaqueDList); // HOTSPOT
|
||||
}
|
||||
|
||||
|
@ -213,6 +216,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector<uint8_t> rawData, int rawDataIndex,
|
|||
{
|
||||
entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr));
|
||||
entry->translucentDList->scene = zRoom->scene;
|
||||
entry->translucentDList->parent = zRoom->parent;
|
||||
GenDListDeclarations(rawData, entry->translucentDList); // HOTSPOT
|
||||
}
|
||||
|
||||
|
@ -291,16 +295,17 @@ SetMesh::~SetMesh()
|
|||
|
||||
void SetMesh::GenDListDeclarations(std::vector<uint8_t> rawData, ZDisplayList* dList)
|
||||
{
|
||||
string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT
|
||||
|
||||
string srcVarName = "";
|
||||
|
||||
if (Globals::Instance->includeFilePrefix)
|
||||
//if (Globals::Instance->includeFilePrefix)
|
||||
srcVarName = StringHelper::Sprintf("%s%s", zRoom->GetName().c_str(), dList->GetName().c_str());
|
||||
else
|
||||
srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str());
|
||||
//else
|
||||
//srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str());
|
||||
|
||||
zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput);
|
||||
dList->SetName(srcVarName);
|
||||
string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT
|
||||
|
||||
//zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput);
|
||||
|
||||
for (ZDisplayList* otherDList : dList->otherDLists)
|
||||
GenDListDeclarations(rawData, otherDList);
|
||||
|
@ -324,7 +329,7 @@ void SetMesh::GenDListDeclarations(std::vector<uint8_t> rawData, ZDisplayList* d
|
|||
|
||||
zRoom->parent->AddDeclarationIncludeArray(texEntry.first, StringHelper::Sprintf("%s/%s.%s.inc.c",
|
||||
Globals::Instance->outputPath.c_str(), Path::GetFileNameWithoutExtension(zRoom->textures[texEntry.first]->GetName()).c_str(), zRoom->textures[texEntry.first]->GetExternalExtension().c_str()),
|
||||
zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%sTex_%06X", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0);
|
||||
zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,8 +81,10 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r
|
|||
|
||||
for (XMLElement* child = reader->FirstChildElement(); child != NULL; child = child->NextSiblingElement())
|
||||
{
|
||||
// TODO: Bunch of repeated code between all of these that needs to be combined.
|
||||
if (string(child->Name()) == "DListHint")
|
||||
{
|
||||
string name = "";
|
||||
string comment = "";
|
||||
|
||||
if (child->Attribute("Comment") != NULL)
|
||||
|
@ -92,11 +94,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r
|
|||
int address = strtol(StringHelper::Split(addressStr, "0x")[1].c_str(), NULL, 16);
|
||||
|
||||
ZDisplayList* dList = new ZDisplayList(room->rawData, address, ZDisplayList::GetDListLength(room->rawData, address));
|
||||
dList->GetSourceOutputCode(room->name);
|
||||
|
||||
if (child->Attribute("Name") != NULL)
|
||||
name = string(child->Attribute("Name"));
|
||||
else
|
||||
name = room->name;
|
||||
|
||||
dList->GetSourceOutputCode(name);
|
||||
delete dList;
|
||||
}
|
||||
else if (string(child->Name()) == "BlobHint")
|
||||
{
|
||||
string name = "";
|
||||
string comment = "";
|
||||
|
||||
if (child->Attribute("Comment") != NULL)
|
||||
|
@ -109,10 +118,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r
|
|||
int size = strtol(StringHelper::Split(sizeStr, "0x")[1].c_str(), NULL, 16);
|
||||
|
||||
ZBlob* blob = new ZBlob(room->rawData, address, size, StringHelper::Sprintf("%sBlob0x%06X", room->name.c_str(), address));
|
||||
room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str()), 0, blob->GetSourceOutputCode(room->name));
|
||||
|
||||
if (child->Attribute("Name") != NULL)
|
||||
name = string(child->Attribute("Name"));
|
||||
else
|
||||
name = StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str());
|
||||
|
||||
room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", name, 0, blob->GetSourceOutputCode(room->name));
|
||||
delete blob;
|
||||
}
|
||||
else if (string(child->Name()) == "CutsceneHint")
|
||||
{
|
||||
string name = "";
|
||||
string comment = "";
|
||||
|
||||
if (child->Attribute("Comment") != NULL)
|
||||
|
@ -123,11 +140,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r
|
|||
|
||||
ZCutscene* cutscene = new ZCutscene(room->rawData, address, 9999);
|
||||
|
||||
if (child->Attribute("Name") != NULL)
|
||||
name = string(child->Attribute("Name"));
|
||||
else
|
||||
name = StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset);
|
||||
|
||||
room->parent->AddDeclarationArray(address, DeclarationAlignment::None, DeclarationPadding::Pad16, cutscene->GetRawDataSize(), "s32",
|
||||
StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset), 0, cutscene->GetSourceOutputCode(room->name));
|
||||
name, 0, cutscene->GetSourceOutputCode(room->name));
|
||||
delete cutscene;
|
||||
}
|
||||
else if (string(child->Name()) == "AltHeaderHint")
|
||||
{
|
||||
string name = "";
|
||||
string comment = "";
|
||||
|
||||
if (child->Attribute("Comment") != NULL)
|
||||
|
@ -180,6 +204,7 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r
|
|||
ZTexture* tex = ZTexture::FromBinary(ZTexture::GetTextureTypeFromString(typeStr), room->rawData, address, StringHelper::Sprintf("%sTex_%06X", room->name.c_str(), address), width, height);
|
||||
room->parent->AddDeclarationArray(address, DeclarationAlignment::None, tex->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", tex->GetName().c_str()), 0,
|
||||
tex->GetSourceOutputCode(room->name));
|
||||
delete tex;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -533,6 +558,7 @@ Declaration::Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPa
|
|||
isArray = false;
|
||||
arrayItemCnt = 0;
|
||||
includePath = "";
|
||||
references = vector<uint32_t>();
|
||||
}
|
||||
|
||||
Declaration::Declaration(DeclarationAlignment nAlignment, uint32_t nSize, string nVarType, string nVarName, bool nIsArray, string nText) : Declaration(nAlignment, DeclarationPadding::None, nSize, nText)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue