DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
Deki::AssetLookupTable Class Reference

#include <deki/assets/AssetLookupTable.h>

Static Public Member Functions

static bool Load (const uint8_t *data, size_t size)
 Uses the table in data, which must stay valid while lookups run (it is not copied).
static void Unload ()
static bool IsLoaded ()
static const char * Lookup (uint32_t hash)
 The GUID for hash (from Hash()), or nullptr when not found.
static uint32_t Hash (const char *path, const char *type)
 FNV-1a hash of the key "path:type", such as "scenes/Demo:Scene".
static uint32_t HashString (const char *str)
 FNV-1a hash of str.
static uint32_t GetEntryCount ()
static bool ContainsGuid (const char *guid)
 True when any entry holds guid.

Member Function Documentation

◆ Load()

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

Uses the table in data, which must stay valid while lookups run (it is not copied).

Returns false when the data is not a valid table.

◆ Unload()

void Deki::AssetLookupTable::Unload ( )
static

◆ IsLoaded()

bool Deki::AssetLookupTable::IsLoaded ( )
inlinestatic

◆ Lookup()

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

The GUID for hash (from Hash()), or nullptr when not found.

◆ Hash()

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

FNV-1a hash of the key "path:type", such as "scenes/Demo:Scene".

◆ HashString()

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

FNV-1a hash of str.

◆ GetEntryCount()

uint32_t Deki::AssetLookupTable::GetEntryCount ( )
inlinestatic

◆ ContainsGuid()

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

True when any entry holds guid.

A linear scan: fine at asset load, too slow per frame.


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