mirror of
https://github.com/zeldaret/botw
synced 2026-07-09 06:03:25 -04:00
ksys/utils/byaml: First iteration of implementation.
4 Functions are still not fully matching with their inlined functions, and at least one function is still missing.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "KingSystem/Utils/Byaml/ByamlArrayIter.h"
|
||||
#include "KingSystem/Utils/Byaml/Byaml.h"
|
||||
#include "KingSystem/Utils/Byaml/ByamlData.h"
|
||||
#include "KingSystem/Utils/Byaml/ByamlLocal.h"
|
||||
|
||||
namespace al {
|
||||
ByamlArrayIter::ByamlArrayIter(const u8* data) {
|
||||
mData = data;
|
||||
}
|
||||
|
||||
const u32* ByamlArrayIter::getDataTable() const {
|
||||
return reinterpret_cast<const u32*>(&mData[TypeTableOffset + getDataOffset()]);
|
||||
}
|
||||
|
||||
bool ByamlArrayIter::getDataByIndex(ByamlData* data, s32 index) {
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index >= ByamlLocalUtil::getContainerSize(mData)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
data->setType(ByamlType(mData[TypeTableOffset + index]));
|
||||
data->setValue(getDataTable()[index]);
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace al
|
||||
Reference in New Issue
Block a user