Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/MapGenerator.h
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | private: | ||||
* @param libraryName VfsPath specifying name of the library (subfolder of ../maps/random/) | * @param libraryName VfsPath specifying name of the library (subfolder of ../maps/random/) | ||||
* @return true if all scripts ran successfully, false if there's an error | * @return true if all scripts ran successfully, false if there's an error | ||||
*/ | */ | ||||
bool LoadScripts(const VfsPath& libraryName); | bool LoadScripts(const VfsPath& libraryName); | ||||
/** | /** | ||||
* Recursively load all script files in the given folder. | * Recursively load all script files in the given folder. | ||||
*/ | */ | ||||
static bool LoadLibrary(ScriptInterface::CxPrivate* pCxPrivate, const VfsPath& name); | static bool LoadLibrary(ScriptInterface::CmptPrivate* pCmptPrivate, const VfsPath& name); | ||||
/** | /** | ||||
* Finalize map generation and pass results from the script to the engine. | * Finalize map generation and pass results from the script to the engine. | ||||
*/ | */ | ||||
static void ExportMap(ScriptInterface::CxPrivate* pCxPrivate, JS::HandleValue data); | static void ExportMap(ScriptInterface::CmptPrivate* pCmptPrivate, JS::HandleValue data); | ||||
/** | /** | ||||
* Load an image file and return it as a height array. | * Load an image file and return it as a height array. | ||||
*/ | */ | ||||
static JS::Value LoadHeightmap(ScriptInterface::CxPrivate* pCxPrivate, const VfsPath& src); | static JS::Value LoadHeightmap(ScriptInterface::CmptPrivate* pCmptPrivate, const VfsPath& src); | ||||
/** | /** | ||||
* Load an Atlas terrain file (PMP) returning textures and heightmap. | * Load an Atlas terrain file (PMP) returning textures and heightmap. | ||||
*/ | */ | ||||
static JS::Value LoadMapTerrain(ScriptInterface::CxPrivate* pCxPrivate, const VfsPath& filename); | static JS::Value LoadMapTerrain(ScriptInterface::CmptPrivate* pCmptPrivate, const VfsPath& filename); | ||||
/** | /** | ||||
* Sets the map generation progress, which is one of multiple stages determining the loading screen progress. | * Sets the map generation progress, which is one of multiple stages determining the loading screen progress. | ||||
*/ | */ | ||||
static void SetProgress(ScriptInterface::CxPrivate* pCxPrivate, int progress); | static void SetProgress(ScriptInterface::CmptPrivate* pCmptPrivate, int progress); | ||||
/** | /** | ||||
* Microseconds since the epoch. | * Microseconds since the epoch. | ||||
*/ | */ | ||||
static double GetMicroseconds(ScriptInterface::CxPrivate* pCxPrivate); | static double GetMicroseconds(ScriptInterface::CmptPrivate* pCmptPrivate); | ||||
/** | /** | ||||
* Return the template data of the given template name. | * Return the template data of the given template name. | ||||
*/ | */ | ||||
static CParamNode GetTemplate(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static CParamNode GetTemplate(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& templateName); | ||||
/** | /** | ||||
* Check whether the given template exists. | * Check whether the given template exists. | ||||
*/ | */ | ||||
static bool TemplateExists(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static bool TemplateExists(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& templateName); | ||||
/** | /** | ||||
* Returns all template names of simulation entity templates. | * Returns all template names of simulation entity templates. | ||||
*/ | */ | ||||
static std::vector<std::string> FindTemplates(ScriptInterface::CxPrivate* pCxPrivate, const std::string& path, bool includeSubdirectories); | static std::vector<std::string> FindTemplates(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& path, bool includeSubdirectories); | ||||
/** | /** | ||||
* Returns all template names of actors. | * Returns all template names of actors. | ||||
*/ | */ | ||||
static std::vector<std::string> FindActorTemplates(ScriptInterface::CxPrivate* pCxPrivate, const std::string& path, bool includeSubdirectories); | static std::vector<std::string> FindActorTemplates(ScriptInterface::CmptPrivate* pCmptPrivate, const std::string& path, bool includeSubdirectories); | ||||
/** | /** | ||||
* Perform map generation in an independent thread. | * Perform map generation in an independent thread. | ||||
*/ | */ | ||||
static void* RunThread(CMapGeneratorWorker* self); | static void* RunThread(CMapGeneratorWorker* self); | ||||
/** | /** | ||||
* Perform the map generation. | * Perform the map generation. | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator