Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Burger::RezFile Class Reference

Rez file manager. More...

Collaboration diagram for Burger::RezFile:
Collaboration graph
[legend]

Classes

struct  FilenameToRezNum_t
 Sorted list of filenames. More...
 
struct  FileRezEntry_t
 Data image of a resource entry. More...
 
struct  FileRezGroup_t
 Data image of a resource group. More...
 
struct  RezEntry_t
 Data to describe each individual resource in memory. More...
 
struct  RezGroup_t
 Data to describe a group of resources in memory. More...
 
struct  RootHeader_t
 Data image for the start of a Rez file. More...
 

Public Types

enum  {
  MAXCODECS =3 , ROOTHEADERSIZE = static_cast<int>(sizeof(uint32_t)*2)+(MAXCODECS*4)+4 , ENTRYFLAGSNAMEOFFSETMASK =0x0007FFFF , ENTRYFLAGSDECOMPMASK =0x00180000 ,
  ENTRYFLAGSHIGHMEMORY =0x00200000 , ENTRYFLAGSREFCOUNT =0xFF000000 , ENTRYFLAGSREFSHIFT =24 , ENTRYFLAGSREFADD =(1<<ENTRYFLAGSREFSHIFT) ,
  ENTRYFLAGSDECOMPSHIFT =19
}
 

Public Member Functions

 RezFile (MemoryManagerHandle *pMemoryManager)
 Initialize the RezFile class to a power up state.
 
 ~RezFile ()
 Dispose of all allocated resources.
 
uint_t Init (const char *pFileName, uint32_t uStartOffset=0)
 Open a resource file for reading.
 
void Shutdown (void)
 Dispose of the contents of a resource file.
 
void PurgeCache (void)
 Release all cached memory.
 
uint_t SetExternalFlag (uint_t bEnable)
 Enable or disable reading external files.
 
uint_t GetExternalFlag (void) const
 Return the state of reading external files.
 
void LogDecompressor (uint_t uCompressID, Decompress *pProc)
 Log a resource decompressor.
 
uint_t GetRezNum (const char *pRezName) const
 Given a resource name, return the resource number.
 
uint_t GetName (uint_t uRezNum, char *pBuffer, uintptr_t uBufferSize) const
 Return the filename associated with a resource number.
 
uint_t AddName (const char *pRezName)
 Add a new filename to be managed by the RezFile.
 
void Remove (uint_t uRezNum)
 Remove a resource from the rez file.
 
void Remove (const char *pRezName)
 Remove a resource from the rez file by name.
 
const FilenameToRezNum_tGetNameArray (void) const
 Get the pointer to the list of filenames managed by the RezFile.
 
uint_t GetNameArraySize (void) const
 Return the number of elements returned by Burger::RezFile::GetNameArray(void) const.
 
uint_t GetLowestRezNum (void) const
 Return the lowest valid resource number.
 
uint_t GetHighestRezNum (void) const
 Return the highest valid resource number.
 
uintptr_t GetSize (uint_t uRezNum) const
 Return the size of bytes of the resource.
 
uintptr_t GetCompressedSize (uint_t uRezNum) const
 Return the size of bytes of the resource.
 
uint_t GetIDFromHandle (const void **ppRez, uint_t *pRezNum, char *pBuffer, uintptr_t uBufferSize) const
 Find a resource by a data handle.
 
uint_t GetIDFromPointer (const void *pRez, uint_t *pRezNum, char *pBuffer, uintptr_t uBufferSize) const
 Find a resource by a data pointer.
 
void ** LoadHandle (uint_t uRezNum, uint_t *pLoadedFlag=0)
 Load in a resource and return the handle.
 
void ** LoadHandle (const char *pRezName, uint_t *pLoadedFlag=0)
 Load in a resource and return the handle.
 
voidLoad (uint_t uRezNum, uint_t *pLoadedFlag=0)
 Load in a resource.
 
voidLoad (const char *pRezName, uint_t *pLoadedFlag=0)
 Load in a resource.
 
