|
OpenTTD Source 20260208-master-g43af8e94d0
|
Base for all base media (graphics, sounds). More...
#include <base_media_base.h>
Public Member Functions | |
| bool | DetermineBestSet () |
| bool | DetermineBestSet () |
| bool | DetermineBestSet () |
Static Public Member Functions | |
| static bool | DetermineBestSet () |
| Determine the graphics pack that has to be used. | |
| static uint | FindSets () |
| Do the scan for files. | |
| static std::span< const std::unique_ptr< Tbase_set > > | GetAvailableSets () |
| Return the available sets. | |
| static bool | SetSet (const Tbase_set *set) |
| Set the set to be used. | |
| static bool | SetSetByName (const std::string &name) |
| Set the set to be used. | |
| static bool | SetSetByShortname (uint32_t shortname) |
| Set the set to be used. | |
| static void | GetSetsList (std::back_insert_iterator< std::string > &output_iterator) |
| Returns a list with the sets. | |
| static int | GetNumSets () |
| Count the number of available graphics sets. | |
| static int | GetIndexOfUsedSet () |
| Get the index of the currently active graphics set. | |
| static const Tbase_set * | GetSet (int index) |
| Get the name of the graphics set at the specified index. | |
| static const Tbase_set * | GetUsedSet () |
| Return the used set. | |
| static bool | HasSet (const ContentInfo &ci, bool md5sum) |
| Check whether we have an set with the exact characteristics as ci. | |
Protected Member Functions | |
| bool | AddFile (const std::string &filename, size_t basepath_length, const std::string &tar_filename) override |
| Add a file with the given filename. | |
| std::string_view | GetExtension () |
| std::string_view | GetExtension () |
| std::string_view | GetExtension () |
Static Protected Member Functions | |
| static std::string_view | GetExtension () |
| Get the extension that is used to identify this set. | |
| static std::span< const std::unique_ptr< Tbase_set > > | GetDuplicateSets () |
| Return the duplicate sets. | |
Static Protected Attributes | |
| static std::vector< std::unique_ptr< Tbase_set > > | available_sets |
| All available sets. | |
| static std::vector< std::unique_ptr< Tbase_set > > | duplicate_sets |
| All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded. | |
| static const Tbase_set * | used_set |
| The currently used set. | |
Additional Inherited Members | |
| Private Member Functions inherited from FileScanner | |
| virtual | ~FileScanner ()=default |
| Destruct the proper one... | |
| uint | Scan (std::string_view extension, Subdirectory sd, bool tars=true, bool recursive=true) |
| Scan for files with the given extension in the given search path. | |
| uint | Scan (std::string_view extension, const std::string &directory, bool recursive=true) |
| Scan for files with the given extension in the given search path. | |
| Private Attributes inherited from FileScanner | |
| Subdirectory | subdir {} |
| The current sub directory we are searching through. | |
Base for all base media (graphics, sounds).
| Tbase_set | the real set we're going to be |
Definition at line 165 of file base_media_base.h.
|
overrideprotectedvirtual |
Add a file with the given filename.
| filename | the full path to the file to read |
| basepath_length | amount of characters to chop of before to get a filename relative to the search path. |
| tar_filename | the name of the tar file the file is read from. |
Implements FileScanner.
Definition at line 186 of file base_media_func.h.
References available_sets, BASESET_DIR, Debug, IniLoadFile::LoadFromDisk(), and BaseSet< T >::SET_TYPE.
|
static |
Determine the graphics pack that has to be used.
The one with the most correct files wins.
Referenced by SetSet().
| bool BaseMedia< GraphicsSet >::DetermineBestSet | ( | ) |
Definition at line 477 of file gfxinit.cpp.
|
inlinestatic |
Do the scan for files.
Definition at line 193 of file base_media_base.h.
References BASESET_DIR, GetExtension(), OLD_DATA_DIR, OLD_GM_DIR, and FileScanner::Scan().
|
inlinestatic |
Return the available sets.
Definition at line 205 of file base_media_base.h.
References available_sets.
Referenced by GetNumSets(), and HasSet().
|
inlinestaticprotected |
Return the duplicate sets.
Definition at line 183 of file base_media_base.h.
References duplicate_sets.
Referenced by HasSet().
|
staticprotected |
|
protected |
Definition at line 510 of file gfxinit.cpp.
|
static |
Get the index of the currently active graphics set.
Definition at line 367 of file base_media_func.h.
References available_sets, and used_set.
|
static |
Count the number of available graphics sets.
Definition at line 355 of file base_media_func.h.
References GetAvailableSets(), and used_set.
|
static |
Get the name of the graphics set at the specified index.
Definition at line 383 of file base_media_func.h.
References available_sets, BaseSet< T >::SET_TYPE, and used_set.
|
static |
Returns a list with the sets.
| output_iterator | The iterator to write the string to. |
Definition at line 304 of file base_media_func.h.
References available_sets, and BaseSet< T >::SET_TYPE.
|
static |
Return the used set.
Definition at line 398 of file base_media_func.h.
References used_set.
|
static |
Check whether we have an set with the exact characteristics as ci.
| ci | the characteristics to search on (shortname and md5sum) |
| md5sum | whether to check the MD5 checksum |
Definition at line 344 of file base_media_func.h.
References GetAvailableSets(), GetDuplicateSets(), and TryGetBaseSetFile().
|
static |
Set the set to be used.
| set | the set to use |
Definition at line 248 of file base_media_func.h.
References CheckExternalFiles(), DetermineBestSet(), and used_set.
Referenced by SetSetByName(), and SetSetByShortname().
|
static |
Set the set to be used.
| name | of the set to use |
Definition at line 265 of file base_media_func.h.
References available_sets, and SetSet().
|
static |
Set the set to be used.
| shortname | of the set to use |
Definition at line 285 of file base_media_func.h.
References available_sets, and SetSet().
|
inlinestaticprotected |
All available sets.
Definition at line 167 of file base_media_base.h.
Referenced by AddFile(), GetAvailableSets(), GetIndexOfUsedSet(), GetSet(), GetSetsList(), SetSetByName(), and SetSetByShortname().
|
inlinestaticprotected |
All sets that aren't available, but needed for not downloading base sets when a newer version than the one on BaNaNaS is loaded.
Definition at line 168 of file base_media_base.h.
Referenced by GetDuplicateSets().
|
inlinestaticprotected |
The currently used set.
Definition at line 169 of file base_media_base.h.
Referenced by GetIndexOfUsedSet(), GetNumSets(), GetSet(), GetUsedSet(), and SetSet().