Skip to content

Commit

Permalink
More getters
Browse files Browse the repository at this point in the history
  • Loading branch information
wghost committed Apr 22, 2014
1 parent 3f75513 commit a999555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion UObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ std::string UField::Deserialize(std::istream& stream, UPKInfo& info)
if ((unsigned)stream.tellg() > info.GetExportEntry(ThisRef).SerialOffset + info.GetExportEntry(ThisRef).SerialSize)
return ss.str();
ss << "UField:\n";
FieldOffset = stream.tellg();
FieldOffset = NextRefOffset = stream.tellg();
stream.read(reinterpret_cast<char*>(&NextRef), sizeof(NextRef));
ss << "\tNextRef = " << FormatHEX((uint32_t)NextRef) << " -> " << info.ObjRefToName(NextRef) << std::endl;
if (IsStructure())
Expand All @@ -375,6 +375,7 @@ std::string UStruct::Deserialize(std::istream& stream, UPKInfo& info)
StructOffset = stream.tellg();
stream.read(reinterpret_cast<char*>(&ScriptTextRef), sizeof(ScriptTextRef));
ss << "\tScriptTextRef = " << FormatHEX((uint32_t)ScriptTextRef) << " -> " << info.ObjRefToName(ScriptTextRef) << std::endl;
FirstChildRefOffset = stream.tellg();
stream.read(reinterpret_cast<char*>(&FirstChildRef), sizeof(FirstChildRef));
ss << "\tFirstChildRef = " << FormatHEX((uint32_t)FirstChildRef) << " -> " << info.ObjRefToName(FirstChildRef) << std::endl;
stream.read(reinterpret_cast<char*>(&CppTextRef), sizeof(CppTextRef));
Expand Down
8 changes: 7 additions & 1 deletion UObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@ class UField: public UObject
UField() { Type = GlobalType::UField; }
~UField() {}
std::string Deserialize(std::istream& stream, UPKInfo& info);
UObjectReference GetNextRef() { return NextRef; }
size_t GetNextRefOffset() { return NextRefOffset; }
protected:
/// persistent
UObjectReference NextRef;
UObjectReference ParentRef; /// for Struct objects only
/// memory
size_t FieldOffset;
size_t FieldSize;
size_t NextRefOffset;
};

class UStruct: public UField
Expand All @@ -136,9 +139,11 @@ class UStruct: public UField
~UStruct() {}
std::string Deserialize(std::istream& stream, UPKInfo& info);
bool IsStructure() { return true; }
UObjectReference GetFirstChildRef() { return FirstChildRef; }
uint32_t GetScriptSerialSize() { return ScriptSerialSize; }
uint32_t GetScriptMemorySize() { return ScriptMemorySize; }
uint32_t GetScriptOffset() { return ScriptOffset; }
size_t GetScriptOffset() { return ScriptOffset; }
size_t GetFirstChildRefOffset() { return FirstChildRefOffset; }
protected:
/// persistent
UObjectReference ScriptTextRef;
Expand All @@ -153,6 +158,7 @@ class UStruct: public UField
size_t StructOffset;
size_t StructSize;
size_t ScriptOffset;
size_t FirstChildRefOffset;
};

class UFunction: public UStruct
Expand Down

0 comments on commit a999555

Please sign in to comment.