mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-27 07:07:52 -05:00
ObjLoading: Read index section of ipaks and try to open images from it when loading obj data
This commit is contained in:
@ -1,34 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utils/FileAPI.h"
|
||||
#include "ObjContainer/IPak/IPakTypes.h"
|
||||
#include "ObjContainer/ObjContainerReferenceable.h"
|
||||
#include "ObjContainer/ObjContainerRepository.h"
|
||||
#include "Zone/Zone.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class IPak final : public ObjContainerReferenceable
|
||||
{
|
||||
static const uint32_t MAGIC;
|
||||
static const uint32_t VERSION;
|
||||
|
||||
std::string m_path;
|
||||
FileAPI::IFile* m_file;
|
||||
|
||||
bool m_initialized;
|
||||
|
||||
IPakSection* m_index_section;
|
||||
IPakSection* m_data_section;
|
||||
|
||||
std::vector<IPakIndexEntry> m_index_entries;
|
||||
|
||||
static uint32_t R_HashString(const char* str, uint32_t hash);
|
||||
|
||||
void ReadSection();
|
||||
void ReadHeader();
|
||||
class Impl;
|
||||
Impl* m_impl;
|
||||
|
||||
public:
|
||||
typedef uint32_t Hash;
|
||||
|
||||
static ObjContainerRepository<IPak, Zone> Repository;
|
||||
|
||||
IPak(std::string path, FileAPI::IFile* file);
|
||||
@ -36,9 +20,9 @@ public:
|
||||
|
||||
std::string GetName() override;
|
||||
|
||||
void Initialize();
|
||||
FileAPI::IFile* GetEntryData(IPakHash nameHash, IPakHash dataHash);
|
||||
bool Initialize() const;
|
||||
FileAPI::IFile* GetEntryData(Hash nameHash, Hash dataHash) const;
|
||||
|
||||
static IPakHash HashString(const std::string& str);
|
||||
static IPakHash HashData(const void* data, size_t dataSize);
|
||||
static Hash HashString(const std::string& str);
|
||||
static Hash HashData(const void* data, size_t dataSize);
|
||||
};
|
||||
|
Reference in New Issue
Block a user