mirror of
https://github.com/PodeCaradox/GalaxyQuest-SteamFrame.git
synced 2026-10-23 09:01:25 +02:00
The sources of Petari (https://github.com/SMGCommunity/Petari), the Super Mario Galaxy decompilation by the SMGCommunity, at commit 0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and src/. Left out: the game data Petari keeps from the original executable, the error message archive (include/Game/System/ ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's own disc. The port's changes follow in the next commit, so `git diff petari-base -- decomp` shows them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.9 KiB
C++
55 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "Game/Util/Array.hpp"
|
|
#include <JSystem/JKernel/JKRMemArchive.hpp>
|
|
#include <revolution/types.h>
|
|
|
|
class ArchiveHolderArchiveEntry {
|
|
public:
|
|
/// @brief Creates a new `ArchiveHolderArchiveEntry`.
|
|
ArchiveHolderArchiveEntry(void*, JKRHeap*, const char*);
|
|
|
|
/// @brief Destroys the `ArchiveHolderArchiveEntry`.
|
|
~ArchiveHolderArchiveEntry();
|
|
|
|
/* 0x0 */ JKRMemArchive* mArchive;
|
|
/* 0x4 */ JKRHeap* mHeap;
|
|
/* 0x8 */ char* mArchiveName;
|
|
};
|
|
|
|
class ArchiveHolder {
|
|
public:
|
|
/// @brief Creates a new `ArchiveHolder`.
|
|
ArchiveHolder();
|
|
|
|
/// @brief Creates and adds a new archive entry.
|
|
/// @param pData The data for the archive.
|
|
/// @param pHeap The heap to allocate the archive in.
|
|
/// @param pArchiveName The name of the archive.
|
|
/// @return The pointer to the created entry.
|
|
ArchiveHolderArchiveEntry* createAndAdd(void*, JKRHeap*, const char*);
|
|
|
|
/// @brief Gets the archive for the given archive name.
|
|
/// @param pArchiveName The name of the archive.
|
|
/// @return The pointer to the found archive, or `nullptr` if not found.
|
|
JKRMemArchive* getArchive(const char*) const;
|
|
|
|
/// @brief Gets the archive and heap for the given archive name.
|
|
/// @param pArchiveName The name of the archive.
|
|
/// @param pArchive The output pointer for the archive.
|
|
/// @param pHeap The output pointer for the heap.
|
|
void getArchiveAndHeap(const char*, JKRArchive**, JKRHeap**) const;
|
|
|
|
/// @brief Removes entries that match the given heap.
|
|
/// @param pHeap The heap to compare.
|
|
void removeIfIsEqualHeap(JKRHeap*);
|
|
|
|
/// @brief Finds the entry with the given archive name.
|
|
/// @param pArchiveName The name of the archive.
|
|
/// @return The pointer to the found entry, or `nullptr` if not found.
|
|
ArchiveHolderArchiveEntry* findEntry(const char*) const;
|
|
|
|
/* 0x0 */ MR::Vector< MR::AssignableArray< ArchiveHolderArchiveEntry* > > mEntries;
|
|
/* 0xC */ OSMutex mMutex;
|
|
};
|