uint_t Read (uint_t uRezNum, void *pBuffer, uintptr_t uBufferSize)
 Load in a resource into a static buffer.
 
uint_t Read (const char *pRezName, void *pBuffer, uintptr_t uBufferSize)
 Load in a resource into a static buffer.
 
void Release (uint_t uRezNum)
 Reduce the data reference count.
 
void Release (const char *pRezName)
 Reduce the data reference count.
 
void Kill (uint_t uRezNum)
 Destroy the data associated with a resource.
 
void Kill (const char *pRezName)
 Destroy the data associated with a resource.
 
void Detach (uint_t uRezNum)
 Detach the data associated with a resource.
 
void Detach (const char *pRezName)
 Detach the data associated with a resource.
 
void Preload (uint_t uRezNum)
 Preload in a resource.
 
void Preload (const char *pRezName)
 Preload in a resource.
 

Static Public Member Functions

static RezFileNew (MemoryManagerHandle *pMemoryManager, const char *pFileName, uint32_t uStartOffset=0)
 Create a new RezFile instance.
 

Static Public Attributes

static const char g_RezFileSignature [4] = {'B','R','G','R'}
 'BRGR'
 
static const uint_t INVALIDREZNUM = static_cast<uint_t>(-1)
 Illegal resource number, used as an error code.
 

Private Types

enum  {
  MAXBUFFER = 65536 , REZOFFSETFIXED =0x80000000 , REZOFFSETDECOMPMASK =0x60000000 , REZOFFSETMASK =0x1FFFFFFF ,
  REZOFFSETDECOMPSHIFT =29 , ENTRYFLAGSTESTED =0x00000001 , ENTRYFLAGSFILEFOUND =0x0000002 , SWAPENDIAN =0x01 ,
  OLDFORMAT =0x02
}
 

Private Member Functions

 RezFile (const RezFile &)=delete
 
RezFileoperator= (const RezFile &)=delete
 
 RezFile (RezFile &&)=delete
 
RezFileoperator= (RezFile &&)=delete
 
uintptr_t GetRezGroupBytes (void) const
 Calculate the number of bytes m_pGroups occupies.
 
void AdjustNamePointers (uintptr_t uAdjust)
 Adjust pointers for text strings.
 
RezEntry_tFind (uint_t uRezNum) const
 Locate a resource entry by using a resource number.
 
uint_t FindName (const char *pRezName, FilenameToRezNum_t **ppOutput) const
 Find a resource number from a resource name.
 
void ProcessRezNames (void)
 Create a hash table for all of the filenames.
 
void FixupFilenames (char *pText)
 Compact and sort the filenames when a name is inserted or deleted.
 

Static Private Member Functions

static int QSortNames (const void *pFirst, const void *pSecond)
 Used to sort between filenames.
 
static RezGroup_tParseRezFileHeader (const uint8_t *pData, const RootHeader_t *pHeader, uint_t uSwapFlag, uint32_t uStartOffset)
 Create the in memory rez file dictionary from a file image.
 

Private Attributes

Decompressm_Decompressors [MAXCODECS]
 Decompressor functions.
 
File m_File
 Open file reference.
 
MemoryManagerHandlem_pMemoryManager
 Pointer to the handle based memory manager to use.
 
uint32_t m_uGroupCount
 Number of resource groups.
 
uint32_t m_uRezNameCount
 Number of resource names in m_pRezNames.
 
RezGroup_tm_pGroups
 Array of resource groups.
 
FilenameToRezNum_tm_pRezNames
 Pointer to sorted resource names if present.
 
uint_t m_bExternalFileEnabled
 TRUE if external file access is enabled
 

Detailed Description

Rez file manager.


Using the tool MakeRez, an archive file can be generated and quickly used to access data used by a game or application

The manager has the ability to load compressed data and decompress it on the fly if need be. The high level code has no need to know where the data is coming from and how it's cached in memory for performance

Member Enumeration Documentation

◆ anonymous enum

Enumerator
MAXCODECS 

