Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Provides callback's for the JavaScript. More...
Public Member Functions | |
CMapGenerationCallbacks (std::atomic< int > &progress, ScriptInterface &scriptInterface, Script::StructuredClone &mapData, const u16 flags) | |
~CMapGenerationCallbacks () | |
Private Member Functions | |
bool | LoadLibrary (const VfsPath &libraryName) |
Load all scripts of the given library. More... | |
void | ExportMap (JS::HandleValue data) |
Finalize map generation and pass results from the script to the engine. More... | |
JS::Value | LoadHeightmapImage (const VfsPath &filename) |
Load an image file and return it as a height array. More... | |
JS::Value | LoadMapTerrain (const VfsPath &filename) |
Load an Atlas terrain file (PMP) returning textures and heightmap. More... | |
void | SetProgress (int progress) |
Sets the map generation progress, which is one of multiple stages determining the loading screen progress. More... | |
double | GetMicroseconds () const |
Microseconds since the epoch. More... | |
CParamNode | GetTemplate (const std::string &templateName) |
Return the template data of the given template name. More... | |
bool | TemplateExists (const std::string &templateName) const |
Check whether the given template exists. More... | |
std::vector< std::string > | FindTemplates (const std::string &path, bool includeSubdirectories) |
Returns all template names of simulation entity templates. More... | |
std::vector< std::string > | FindActorTemplates (const std::string &path, bool includeSubdirectories) |
Returns all template names of actors. More... | |
Private Attributes | |
std::atomic< int > & | m_Progress |
Current map generation progress. More... | |
ScriptInterface & | m_ScriptInterface |
Provides the script context. More... | |
Script::StructuredClone & | m_MapData |
Result of the mapscript generation including terrain, entities and environment settings. More... | |
std::set< VfsPath > | m_LoadedLibraries |
Currently loaded script librarynames. More... | |
CTemplateLoader | m_TemplateLoader |
Backend to loading template data. More... | |
Provides callback's for the JavaScript.
|
inline |
|
inline |
|
inlineprivate |
Finalize map generation and pass results from the script to the engine.
The data
has to be according to this format: https://trac.wildfiregames.com/wiki/Random_Map_Generator_Internals#Dataformat
|
inlineprivate |
Returns all template names of actors.
|
inlineprivate |
Returns all template names of simulation entity templates.
|
inlineprivate |
Microseconds since the epoch.
|
inlineprivate |
Return the template data of the given template name.
|
inlineprivate |
Load an image file and return it as a height array.
|
inlineprivate |
Load all scripts of the given library.
libraryName | VfsPath specifying name of the library (subfolder of ../maps/random/) |
|
inlineprivate |
Load an Atlas terrain file (PMP) returning textures and heightmap.
See CMapReader::UnpackTerrain, CMapReader::ParseTerrain for the reordering
|
inlineprivate |
Sets the map generation progress, which is one of multiple stages determining the loading screen progress.
|
inlineprivate |
Check whether the given template exists.
|
private |
Currently loaded script librarynames.
|
private |
Result of the mapscript generation including terrain, entities and environment settings.
|
private |
Current map generation progress.
|
private |
Provides the script context.
|
private |
Backend to loading template data.