Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::AssetLookupTable Class Reference

#include <AssetLookupTable.h>

Static Public Member Functions

static bool Load (const uint8_t *data, size_t size)
 Load the asset lookup table from memory.
static void Unload ()
 Unload the lookup table.
static bool IsLoaded ()
 Check if table is loaded.
static const char * Lookup (uint32_t hash)
 Look up GUID by hash (binary search).
static uint32_t Hash (const char *path, const char *type)
 Compute FNV-1a hash of a path:type key.
static uint32_t HashString (const char *str)
 Compute FNV-1a hash of a string.
static uint32_t GetEntryCount ()
 Get entry count.
static bool ContainsGuid (const char *guid)
 Check if a GUID exists in the table.

Member Function Documentation

◆ Load()

bool Deki::AssetLookupTable::Load ( const uint8_t * data,
size_t size )
static

Load the asset lookup table from memory.

The data must remain valid for the lifetime of lookups. Typically loaded from SD card or flash memory.

Parameters
dataPointer to binary table data
sizeSize of data in bytes
Returns
true on success

◆ Unload()

void Deki::AssetLookupTable::Unload ( )
static

Unload the lookup table.

◆ IsLoaded()

bool Deki::AssetLookupTable::IsLoaded ( )
inlinestatic

Check if table is loaded.

◆ Lookup()

const char * Deki::AssetLookupTable::Lookup ( uint32_t hash)
static

Look up GUID by hash (binary search).

Parameters
hashFNV-1a hash of "path:type" key
Returns
GUID string or nullptr if not found

◆ Hash()

uint32_t Deki::AssetLookupTable::Hash ( const char * path,
const char * type )
static

Compute FNV-1a hash of a path:type key.

Parameters
pathAsset path (e.g., "scenes/Demo")
typeAsset type name (e.g., "Scene")
Returns
Hash value

◆ HashString()

uint32_t Deki::AssetLookupTable::HashString ( const char * str)
static

Compute FNV-1a hash of a string.

Parameters
strString to hash
Returns
Hash value

◆ GetEntryCount()

uint32_t Deki::AssetLookupTable::GetEntryCount ( )
inlinestatic

Get entry count.

◆ ContainsGuid()

bool Deki::AssetLookupTable::ContainsGuid ( const char * guid)
static

Check if a GUID exists in the table.

Parameters
guidGUID string to find
Returns
true if GUID exists as a value in any entry

O(n) scan - acceptable for asset loading (not per-frame)


The documentation for this class was generated from the following file: