EVENGINE_API_DOMAINS public API. 更多...
#include <TextureRecipe.h>
Public 成员函数 | |
| void | registerRecipe (const std::string &id, TextureRecipeFn fn) |
| Register a recipe without metadata. | |
| void | registerRecipe (RecipeDescriptor descriptor, TextureRecipeFn fn) |
| Register a texture recipe with reusable metadata. | |
| bool | has (const std::string &id) const |
| Test whether a recipe exists. | |
| std::unique_ptr< image::ImageData > | generate (const std::string &id, const Params ¶ms, std::string &error) const |
| Generates an image and transfers its unique ownership to the caller. | |
| std::vector< std::string > | list () const |
| List registered recipe ids. | |
| const RecipeDescriptor * | descriptor (const std::string &id) const |
| Look up recipe metadata. | |
| bool | applyDefaults (const std::string &id, Params ¶ms) const |
| Fill missing values from metadata. | |
| void | registerBuiltins () |
| Register engine-provided recipes once. | |
静态 Public 成员函数 | |
| static TextureRecipeRegistry & | instance () |
| Access the process-wide texture recipe registry. | |
详细描述
EVENGINE_API_DOMAINS public API.
在文件 TextureRecipe.h 第 27 行定义.
成员函数说明
◆ applyDefaults()
| bool eve::procgen::TextureRecipeRegistry::applyDefaults | ( | const std::string & | id, |
| Params & | params | ||
| ) | const |
Fill missing values from metadata.
- 参数
-
id Recipe id. params Values to update.
- 返回
- False for an unknown recipe.
在文件 TextureRecipe.cpp 第 48 行定义.
引用了 eve::procgen::RecipeDescriptor::applyDefaults(), descriptor , 以及 params.
◆ descriptor()
| const RecipeDescriptor * eve::procgen::TextureRecipeRegistry::descriptor | ( | const std::string & | id | ) | const |
Look up recipe metadata.
- 参数
-
id Recipe id.
- 返回
- Registry-owned schema or nullptr.
在文件 TextureRecipe.cpp 第 43 行定义.
◆ generate()
| std::unique_ptr< image::ImageData > eve::procgen::TextureRecipeRegistry::generate | ( | const std::string & | id, |
| const Params & | params, | ||
| std::string & | error | ||
| ) | const |
Generates an image and transfers its unique ownership to the caller.
- 参数
-
id Stable recipe id. params Validated recipe parameters. error Receives a human-readable failure description when generation fails.
- 返回
- The newly owned image, or null when the recipe is unknown or generation fails. @ownership The returned image is owned by the caller.
在文件 TextureRecipe.cpp 第 33 行定义.
被这些函数引用 eve::procgen_editing::TextureRecipePreviewRuntime::generate() , 以及 eve::procgen::Procgen::generateImageHandle().
◆ has()
| bool eve::procgen::TextureRecipeRegistry::has | ( | const std::string & | id | ) | const |
Test whether a recipe exists.
- 参数
-
id Recipe id.
- 返回
- True when registered.
在文件 TextureRecipe.cpp 第 29 行定义.
◆ instance()
|
static |
Access the process-wide texture recipe registry.
- 返回
- Registry instance.
在文件 TextureRecipe.cpp 第 12 行定义.
被这些函数引用 eve::procgen::Procgen::applyTextureRecipeDefaults(), eve::procgen_editing::TextureRecipePreviewRuntime::generate(), eve::procgen::Procgen::generateImageHandle(), eve::procgen::Procgen::getTextureRecipeCount(), eve::procgen::Procgen::getTextureRecipeId(), eve::procgen::Procgen::getTextureRecipeSchema(), eve::procgen::Procgen::hasTextureRecipe(), eve::procgen::Procgen::Procgen(), eve::procgen_editing::TextureRecipeTarget::schema() , 以及 eve::procgen_editing::TextureRecipeTarget::validate().
◆ list()
| std::vector< std::string > eve::procgen::TextureRecipeRegistry::list | ( | ) | const |
List registered recipe ids.
- 返回
- Sorted ids.
在文件 TextureRecipe.cpp 第 55 行定义.
引用了 ids.
被这些函数引用 eve::procgen::Procgen::getTextureRecipeCount() , 以及 eve::procgen::Procgen::getTextureRecipeId().
◆ registerBuiltins()
| void eve::procgen::TextureRecipeRegistry::registerBuiltins | ( | ) |
Register engine-provided recipes once.
在文件 BuiltinTextures.cpp 第 945 行定义.
引用了 eve::procgen::ParamDescriptor::boolean(), eve::procgen::builtinTextureDefs(), error, eve::procgen::ParamDescriptor::floating(), eve::procgen::RecipeDescriptor::grid(), id, eve::procgen::ParamDescriptor::integer(), eve::procgen::makeTextureRecipeDescriptor(), name, params, eve::procgen::RecipeDescriptor::params, eve::procgen::registerCableTextureRecipes(), eve::procgen::registerFloorTextureRecipes(), eve::procgen::registerPrototypeTextureRecipes(), registerRecipe() , 以及 eve::procgen::road::registerRoadTextureRecipes().
被这些函数引用 eve::procgen::Procgen::applyTextureRecipeDefaults(), eve::procgen::Procgen::generateImageHandle(), eve::procgen::Procgen::getTextureRecipeCount(), eve::procgen::Procgen::getTextureRecipeId(), eve::procgen::Procgen::getTextureRecipeSchema(), eve::procgen::Procgen::hasTextureRecipe() , 以及 eve::procgen::Procgen::Procgen().
◆ registerRecipe() [1/2]
| void eve::procgen::TextureRecipeRegistry::registerRecipe | ( | const std::string & | id, |
| TextureRecipeFn | fn | ||
| ) |
Register a recipe without metadata.
- 参数
-
id Stable recipe id. fn Generator callback.
在文件 TextureRecipe.cpp 第 17 行定义.
引用了 descriptor, fn, id, eve::procgen::RecipeDescriptor::id , 以及 registerRecipe().
被这些函数引用 registerBuiltins(), eve::procgen::registerCableTextureRecipes(), eve::procgen::registerFloorTextureRecipes(), eve::procgen::registerPrototypeTextureRecipes(), registerRecipe() , 以及 eve::procgen::road::registerRoadTextureRecipes().
◆ registerRecipe() [2/2]
| void eve::procgen::TextureRecipeRegistry::registerRecipe | ( | RecipeDescriptor | descriptor, |
| TextureRecipeFn | fn | ||
| ) |
Register a texture recipe with reusable metadata.
- 参数
-
descriptor Recipe schema. fn Generator callback.
在文件 TextureRecipe.cpp 第 24 行定义.
引用了 descriptor, fn , 以及 id.
该类的文档由以下文件生成:
- src/modules/procgen/texture/TextureRecipe.h
- src/modules/procgen/texture/BuiltinTextures.cpp
- src/modules/procgen/texture/TextureRecipe.cpp