Files
mm/tools/ZAPD/ZAPD/ZPointer.cpp
T
Anghelo Carvajal 194c99d80b Subrepos update (#613)
* a

* git subrepo pull tools/asm-differ --force

subrepo:
  subdir:   "tools/asm-differ"
  merged:   "6f8f80b71"
upstream:
  origin:   "https://github.com/simonlindholm/asm-differ"
  branch:   "main"
  commit:   "6f8f80b71"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/z64compress --force

subrepo:
  subdir:   "tools/z64compress"
  merged:   "9e7a6dbfa"
upstream:
  origin:   "https://github.com/z64me/z64compress.git"
  branch:   "main"
  commit:   "9e7a6dbfa"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* git subrepo pull tools/ZAPD --force

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "bf16ff7c4"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "bf16ff7c4"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* Revert "git subrepo pull tools/z64compress --force"

This reverts commit a7cc87394e.
2022-01-16 18:30:31 +00:00

58 lines
997 B
C++

#include "ZPointer.h"
#include "Globals.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
#include "WarningHandler.h"
#include "ZFile.h"
REGISTER_ZFILENODE(Pointer, ZPointer);
ZPointer::ZPointer(ZFile* nParent) : ZResource(nParent)
{
RegisterRequiredAttribute("Type");
}
void ZPointer::ParseXML(tinyxml2::XMLElement* reader)
{
ZResource::ParseXML(reader);
type = registeredAttributes.at("Type").value;
}
void ZPointer::ParseRawData()
{
auto& rawData = parent->GetRawData();
ptr = BitConverter::ToUInt32BE(rawData, rawDataIndex);
}
std::string ZPointer::GetBodySourceCode() const
{
std::string ptrName;
Globals::Instance->GetSegmentedPtrName(ptr, parent, "", ptrName);
return ptrName;
}
bool ZPointer::DoesSupportArray() const
{
return true;
}
std::string ZPointer::GetSourceTypeName() const
{
return type + "*";
}
ZResourceType ZPointer::GetResourceType() const
{
return ZResourceType::Pointer;
}
size_t ZPointer::GetRawDataSize() const
{
return 0x04;
}