Maximum number of compression codecs available.

ROOTHEADERSIZE 

Size of RootHeader_t on disk.

ENTRYFLAGSNAMEOFFSETMASK 

Filename offset.

ENTRYFLAGSDECOMPMASK 

Mask for decompressors (2 bits)

ENTRYFLAGSHIGHMEMORY 

True if load in fixed memory.

ENTRYFLAGSREFCOUNT 

Refcount mask.

ENTRYFLAGSREFSHIFT 

Bits to shift for the refcount.

ENTRYFLAGSREFADD 

1 in refcount format

ENTRYFLAGSDECOMPSHIFT 

Shift value to get the decompression type index (2 bits)

◆ anonymous enum

anonymous enum
private
Enumerator
MAXBUFFER 

Size of decompression buffer.

REZOFFSETFIXED 

True if load in fixed memory.

REZOFFSETDECOMPMASK 

Mask for decompressors.

REZOFFSETMASK 

Big enough for 1 Gig file (GD-ROM or CDRom)

REZOFFSETDECOMPSHIFT 

Decompressor mask shift value (Matches REZOFFSETDECOMPMASK)

ENTRYFLAGSTESTED 

True if the filename was checked.

ENTRYFLAGSFILEFOUND 

True if a file was found.

SWAPENDIAN 

Manually swap endian.

OLDFORMAT 

Parsing an old rez file format.

Constructor & Destructor Documentation

◆ RezFile() [1/3]

Burger::RezFile::RezFile ( const RezFile & )
privatedelete

◆ RezFile() [2/3]

Burger::RezFile::RezFile ( RezFile && )
privatedelete

◆ RezFile() [3/3]

Burger::RezFile::RezFile ( Burger::MemoryManagerHandle * pMemoryManager)

Initialize the RezFile class to a power up state.


This constructor initializes the variables to ensure the structure doesn't have dangling pointers

Parameters
pMemoryManagerPointer to a valid handle based memory manager

◆ ~RezFile()

Burger::RezFile::~RezFile ( )

Dispose of all allocated resources.


Close any open files and release all memory. Any pointers that were given to the application from this RezFile will now be considered invalid.

See also
Burger::RezFile::Shutdown()

Member Function Documentation

◆ AddName()

uint_t BURGER_API Burger::RezFile::AddName ( const char * pRezName)

Add a new filename to be managed by the RezFile.


If the named resource doesn't already exist in the resource dictionary, insert it into the first free slot.

There is no check performed to see if the file exists. The name is added to the dictionary.

Returns
New or previous resource ID number or RezFile::INVALIDREZNUM if an error of some kind occurs.

◆ AdjustNamePointers()

void BURGER_API Burger::RezFile::AdjustNamePointers ( uintptr_t uAdjust)
private

Adjust pointers for text strings.


Traverse all of the in memory RezGroup_t structures, adjust the offsets for all the string pointers based on the new data padding difference from the file image and the in memory image

Parameters
uAdjustNumber of bytes to add to all of the string offsets

◆ Detach() [1/2]

void BURGER_API Burger::RezFile::Detach ( const char * pRezName)

Detach the data associated with a resource.


Release responsibility for this resource to the application.

Parameters
pRezNameResource name

◆ Detach() [2/2]

void BURGER_API Burger::RezFile::Detach ( uint_t uRezNum)

Detach the data associated with a resource.


Release responsibility for this resource to the application.

Parameters
uRezNumResource number

◆ Find()

Burger::RezFile::RezEntry_t *BURGER_API Burger::RezFile::Find ( uint_t uRezNum) const
private

Locate a resource entry by using a resource number.


Scan for a resource entry in the resource map.

Parameters
uRezNumResource item number
Returns
NULL if resource does not exist, a valid Burger::RezFile::RezEntry_t pointer if so.
See also
Burger::RezFile::FindName()

◆ FindName()

uint_t BURGER_API Burger::RezFile::FindName ( const char * pRezName,
FilenameToRezNum_t ** ppOutput ) const
private

