mirror of
https://github.com/edubart/otclient.git
synced 2025-12-02 16:06:51 +01:00
Now otb reader is properly working
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
|
||||
void BinaryTree::unserialize(const FileStreamPtr& fin)
|
||||
{
|
||||
m_type = fin->getU32();
|
||||
|
||||
while(true) {
|
||||
uint8 byte = fin->getU8();
|
||||
switch(byte) {
|
||||
@@ -48,6 +46,11 @@ void BinaryTree::unserialize(const FileStreamPtr& fin)
|
||||
}
|
||||
}
|
||||
|
||||
void BinaryTree::serialize(const FileStreamPtr& fin)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BinaryTree::seek(uint pos)
|
||||
{
|
||||
if(pos > m_buffer.size())
|
||||
|
||||
@@ -35,9 +35,10 @@ enum {
|
||||
class BinaryTree : public std::enable_shared_from_this<BinaryTree>
|
||||
{
|
||||
public:
|
||||
BinaryTree(const BinaryTreePtr& parent = nullptr) : m_type(0), m_pos(0), m_parent(parent) { }
|
||||
BinaryTree(const BinaryTreePtr& parent = nullptr) : m_pos(0), m_parent(parent) { }
|
||||
|
||||
void unserialize(const FileStreamPtr& fin);
|
||||
void serialize(const FileStreamPtr& fin);
|
||||
|
||||
void seek(uint pos);
|
||||
void skip(uint len) { seek(tell() + len); }
|
||||
@@ -52,12 +53,9 @@ public:
|
||||
|
||||
BinaryTreeVec getChildren() { return m_children; }
|
||||
BinaryTreePtr getParent() { return m_parent.lock(); }
|
||||
uint32 getType() { return m_type; }
|
||||
bool canRead() { return m_pos < m_buffer.size(); }
|
||||
|
||||
private:
|
||||
void setParent(const BinaryTreePtr& parent) { m_parent = parent; }
|
||||
uint m_type;
|
||||
uint m_pos;
|
||||
|
||||
BinaryTreeVec m_children;
|
||||
|
||||
Reference in New Issue
Block a user