Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Archive.hh
1
#pragma once
2
3
#include <
Common.hh
>
4
5
#include <abstract/Archive.hh>
6
#include <abstract/memory/List.hh>
7
8
namespace
Kinoko {
9
10
namespace
Host {
11
12
class
Context;
13
14
}
// namespace Host
15
16
namespace
Abstract::Memory {
17
18
struct
MEMList;
19
20
}
// namespace Abstract::Memory
21
23
namespace
EGG {
24
25
class
Archive
:
Disposer
{
26
friend
class
Host::Context
;
27
28
public
:
29
~Archive
();
30
31
void
unmount();
32
[[nodiscard]] s32 convertPathToEntryId(
const
char
*path)
const
;
33
void
*getFileFast(s32 entryId,
Abstract::ArchiveHandle::FileInfo
&info)
const
;
34
35
[[nodiscard]]
static
Archive
*
FindArchive
(
void
*archiveStart);
36
[[nodiscard]]
static
Archive
*
Mount
(
void
*archiveStart);
37
38
private
:
39
Archive
(
void
*archiveStart);
40
41
[[nodiscard]]
static
constexpr
uintptr_t GetLinkOffset() {
42
// offsetof doesn't work, so instead of hardcoding an offset, we derive it ourselves
43
return
reinterpret_cast<
uintptr_t
>
(&
reinterpret_cast<
Archive
*
>
(NULL)->m_link);
44
}
45
46
Abstract::ArchiveHandle
m_handle;
47
s32 m_refCount = 1;
48
Abstract::Memory::MEMLink
m_link;
49
50
static
Abstract::Memory::MEMList
s_archiveList
;
51
};
52
53
}
// namespace EGG
54
55
}
// namespace Kinoko
Common.hh
This header houses common data types such as our integral types and enums.
Kinoko::Abstract::ArchiveHandle
Definition
Archive.hh:11
Kinoko::EGG::Archive
Definition
Archive.hh:25
Kinoko::EGG::Archive::~Archive
~Archive()
Removes the archive from the static list.
Definition
Archive.cc:11
Kinoko::EGG::Archive::s_archiveList
static Abstract::Memory::MEMList s_archiveList
The linked list of all mounted archives.
Definition
Archive.hh:50
Kinoko::EGG::Archive::Mount
static Archive * Mount(void *archiveStart)
Creates a new Archive object or increments the ref count for an already existing Archive.
Definition
Archive.cc:53
Kinoko::EGG::Archive::FindArchive
static Archive * FindArchive(void *archiveStart)
Checks to see if a given archive is already mounted.
Definition
Archive.cc:37
Kinoko::EGG::Disposer
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition
Disposer.hh:11
Kinoko::Host::Context
Contexts can be used to restore a previous memory state for the current session.
Definition
Context.hh:71
Kinoko::Abstract::ArchiveHandle::FileInfo
Definition
Archive.hh:50
Kinoko::Abstract::Memory::MEMLink
Link of an intrusive doubly-linked list.
Definition
List.hh:8
Kinoko::Abstract::Memory::MEMList
Intrusive doubly-linked list. Links are placed within the corresponding object.
Definition
List.hh:14
egg
core
Archive.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.12.0