12#define POD_ENTRY_NAME_SIZE 64
14#define POD_PATH_SIZE 0x400
16#define POD_WRITER_ENTRY_COUNT 4096
18#define POD_FILE_VERSION 500
121 void ClearPodArchive();
128 unsigned dwDirectorySize;
149 virtual void CleanupName(
const char *pszPath,
char *pszName);
159 virtual int FindPodIndexByName(
const char *pszPath);
169 virtual int GetPodIndexByName(
const char *pszPath);
179 virtual unsigned GetPodLength(
unsigned nIndex);
189 virtual void ReadPodBytesFromFile(
unsigned nIndex,
void *pBuffer);
213 virtual void *LoadPodEntryByIndex(
unsigned nIndex,
void *pBuffer);
223 virtual void *AllocAndLoadPodByName(
const char *pszPath);
233 virtual void *AllocAndLoadPodByIndex(
unsigned nIndex);
254 virtual void CreatePodFile(
const char *pszPath);
268 AddPodEntry(
const char *pszPath,
const void *pData,
unsigned dwSize,
char bAttrA,
char bAttrB);
276 virtual void FinalizePodFile();
313#if TGR_PLATFORM == TGR_PLATFORM_SDL
A pod file the game reads, and the writer of one.
Definition podarchive.h:119
virtual void * LoadPodByName(const char *pszPath, void *pBuffer)
Read the data of the entry of a path.
virtual void ClosePodFile()
Close the file, free the directory, and clear the archive and its path.
PodArchive()
An archive without a file.
virtual void OpenPodFile()
Open the pod file of the path to read, and read its header and directory.
void SetFilePath(const char *pszPath)
Set the path of the file of the archive.
virtual ~PodArchive()
Do nothing.
The files a pod archive reads and writes.
Definition podarchive.h:39
FILE * FileOpenBinaryWriteOrFatal(const char *pszPath)
Create a file to write.
FILE * FileOpenBinaryReadOrFatal(const char *pszPath)
Open a file to read.
void ExtractFileName(const char *pszPath, char *pszName)
Copy the part of a path after its last backslash.
PodFileHelper()
Initialise the archive helper without opening a file.
void FileReadExactOrFatal(FILE *pFile, void *pBuffer, unsigned dwSize)
Read an exact number of bytes from a file.
void FileWriteChecked(FILE *pFile, const void *pBuffer, unsigned dwSize)
Write an exact number of bytes to a file.
bool ReadImportedPodEntry(const char *pszPath, void *pBuffer)
Read an entry of BossRally.pod from its import, the directory BossRally of the default assets,...
#define POD_ENTRY_NAME_SIZE
The size of the name of an entry of a pod file.
Definition podarchive.h:12
void FatalErrorWithMessage(const char *pszFormat,...)
Format a message of an error that is not shown, and end the game.
#define POD_PATH_SIZE
The size of the path of a pod file.
Definition podarchive.h:14
PodArchive g_BossRallyPodArchive
The archive of the data of the game.
An entry of the directory of a pod file.
Definition podarchive.h:29
unsigned dwSize
Definition podarchive.h:31
unsigned char bAttrA
Definition podarchive.h:32
int32_t dwOffset
Definition podarchive.h:30
char szName[POD_ENTRY_NAME_SIZE]
Definition podarchive.h:35
unsigned char bAttrB
Definition podarchive.h:33
char abUnknownA[2]
Definition podarchive.h:34