PixelBullet
0.0.1
A C++ game engine
Loading...
Searching...
No Matches
engine
src
PixelBullet
Assets
Archive.hpp
1
#pragma once
2
3
#include <cstdint>
4
#include <cstdio>
5
#include <string>
6
#include <unordered_map>
7
#include <vector>
8
9
namespace
PixelBullet
10
{
11
class
VirtualPath;
12
13
struct
FileEntry
14
{
15
uint64_t Offset;
16
uint64_t CompressedSize;
17
uint64_t UncompressedSize;
18
};
19
20
class
Archive
21
{
22
public
:
23
Archive
();
24
~Archive
();
25
27
bool
Open
(
const
VirtualPath
& archivePath);
28
31
std::vector<uint8_t>
GetAsset
(
const
std::string& assetName);
32
33
private
:
35
bool
ReadIndex();
36
37
private
:
38
FILE* m_File;
39
std::unordered_map<std::string, FileEntry> m_Index;
40
};
41
}
// namespace PixelBullet
PixelBullet::Archive
Definition
Archive.hpp:21
PixelBullet::Archive::GetAsset
std::vector< uint8_t > GetAsset(const std::string &assetName)
Definition
Archive.cpp:84
PixelBullet::Archive::Open
bool Open(const VirtualPath &archivePath)
Opens the archive at the given path and reads the index.
Definition
Archive.cpp:24
PixelBullet::VirtualPath
Definition
VirtualPath.hpp:11
PixelBullet::FileEntry
Definition
Archive.hpp:14
Generated by
1.12.0