![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
#include <DataManager.h>
Classes | |
| struct | LevelPreloadResult |
| struct | PreloadStats |
| struct | TilesetInfo |
Static Public Member Functions | |
| static DataManager & | GetInstance () |
| static DataManager & | Get () |
| static std::string | BuildGameDataPath (const std::string &videogameName, const std::string &objectName) |
Private Member Functions | |
| std::string | FindResourceRecursive_Unix (const std::string &filename, const std::string &rootDir) const |
Private Attributes | |
| std::string | name |
| std::mutex | m_mutex_ |
| std::unordered_map< std::string, std::shared_ptr< Resource > > | m_resources_ |
| bool | m_enableFallbackScan = true |
Definition at line 79 of file DataManager.h.
| DataManager::DataManager | ( | ) |
Definition at line 42 of file DataManager.cpp.
References name, and SYSTEM_LOG.
|
virtual |
Definition at line 48 of file DataManager.cpp.
References SYSTEM_LOG, and UnloadAll().
Here is the call graph for this function:
|
static |
Definition at line 300 of file DataManager.cpp.
References GetComponentTypeID_Static().
Referenced by LoadJSONForObject(), and SaveJSONForObject().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 353 of file DataManager.cpp.
References GetComponentTypeID_Static(), and SYSTEM_LOG.
Referenced by SaveTextFile().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string DataManager::FindResourceRecursive | ( | const std::string & | filename, |
| const std::string & | rootDir = "GameData" |
||
| ) | const |
Definition at line 688 of file DataManager.cpp.
References FindResourceRecursive_Unix(), and GetComponentTypeID_Static().
Referenced by World::InstantiatePass1_VisualLayers(), TilesetManager::LoadTilesets(), PreloadSprites(), PreloadTextures(), and PreloadTilesets().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 743 of file DataManager.cpp.
References FindResourceRecursive_Unix(), GetComponentTypeID_Static(), and name.
Referenced by FindResourceRecursive(), and FindResourceRecursive_Unix().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 87 of file DataManager.h.
References GetInstance().
Referenced by World::CreateMissingPrefabPlaceholder(), OlympeEffectSystem::Initialize(), GameEngine::Initialize(), World::InstantiatePass1_VisualLayers(), PrefabFactory::InstantiateVisualEditor(), PrefabFactory::InstantiateVisualSprite(), World::LoadLevelFromTiled(), Olympe::AnimationEditorWindow::LoadSpritesheetTexture(), TilesetManager::LoadTilesets(), OlympeAnimation::AnimationBank::ParseJSON(), _Sprite::Preload(), SDL_AppInit(), SDL_AppQuit(), _Sprite::SetSprite(), and AnimationSystem::UpdateEntity().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 55 of file DataManager.cpp.
References GetComponentTypeID_Static().
Referenced by Get(), and GameEngine::Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| Sprite * DataManager::GetSprite | ( | const std::string & | id, |
| const std::string & | path, | ||
| ResourceCategory | category = ResourceCategory::GameEntity |
||
| ) |
Definition at line 171 of file DataManager.cpp.
References GetComponentTypeID_Static(), GetTexture(), m_mutex_, m_resources_, and PreloadSprite().
Referenced by World::CreateMissingPrefabPlaceholder(), GetSprite_data(), GetSpriteEditor_data(), OlympeEffectSystem::Initialize(), PrefabFactory::InstantiateVisualEditor(), PrefabFactory::InstantiateVisualSprite(), Olympe::AnimationEditorWindow::LoadSpritesheetTexture(), and AnimationSystem::UpdateEntity().
Here is the call graph for this function:
Here is the caller graph for this function:| bool DataManager::GetSprite_data | ( | const std::string & | id, |
| const std::string & | path, | ||
| VisualSprite_data & | outData | ||
| ) |
Definition at line 190 of file DataManager.cpp.
References GameEntity, GetComponentTypeID_Static(), GetSprite(), and SYSTEM_LOG.
Here is the call graph for this function:| bool DataManager::GetSpriteEditor_data | ( | const std::string & | id, |
| const std::string & | path, | ||
| VisualEditor_data & | outData | ||
| ) |
Definition at line 206 of file DataManager.cpp.
References GameEntity, GetComponentTypeID_Static(), GetSprite(), and SYSTEM_LOG.
Here is the call graph for this function:| SDL_Texture * DataManager::GetTexture | ( | const std::string & | id | ) | const |
Definition at line 137 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, m_resources_, GameEngine::renderer, renderer, and SYSTEM_LOG.
Referenced by GetSprite(), and OlympeAnimation::AnimationBank::ParseJSON().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 267 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, and m_resources_.
Here is the call graph for this function:| void DataManager::Initialize | ( | ) |
Definition at line 61 of file DataManager.cpp.
References SYSTEM_LOG.
Referenced by SDL_AppInit().
Here is the caller graph for this function:| std::vector< std::string > DataManager::ListResourcesByCategory | ( | ResourceCategory | category | ) | const |
Definition at line 286 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, and m_resources_.
Here is the call graph for this function:| std::vector< std::string > DataManager::ListResourcesByType | ( | ResourceType | type | ) | const |
Definition at line 273 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, and m_resources_.
Here is the call graph for this function:| bool DataManager::LoadJSONForObject | ( | const std::string & | videogameName, |
| const std::string & | objectName, | ||
| std::string & | outJson | ||
| ) | const |
Definition at line 347 of file DataManager.cpp.
References BuildGameDataPath(), GetComponentTypeID_Static(), and LoadTextFile().
Here is the call graph for this function:Definition at line 329 of file DataManager.cpp.
References GetComponentTypeID_Static().
Referenced by LoadJSONForObject(), and PreloadSystemResources().
Here is the call graph for this function:
Here is the caller graph for this function:| DataManager::PreloadStats DataManager::PreloadAudioFiles | ( | const std::vector< std::string > & | paths, |
| bool | enableFallbackScan = true |
||
| ) |
Definition at line 567 of file DataManager.cpp.
References DataManager::PreloadStats::completelyFailed, DataManager::PreloadStats::failedPaths, GetComponentTypeID_Static(), SYSTEM_LOG, and DataManager::PreloadStats::totalRequested.
Here is the call graph for this function:| bool DataManager::PreloadSprite | ( | const std::string & | id, |
| const std::string & | path, | ||
| ResourceCategory | category = ResourceCategory::GameEntity |
||
| ) |
Definition at line 132 of file DataManager.cpp.
References PreloadTexture().
Referenced by GetSprite(), _Sprite::Preload(), PreloadSprites(), and PreloadSystemResources().
Here is the call graph for this function:
Here is the caller graph for this function:| DataManager::PreloadStats DataManager::PreloadSprites | ( | const std::vector< std::string > & | paths, |
| ResourceCategory | category = ResourceCategory::GameEntity, |
||
| bool | enableFallbackScan = true |
||
| ) |
Definition at line 511 of file DataManager.cpp.
References DataManager::PreloadStats::completelyFailed, DataManager::PreloadStats::failedPaths, DataManager::PreloadStats::failedWithFallback, DataManager::PreloadStats::fallbackPaths, FindResourceRecursive(), GetComponentTypeID_Static(), m_enableFallbackScan, PreloadSprite(), DataManager::PreloadStats::successfullyLoaded, SYSTEM_LOG, and DataManager::PreloadStats::totalRequested.
Here is the call graph for this function:Definition at line 404 of file DataManager.cpp.
References GameEntity, GetComponentTypeID_Static(), Level, LoadTextFile(), PreloadSprite(), PreloadTexture(), System, and SYSTEM_LOG.
Referenced by GameEngine::Initialize().
Here is the call graph for this function:
Here is the caller graph for this function:| bool DataManager::PreloadTexture | ( | const std::string & | id, |
| const std::string & | path, | ||
| ResourceCategory | category = ResourceCategory::System |
||
| ) |
Definition at line 73 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, m_resources_, GameEngine::renderer, renderer, SYSTEM_LOG, and Texture.
Referenced by OlympeAnimation::AnimationBank::ParseJSON(), PreloadSprite(), PreloadSystemResources(), PreloadTextures(), and PreloadTilesets().
Here is the call graph for this function:
Here is the caller graph for this function:| DataManager::PreloadStats DataManager::PreloadTextures | ( | const std::vector< std::string > & | paths, |
| ResourceCategory | category = ResourceCategory::Level, |
||
| bool | enableFallbackScan = true |
||
| ) |
Definition at line 455 of file DataManager.cpp.
References DataManager::PreloadStats::completelyFailed, DataManager::PreloadStats::failedPaths, DataManager::PreloadStats::failedWithFallback, DataManager::PreloadStats::fallbackPaths, FindResourceRecursive(), GetComponentTypeID_Static(), m_enableFallbackScan, PreloadTexture(), DataManager::PreloadStats::successfullyLoaded, SYSTEM_LOG, and DataManager::PreloadStats::totalRequested.
Here is the call graph for this function:| DataManager::PreloadStats DataManager::PreloadTilesets | ( | const std::vector< TilesetInfo > & | tilesets, |
| bool | enableFallbackScan = true |
||
| ) |
Definition at line 586 of file DataManager.cpp.
References DataManager::PreloadStats::completelyFailed, DataManager::PreloadStats::failedPaths, DataManager::PreloadStats::failedWithFallback, DataManager::PreloadStats::fallbackPaths, FindResourceRecursive(), GetComponentTypeID_Static(), Level, m_enableFallbackScan, PreloadTexture(), DataManager::PreloadStats::successfullyLoaded, SYSTEM_LOG, and DataManager::PreloadStats::totalRequested.
Here is the call graph for this function:Definition at line 221 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, m_resources_, and SYSTEM_LOG.
Here is the call graph for this function:| bool DataManager::SaveJSONForObject | ( | const std::string & | videogameName, |
| const std::string & | objectName, | ||
| const std::string & | jsonContent | ||
| ) | const |
Definition at line 341 of file DataManager.cpp.
References BuildGameDataPath(), GetComponentTypeID_Static(), and SaveTextFile().
Here is the call graph for this function:Definition at line 308 of file DataManager.cpp.
References EnsureDirectoryExists(), GetComponentTypeID_Static(), and SYSTEM_LOG.
Referenced by SaveJSONForObject().
Here is the call graph for this function:
Here is the caller graph for this function:| void DataManager::Shutdown | ( | ) |
Definition at line 67 of file DataManager.cpp.
References SYSTEM_LOG, and UnloadAll().
Referenced by SDL_AppQuit().
Here is the call graph for this function:
Here is the caller graph for this function:| void DataManager::UnloadAll | ( | ) |
Definition at line 246 of file DataManager.cpp.
References GetComponentTypeID_Static(), m_mutex_, and m_resources_.
Referenced by Shutdown(), and ~DataManager().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 218 of file DataManager.h.
Referenced by PreloadSprites(), PreloadTextures(), and PreloadTilesets().
|
mutableprivate |
Definition at line 216 of file DataManager.h.
Referenced by GetSprite(), GetTexture(), HasResource(), ListResourcesByCategory(), ListResourcesByType(), PreloadTexture(), ReleaseResource(), and UnloadAll().
|
private |
Definition at line 217 of file DataManager.h.
Referenced by GetSprite(), GetTexture(), HasResource(), ListResourcesByCategory(), ListResourcesByType(), PreloadTexture(), ReleaseResource(), and UnloadAll().
|
private |
Definition at line 215 of file DataManager.h.
Referenced by DataManager(), and FindResourceRecursive_Unix().