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

Unity-like asset database for editor tools. More...

#include <AssetDatabase.h>

Static Public Member Functions

static void Initialize (AssetPipeline *pipeline)
 Initialize with pipeline (called by EditorApp at startup).
static void Shutdown ()
 Shutdown (called by EditorApp at exit).
static void ImportAsset (const std::string &path)
 Import/reimport a specific asset.
static void Refresh ()
 Refresh all changed assets.
static std::string AssetPathToGUID (const std::string &path)
 Get GUID for an asset path.
static std::string GUIDToAssetPath (const std::string &guid)
 Get asset path from GUID.
static std::string GUIDToAbsolutePath (const std::string &guid)
 Get absolute asset path from GUID.
static const SubAssetInfoGetSubAsset (const std::string &guid)
 Get sub-asset info by GUID.
static const std::vector< SubAssetInfo > * GetSubAssets (const std::string &parentGuid)
 Get all sub-assets for a parent asset.
static void GetSpritesheetAssets (std::vector< std::pair< std::string, std::string > > &outAssets)
 Get all texture assets with sub-assets (spritesheets).

Detailed Description

Unity-like asset database for editor tools.

Provides static methods for importing assets and GUID lookups. Tools call these directly without needing to know about AssetPipeline.

Usage: DekiEditor::AssetDatabase::ImportAsset("assets/sprites/player.png"); std::string guid = DekiEditor::AssetDatabase::AssetPathToGUID("assets/sprites/player.png");

Member Function Documentation

◆ Initialize()

void DekiEditor::AssetDatabase::Initialize ( AssetPipeline * pipeline)
static

Initialize with pipeline (called by EditorApp at startup).

◆ Shutdown()

void DekiEditor::AssetDatabase::Shutdown ( )
static

Shutdown (called by EditorApp at exit).

◆ ImportAsset()

void DekiEditor::AssetDatabase::ImportAsset ( const std::string & path)
static

Import/reimport a specific asset.

Parameters
pathProject-relative path (e.g., "assets/sprites/player.png")

Triggers cache rebuild for the asset.

◆ Refresh()

void DekiEditor::AssetDatabase::Refresh ( )
static

Refresh all changed assets.

Scans for modified files and reimports them.

◆ AssetPathToGUID()

std::string DekiEditor::AssetDatabase::AssetPathToGUID ( const std::string & path)
static

Get GUID for an asset path.

Parameters
pathProject-relative path
Returns
Asset GUID, or empty string if not found

◆ GUIDToAssetPath()

std::string DekiEditor::AssetDatabase::GUIDToAssetPath ( const std::string & guid)
static

Get asset path from GUID.

Parameters
guidAsset GUID
Returns
Project-relative path, or empty string if not found

◆ GUIDToAbsolutePath()

std::string DekiEditor::AssetDatabase::GUIDToAbsolutePath ( const std::string & guid)
static

Get absolute asset path from GUID.

Parameters
guidAsset GUID
Returns
Absolute path, or empty string if not found

◆ GetSubAsset()

const SubAssetInfo * DekiEditor::AssetDatabase::GetSubAsset ( const std::string & guid)
static

Get sub-asset info by GUID.

Parameters
guidSub-asset GUID
Returns
Pointer to SubAssetInfo or nullptr

◆ GetSubAssets()

const std::vector< SubAssetInfo > * DekiEditor::AssetDatabase::GetSubAssets ( const std::string & parentGuid)
static

Get all sub-assets for a parent asset.

Parameters
parentGuidParent asset's GUID
Returns
Pointer to vector of sub-assets, or nullptr if parent has no sub-assets

◆ GetSpritesheetAssets()

void DekiEditor::AssetDatabase::GetSpritesheetAssets ( std::vector< std::pair< std::string, std::string > > & outAssets)
static

Get all texture assets with sub-assets (spritesheets).

Parameters
outAssetsVector to populate with texture assets that have sub-assets

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