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

Static asset import and GUID lookup for editor tools, like Unity's AssetDatabase. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/AssetDatabase.h>

Static Public Member Functions

static void Initialize (AssetPipeline *pipeline)
 Called by the editor at startup.
static void Shutdown ()
 Called by the editor at exit.
static void ImportAsset (const std::string &path)
 Imports or reimports one asset, rebuilding its cache.
static void Refresh ()
 Scans for modified files and reimports them.
static std::string AssetPathToGUID (const std::string &path)
 The GUID of the asset at a project-relative path, or "" if not found.
static std::string GUIDToAssetPath (const std::string &guid)
 The project-relative path of an asset, or "" if not found.
static std::string GUIDToAbsolutePath (const std::string &guid)
 The absolute path of an asset, or "" if not found.
static const SubAssetInfo * GetSubAsset (const std::string &guid)
 The sub-asset with this GUID, or nullptr.
static const std::vector< SubAssetInfo > * GetSubAssets (const std::string &parentGuid)
 The sub-assets of a parent asset, or nullptr when it has none.
static void GetSpritesheetAssets (std::vector< std::pair< std::string, std::string > > &outAssets)
 Fills outAssets with every texture that has sub-assets (spritesheets).

Detailed Description

Static asset import and GUID lookup for editor tools, like Unity's AssetDatabase.

Tools call it without knowing 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

Called by the editor at startup.

◆ Shutdown()

void DekiEditor::AssetDatabase::Shutdown ( )
static

Called by the editor at exit.

◆ ImportAsset()

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

Imports or reimports one asset, rebuilding its cache.

path is project-relative, e.g. "assets/sprites/player.png".

◆ Refresh()

void DekiEditor::AssetDatabase::Refresh ( )
static

Scans for modified files and reimports them.

◆ AssetPathToGUID()

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

The GUID of the asset at a project-relative path, or "" if not found.

◆ GUIDToAssetPath()

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

The project-relative path of an asset, or "" if not found.

◆ GUIDToAbsolutePath()

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

The absolute path of an asset, or "" if not found.

◆ GetSubAsset()

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

The sub-asset with this GUID, or nullptr.

◆ GetSubAssets()

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

The sub-assets of a parent asset, or nullptr when it has none.

◆ GetSpritesheetAssets()

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

Fills outAssets with every texture that has sub-assets (spritesheets).


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