mirror of
https://github.com/projectPiki/pikmin2.git
synced 2025-02-17 04:17:52 +00:00
modifying funcs to match from tpdebug
This commit is contained in:
parent
7027935a5b
commit
a79259bc48
@ -40,8 +40,7 @@ struct TParse_TBlock : public TParseData_aligned<4> {
|
||||
|
||||
const void* getNext() const
|
||||
{
|
||||
u32 size = getSize();
|
||||
return ((u8*)getRaw() + size);
|
||||
return getSize() + ((u8*)getRaw());
|
||||
}
|
||||
|
||||
const void* getBlockEnd() const { return (u8*)getRaw() + sizeof(TBlock); }
|
||||
@ -57,8 +56,7 @@ struct TParse_TBlock : public TParseData_aligned<4> {
|
||||
|
||||
const void* getContent() const
|
||||
{
|
||||
u32 size = align_roundUp(getIDSize(), 4);
|
||||
return (const void*)((int)getBlockEnd() + size);
|
||||
return align_roundUp(getIDSize(), 4) + (const u8*)getBlockEnd();
|
||||
}
|
||||
|
||||
// _00-_04 = TParseData_aligned
|
||||
|
@ -11,14 +11,14 @@ namespace data {
|
||||
*/
|
||||
void TParse_TParagraph::getData(TParse_TParagraph::TData* data) const
|
||||
{
|
||||
u16* parse = (u16*)JGadget::binary::parseVariableUInt_16_32_following(mRaw, (u32*)data, (u32*)&data->mType, 0);
|
||||
u32 t = (u32)data->mSize;
|
||||
const u8* parse = (const u8*)JGadget::binary::parseVariableUInt_16_32_following(mRaw, (u32*)data, (u32*)&data->mType, 0);
|
||||
u32 t = data->mSize;
|
||||
if (!t) {
|
||||
data->mContent = nullptr;
|
||||
data->mNext = parse;
|
||||
} else {
|
||||
data->mContent = parse;
|
||||
data->mNext = parse + ((t + 3) >> 1 & ~1);
|
||||
data->mNext = parse + align_roundUp(t, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user