1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-16 03:50:20 +00:00

ZAPD update: libpng, zroom improvements and others (#811)

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "769f5702a"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "769f5702a"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Add `libpng` to readme

* Remove `-ifp` since it doesn't exists anymore in ZAPD

* Remove extra print I added

* Add UNK_09 macro and other minor fixes

* Simplify PNG rules

* simplify gitignore

* Update README.md

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* Update dockerfile

* basic instructions for cygwin and mac

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "86160be69"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "86160be69"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Change nanoseconds to seconds in extract_assets.py

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-05-30 11:09:59 -04:00 committed by GitHub
parent 676ecf06c5
commit 515ebdce9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
142 changed files with 5922 additions and 14735 deletions

View file

@ -19,19 +19,29 @@ ZVtx::ZVtx(ZFile* nParent) : ZResource(nParent)
a = 0;
}
void ZVtx::ParseXML(tinyxml2::XMLElement* reader)
void ZVtx::ParseRawData()
{
x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
y = BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
z = BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
flag = BitConverter::ToInt16BE(rawData, rawDataIndex + 6);
s = BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
t = BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
r = rawData[rawDataIndex + 12];
g = rawData[rawDataIndex + 13];
b = rawData[rawDataIndex + 14];
a = rawData[rawDataIndex + 15];
}
std::string ZVtx::GetSourceTypeName()
std::string ZVtx::GetBodySourceCode() const
{
return "Vtx";
return StringHelper::Sprintf("VTX(%i, %i, %i, %i, %i, %i, %i, %i, %i)", x, y, z, s, t, r, g, b,
a);
}
std::string ZVtx::GetSourceOutputCode(const std::string& prefix)
{
std::string output =
StringHelper::Sprintf("VTX(%i, %i, %i, %i, %i, %i, %i, %i, %i)", x, y, z, s, t, r, g, b, a);
std::string output = GetBodySourceCode();
if (parent != nullptr)
{
@ -44,49 +54,32 @@ std::string ZVtx::GetSourceOutputCode(const std::string& prefix)
return "";
}
void ZVtx::ParseRawData()
{
const uint8_t* data = rawData.data();
x = BitConverter::ToInt16BE(data, rawDataIndex + 0);
y = BitConverter::ToInt16BE(data, rawDataIndex + 2);
z = BitConverter::ToInt16BE(data, rawDataIndex + 4);
flag = BitConverter::ToInt16BE(data, rawDataIndex + 6);
s = BitConverter::ToInt16BE(data, rawDataIndex + 8);
t = BitConverter::ToInt16BE(data, rawDataIndex + 10);
r = data[rawDataIndex + 12];
g = data[rawDataIndex + 13];
b = data[rawDataIndex + 14];
a = data[rawDataIndex + 15];
}
size_t ZVtx::GetRawDataSize()
size_t ZVtx::GetRawDataSize() const
{
return 16;
}
bool ZVtx::DoesSupportArray()
bool ZVtx::DoesSupportArray() const
{
return true;
}
ZResourceType ZVtx::GetResourceType()
ZResourceType ZVtx::GetResourceType() const
{
return ZResourceType::Vertex;
}
bool ZVtx::IsExternalResource()
bool ZVtx::IsExternalResource() const
{
return true;
}
std::string ZVtx::GetExternalExtension()
std::string ZVtx::GetSourceTypeName() const
{
return "Vtx";
}
std::string ZVtx::GetExternalExtension() const
{
return "vtx";
}
void ZVtx::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData,
const uint32_t nRawDataIndex, const std::string& nRelPath)
{
ZResource::ExtractFromXML(reader, nRawData, nRawDataIndex, nRelPath);
}