diff options
| author | fig02 <fig02srl@gmail.com> | 2021-01-01 21:10:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-01 21:10:28 -0500 |
| commit | cd4a8760b64474a2603c2d164ab7fb7bcd88385c (patch) | |
| tree | cb510f6c63ad183df25083c658788e4e2407c7df /ZAPD/ZRoom | |
| parent | a29291d139764b251536282b3fd716ffa877e3d7 (diff) | |
Misc changes (#41)
* fixes
* changes
* progress
* Vertices -> Vtx
* done i think
Diffstat (limited to 'ZAPD/ZRoom')
| -rw-r--r-- | ZAPD/ZRoom/Commands/SetMesh.cpp | 8 | ||||
| -rw-r--r-- | ZAPD/ZRoom/ZRoom.cpp | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ZAPD/ZRoom/Commands/SetMesh.cpp b/ZAPD/ZRoom/Commands/SetMesh.cpp index 5902a93..ba71cc6 100644 --- a/ZAPD/ZRoom/Commands/SetMesh.cpp +++ b/ZAPD/ZRoom/Commands/SetMesh.cpp @@ -309,7 +309,7 @@ void SetMesh::GenDListDeclarations(std::vector<uint8_t> rawData, ZDisplayList* d for (pair<uint32_t, string> vtxEntry : dList->vtxDeclarations) { zRoom->parent->AddDeclarationArray(vtxEntry.first, DeclarationAlignment::Align8, dList->vertices[vtxEntry.first].size() * 16, "Vtx", - StringHelper::Sprintf("%sVertices0x%06X", zRoom->GetName().c_str(), vtxEntry.first), 0, vtxEntry.second); + StringHelper::Sprintf("%sVtx_%06X", zRoom->GetName().c_str(), vtxEntry.first), 0, vtxEntry.second); //zRoom->parent->declarations[vtxEntry.first] = new Declaration(DeclarationAlignment::Align8, dList->vertices[vtxEntry.first].size() * 16, vtxEntry.second); } @@ -328,7 +328,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("%sTex0x%06X", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); + zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%sTex_%06X", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); } } @@ -345,10 +345,10 @@ std::string SetMesh::GenDListExterns(ZDisplayList* dList) sourceOutput += GenDListExterns(otherDList); for (pair<uint32_t, string> vtxEntry : dList->vtxDeclarations) - sourceOutput += StringHelper::Sprintf("extern Vtx %sVertices0x%06X[%i];\n", zRoom->GetName().c_str(), vtxEntry.first, dList->vertices[vtxEntry.first].size()); + sourceOutput += StringHelper::Sprintf("extern Vtx %sVtx_%06X[%i];\n", zRoom->GetName().c_str(), vtxEntry.first, dList->vertices[vtxEntry.first].size()); for (pair<uint32_t, string> texEntry : dList->texDeclarations) - sourceOutput += StringHelper::Sprintf("extern u64 %sTex0x%06X[];\n", zRoom->GetName().c_str(), texEntry.first); + sourceOutput += StringHelper::Sprintf("extern u64 %sTex_%06X[];\n", zRoom->GetName().c_str(), texEntry.first); sourceOutput += dList->defines; diff --git a/ZAPD/ZRoom/ZRoom.cpp b/ZAPD/ZRoom/ZRoom.cpp index 48b4109..9396f07 100644 --- a/ZAPD/ZRoom/ZRoom.cpp +++ b/ZAPD/ZRoom/ZRoom.cpp @@ -173,7 +173,7 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector<uint8_t> nRawData, int r int width = strtol(string(child->Attribute("Width")).c_str(), NULL, 10); int height = strtol(string(child->Attribute("Height")).c_str(), NULL, 10); - ZTexture* tex = ZTexture::FromBinary(ZTexture::GetTextureTypeFromString(typeStr), room->rawData, address, StringHelper::Sprintf("%sTex0x%06X", room->name.c_str(), address), width, height); + 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)); } @@ -444,7 +444,7 @@ string ZRoom::GetSourceOutputCode(std::string prefix) { int intersectAmt = (texturesSorted[i].first + texSize) - texturesSorted[i + 1].first; - defines += StringHelper::Sprintf("#define %sTex0x%06X ((u32)%sTex0x%06X + 0x%06X)\n", prefix.c_str(), texturesSorted[i + 1].first, prefix.c_str(), + defines += StringHelper::Sprintf("#define %sTex_%06X ((u32)%sTex_%06X + 0x%06X)\n", prefix.c_str(), texturesSorted[i + 1].first, prefix.c_str(), texturesSorted[i].first, texturesSorted[i + 1].first - texturesSorted[i].first); parent->declarations.erase(texturesSorted[i + 1].first); @@ -473,7 +473,7 @@ string ZRoom::GetSourceOutputCode(std::string prefix) parent->AddDeclarationIncludeArray(item.first, StringHelper::Sprintf("%s/%s.%s.inc.c", Globals::Instance->outputPath.c_str(), Path::GetFileNameWithoutExtension(item.second->GetName()).c_str(), item.second->GetExternalExtension().c_str()), item.second->GetRawDataSize(), - "u64", StringHelper::Sprintf("%sTex0x%06X", prefix.c_str(), item.first), 0); + "u64", StringHelper::Sprintf("%sTex_%06X", prefix.c_str(), item.first), 0); } //sourceOutput += "\n"; |
