Resource::Paths namespace

Functions

auto GetDirFromID(PathID dirID) -> const char16_t*
auto GetDirectory(PathID dirID, eastl::string16& dst) -> bool
auto RegisterDirectory(PathID dirID, const char16_t* path) -> void
auto CreateTempFile(char16_t* dstPath, char16_t* folderPath = nullptr, char16_t* filePrefix = nullptr, char16_t* fileExtension = nullptr) -> int
Creates an empty temporary file.
auto GetDataDir() -> const char16_t*
Returns the path to the game's data directory. Typically, this is the Data folder in the directory where Core Spore is installed.
auto GetAppDir() -> const char16_t*
Returns the path to the game's app directory. Typically, this is the SporebinEP1 folder, containing SporeApp.exe, in the directory where Spore Galactic Adventures is installed.
auto GetDebugDir() -> const char16_t*
Appears to return null. There may be specific circumstances where this returns a valid path to a directory.
auto GetSaveArea(SaveAreaID areaID) -> Database*
Returns the database being used to save data of a certain kind.
auto RegisterSaveArea(SaveAreaID areaID, Resource::Database* pDatabase, void* unk = nullptr) -> void
Registers a database to be used to save specific types of data, such as saved games, creations, etc.
auto CreateSaveAreaDirectoryDatabase(PathID basePath, const char16_t* folderName, DatabaseDirectoryFilesPtr& dst, SaveAreaID saveArea) -> bool
Creates a DatabaseDirectoryFiles database for use as a save area.

Function documentation

int Resource::Paths::CreateTempFile(char16_t* dstPath, char16_t* folderPath = nullptr, char16_t* filePrefix = nullptr, char16_t* fileExtension = nullptr)

Creates an empty temporary file.

Parameters
dstPath out Buffer where the destination path will be written.
folderPath [Optional] Directory where the file is created, by default it uses the system temporary folder.
filePrefix [Optional] Prefix for the name of the file, "temp" by default.
fileExtension [Optional] Extension of the file, ".tmp" by default.
Returns The length of the path that has been written to the dstPath buffer.

Database* Resource::Paths::GetSaveArea(SaveAreaID areaID)

Returns the database being used to save data of a certain kind.

Parameters
areaID

A database can either be a .package file (DatabasePackedFile) or a plain folder. Generally, EditorSaves.package is returned for SaveAreaID::Creatures, SaveAreaID::Buildings, SaveAreaID::Vehicles, SaveAreaID::Cells, SaveAreaID::UFOs, SaveAreaID::Plants, SaveAreaID::Adventures

void Resource::Paths::RegisterSaveArea(SaveAreaID areaID, Resource::Database* pDatabase, void* unk = nullptr)

Registers a database to be used to save specific types of data, such as saved games, creations, etc.

Parameters
areaID
pDatabase
unk

bool Resource::Paths::CreateSaveAreaDirectoryDatabase(PathID basePath, const char16_t* folderName, DatabaseDirectoryFilesPtr& dst, SaveAreaID saveArea)

Creates a DatabaseDirectoryFiles database for use as a save area.

Parameters
basePath
folderName
dst out
saveArea
Returns True if the operation succeeded

The database path will be the one obtained through basePath plus folderName.