Find a resource number from a resource name.


Using a resource name list (Sorted so that a binary search can be performed), look if there is a match in the resource list Return TRUE if an entry was found, FALSE if there was no match. However, if FALSE is returned, then the entry that will FOLLOW the string is returned for new entry insertion

Parameters
pRezNamePointer to a "C" string of the requested filename
ppOutputPointer to accept the pointer to the matching Burger::RezFile::FilenameToRezNum_t structure
Returns
TRUE if the name was found, FALSE if not

◆ FixupFilenames()

void BURGER_API Burger::RezFile::FixupFilenames ( char * pText)
private

Compact and sort the filenames when a name is inserted or deleted.


The filenames are stored sorted to enable a quick lookup via a binary search. When filenames are added or removed at runtime, a fixup may be necessary.

Parameters
pTextPointer to the array of filenames to insert or compact

◆ GetCompressedSize()

uintptr_t BURGER_API Burger::RezFile::GetCompressedSize ( uint_t uRezNum) const

Return the size of bytes of the resource.


Parameters
uRezNumResource number
Returns
0 if the resource was not found or the size in bytes of the resource
See also
GetSize(uint_t) const

◆ GetExternalFlag()

uint_t Burger::RezFile::GetExternalFlag ( void ) const
inline

Return the state of reading external files.


Returns
Current flag state, TRUE or FALSE
See also
uint_t Burger::RezFile::SetExternalFlag(uint_t)

◆ GetHighestRezNum()

uint_t BURGER_API Burger::RezFile::GetHighestRezNum ( void ) const

Return the highest valid resource number.


Returns
Highest resource number or INVALIDREZNUM on error (Or no resources present)
See also
GetLowestRezNum(void) const

◆ GetIDFromHandle()

uint_t BURGER_API Burger::RezFile::GetIDFromHandle ( const void ** ppRez,
uint_t * pRezNum,
char * pBuffer,
uintptr_t uBufferSize ) const

Find a resource by a data handle.


Given a handle, scan the resource map to see if it is under Resource manager control. If so, return the resource ID number and the resource name. Return error code if not present (Right now it's TRUE), otherwise return zero for no error if I found it.

Parameters
ppRezHandle to the memory to check for
pRezNumPointer to a uint_t to receive the valid resource number
pBufferPointer to a buffer to hold the name of the resource
uBufferSizeNumber of bytes in size for the resource name buffer
Returns
FALSE if found, TRUE if not found

◆ GetIDFromPointer()

uint_t BURGER_API Burger::RezFile::GetIDFromPointer ( const void * pRez,
uint_t * pRezNum,
char * pBuffer,
uintptr_t uBufferSize ) const

Find a resource by a data pointer.


Given a pointer, scan the resource map to see if it is under Resource manager control. If so, return the resource ID number and the resource name. Return error code if not present (Right now it's TRUE), otherwise return zero for no error if I found it.

Parameters
pRezPointer to the memory to check for
pRezNumPointer to a uint_t to receive the valid resource number
pBufferPointer to a buffer to hold the name of the resource
uBufferSizeNumber of bytes in size for the resource name buffer
Returns
FALSE if found, TRUE if not found

◆ GetLowestRezNum()

uint_t BURGER_API Burger::RezFile::GetLowestRezNum ( void ) const

Return the lowest valid resource number.


Returns
Lowest resource number or RezFile::INVALIDREZNUM on error (Or no resources present)
See also
Burger::RezFile::GetHighestRezNum(void) const

◆ GetName()

uint_t BURGER_API Burger::RezFile::GetName ( uint_t uRezNum,
char * pBuffer,
uintptr_t uBufferSize ) const

Return the filename associated with a resource number.


Parameters
uRezNumResource number
pBufferPointer to a buffer to receive the filename string
uBufferSizeSize, in bytes, of the buffer to receive the filename string
Returns
FALSE if no error occurred. Non zero error code if the name wasn't found.
See also
uint_t Burger::RezFile::GetRezNum(const char *) const

◆ GetNameArray()

const Burger::RezFile::FilenameToRezNum_t * Burger::RezFile::GetNameArray ( void ) const
inline

Get the pointer to the list of filenames managed by the RezFile.


Note
This pointer is valid as long as no filenames are added or removed.
See also
Burger::RezFile::GetNameArraySize(void) const

◆ GetNameArraySize()

uint_t Burger::RezFile::GetNameArraySize ( void ) const
inline

◆ GetRezGroupBytes()

uintptr_t BURGER_API Burger::RezFile::GetRezGroupBytes ( void ) const
private

Calculate the number of bytes m_pGroups occupies.


By traversing a valid RezGroup_t, determine the number of bytes it would take to store a RezGroup_t structure (Used for rebuilding the structure when an entry is added or removed)

Returns
The number of bytes the RezGroup_t data is occupying.

◆ GetRezNum()

uint_t BURGER_API Burger::RezFile::GetRezNum ( const char * pRezName) const

Given a resource name, return the resource number.


Scan the entries for the filename and return the resource entry number

Parameters
pRezNamePointer to a "C" string with the filename to locate in the rez file
Returns
RezFile::INVALIDREZNUM on error or a valid resource number if the resource was found.
See also
uint_t Burger::RezFile::GetName(uint_t,char *,uintptr_t) const

◆ GetSize()

uintptr_t BURGER_API Burger::RezFile::GetSize ( uint_t uRezNum) const

Return the size of bytes of the resource.


Parameters
uRezNumResource number
Returns
0 if the resource was not found or the size in bytes of the resource
See also
GetCompressedSize(uint_t) const

◆ Init()

uint_t BURGER_API Burger::RezFile::Init ( const char * pFileName,
uint32_t uStartOffset = 0 )

Open a resource file for reading.


Parameters
pFileNamePointer to "C" string of the filename to open
uStartOffsetOffset from the start of the file where the rezfile image resides. Normally zero.
Returns
FALSE if no error occurred. A non-zero value (error code) if it couldn't open the file

◆ Kill() [1/2]

void BURGER_API Burger::RezFile::Kill ( const char * pRezName)

Destroy the data associated with a resource.


Release all memory associated with this specific resource

Parameters
pRezNameResource name

◆ Kill() [2/2]

void BURGER_API Burger::RezFile::Kill ( uint_t uRezNum)

Destroy the data associated with a resource.


Release all memory associated with this specific resource

Parameters
uRezNumResource number

◆ Load() [1/2]

void *BURGER_API Burger::RezFile::Load ( const char * pRezName,
uint_t * pLoadedFlag = 0 )

Load in a resource.


Parameters
pRezNameResource name
pLoadedFlagPointer to a uint_t that's set to TRUE if the data was freshly loaded or FALSE if it's a cached copy
Returns
NULL if the data was not found or a valid handle with the data

◆ Load() [2/2]

void *BURGER_API Burger::RezFile::Load ( uint_t uRezNum,
uint_t * pLoadedFlag = 0 )

Load in a resource.


Parameters
uRezNumResource number
pLoadedFlagPointer to a uint_t that's set to TRUE if the data was freshly loaded or FALSE if it's a cached copy
Returns
NULL if the data was not found or a valid handle with the data

◆ LoadHandle() [1/2]

void **BURGER_API Burger::RezFile::LoadHandle ( const char * pRezName,
uint_t * pLoadedFlag = 0 )

Load in a resource and return the handle.


Note
The returned handle is NOT locked.
Parameters
pRezNameResource name
pLoadedFlagPointer to a uint_t that's set to TRUE if the data was freshly loaded or FALSE if it's a cached copy
Returns
NULL if the data was not found or a valid handle with the data

◆ LoadHandle() [2/2]

void **BURGER_API Burger::RezFile::LoadHandle ( uint_t uRezNum,
uint_t * pLoadedFlag = 0 )

Load in a resource and return the handle.


Note
The returned handle is NOT locked.
Parameters
uRezNumResource number
pLoadedFlagPointer to a uint_t that's set to TRUE if the data was freshly loaded or FALSE if it's a cached copy
Returns
NULL if the data was not found or a valid handle with the data

◆ LogDecompressor()

void BURGER_API Burger::RezFile::LogDecompressor ( uint_t uCompressID,
Burger::Decompress * pProc )

Log a resource decompressor.


Parameters
uCompressIDCompressor ID (1-3)
pProcPointer to a decompression codec

◆ New()

Burger::RezFile *BURGER_API Burger::RezFile::New ( Burger::MemoryManagerHandle * pMemoryManager,
const char * pFileName,
uint32_t uStartOffset = 0 )
static

Create a new RezFile instance.


Allocate memory using Burger::Alloc() and initialize a RezFile with it.

Parameters
pMemoryManagerPointer to a valid handle based memory manager
pFileNamePointer to a "C" string of a filename to a rez file
uStartOffsetOffset in bytes from the start of the file where the rezfile image resides. Normally this is zero.
Returns
NULL if out of memory or the file is not a valid rezfile
See also
Burger::Delete(const RezFile *)

◆ operator=() [1/2]

RezFile & Burger::RezFile::operator= ( const RezFile & )
privatedelete

◆ operator=() [2/2]

RezFile & Burger::RezFile::operator= ( RezFile && )
privatedelete

◆ ParseRezFileHeader()

Burger::RezFile::RezGroup_t *BURGER_API Burger::RezFile::ParseRezFileHeader ( const uint8_t * pData,
const RootHeader_t * pHeader,
uint_t uSwapFlag,
uint32_t uStartOffset )
staticprivate

Create the in memory rez file dictionary from a file image.


Note
To support the old data type where there were unique types in addition to ID's. A hack was applied that will remap type "5" to ID+5000. This way old games like Killing Time can use the new burgerlib without having to update the .REZ files.
Parameters
pDataPointer to the Rez File image
pHeaderPointer to the parsed file header
uSwapFlagTRUE if endian should be swapped
uStartOffsetNumber of bytes the header was from the start of file (For data index offset adjustments)
Returns
A newly allocated Burger::RezFile::RezGroup_t * with all the data found from the file image

◆ Preload() [1/2]

void BURGER_API Burger::RezFile::Preload ( const char * pRezName)

Preload in a resource.


Load in the resource data and then immediate release it and keep it in the cache

If the resource name is not in the dictionary, add it.

Parameters
pRezNameResource name

◆ Preload() [2/2]

void BURGER_API Burger::RezFile::Preload ( uint_t uRezNum)

Preload in a resource.


Load in the resource data and then immediate release it and keep it in the cache

Parameters
uRezNumResource number

◆ ProcessRezNames()

void BURGER_API Burger::RezFile::ProcessRezNames ( void )
private

Create a hash table for all of the filenames.


Release the previous m_pRezNames array and create a new one from scratch. m_pRezNames contains a sorted filename lookup list that is used by Burger::RezFile::FindName(const char *,RezFile::FilenameToRezNum_t **) const to quickly look up a resource entry

See also
Burger::RezFile::FindName(const char *,RezFile::FilenameToRezNum_t **) const

◆ PurgeCache()

void BURGER_API Burger::RezFile::PurgeCache ( void )

Release all cached memory.


Scan all entries in the resource map and dispose of all the entries that loaded in the cache but not actually discarded. I will only dispose of unlocked purgable handles This is useful before a level or map load to help prevent memory fragmentation in low memory situations. Not really needed to call this routine unless memory is a a premium.

◆ QSortNames()

int BURGER_ANSIAPI Burger::RezFile::QSortNames ( const void * pFirst,
const void * pSecond )
staticprivate

Used to sort between filenames.


Called by qsort()

Parameters
pFirstFirst FilenameToRezNum_t * to compare
pSecondSecond FilenameToRezNum_t * to compare
Returns
Result of a call to StringCaseCompare(const char *,const char *) for sorting
See also
Burger::StringCaseCompare(const char *,const char *)

◆ Read() [1/2]

uint_t BURGER_API Burger::RezFile::Read ( const char * pRezName,
void * pBuffer,
uintptr_t uBufferSize )

Load in a resource into a static buffer.


Parameters
pRezNameResource name
pBufferPointer to the buffer to copy the data to
uBufferSizeNumber of bytes for the buffer to store the data into
Returns
FALSE if no error or non-zero if it failed to load

◆ Read() [2/2]

uint_t BURGER_API Burger::RezFile::Read ( uint_t uRezNum,
void * pBuffer,
uintptr_t uBufferSize )

Load in a resource into a static buffer.


Parameters
uRezNumResource number
pBufferPointer to the buffer to copy the data to
uBufferSizeNumber of bytes for the buffer to store the data into
Returns
FALSE if no error or non-zero if it failed to load

◆ Release() [1/2]

void BURGER_API Burger::RezFile::Release ( const char * pRezName)

Reduce the data reference count.


Release a resource by marking it purgeable and leave it in the cache.

Parameters
pRezNameResource name

◆ Release() [2/2]

void BURGER_API Burger::RezFile::Release ( uint_t uRezNum)

Reduce the data reference count.


Release a resource by marking it purgeable and leave it in the cache.

Parameters
uRezNumResource number

◆ Remove() [1/2]

void BURGER_API Burger::RezFile::Remove ( const char * pRezName)

Remove a resource from the rez file by name.


Parameters
pRezNamePointer to a "C" string of the name of the resource to remove
See also
void Burger::RezFile::Remove(uint_t)

◆ Remove() [2/2]

void BURGER_API Burger::RezFile::Remove ( uint_t uRezNum)

Remove a resource from the rez file.


Look for the entry and if found, it will be removed from the resource dictionary.

Note
The resource file is not altered in any way, only the ability to access this resource is removed
Parameters
uRezNumNumber of the resource to remove
See also
Burger::RezFile::AddName(const char *) or Burger::RezFile::Remove(const char *)

◆ SetExternalFlag()

uint_t BURGER_API Burger::RezFile::SetExternalFlag ( uint_t bEnable)

Enable or disable reading external files.


Set the new state of the reading of external file and return the current state of the flag before the modification

Parameters
bEnableTRUE to enable file reading, FALSE to disable
Returns
Previous flag state
See also
uint_t Burger::RezFile::GetExternalFlag(void) const

◆ Shutdown()

void BURGER_API Burger::RezFile::Shutdown ( void )

Dispose of the contents of a resource file.


Release all resources allocated by a resource file. All pointers that have been given to the application are now all invalid.

Member Data Documentation

◆ g_RezFileSignature

const char Burger::RezFile::g_RezFileSignature = {'B','R','G','R'}
static

'BRGR'

◆ INVALIDREZNUM

const uint_t Burger::RezFile::INVALIDREZNUM = static_cast<uint_t>(-1)
static

Illegal resource number, used as an error code.

◆ m_bExternalFileEnabled

uint_t Burger::RezFile::m_bExternalFileEnabled
private

TRUE if external file access is enabled

◆ m_Decompressors

Decompress* Burger::RezFile::m_Decompressors[MAXCODECS]
private

Decompressor functions.

◆ m_File

File Burger::RezFile::m_File
private

Open file reference.

◆ m_pGroups

RezGroup_t* Burger::RezFile::m_pGroups
private

Array of resource groups.

◆ m_pMemoryManager

MemoryManagerHandle* Burger::RezFile::m_pMemoryManager
private

Pointer to the handle based memory manager to use.

◆ m_pRezNames

FilenameToRezNum_t* Burger::RezFile::m_pRezNames
private

Pointer to sorted resource names if present.

◆ m_uGroupCount

uint32_t Burger::RezFile::m_uGroupCount
private

Number of resource groups.

◆ m_uRezNameCount

uint32_t Burger::RezFile::m_uRezNameCount
private

Number of resource names in m_pRezNames.