OpenTTD Source 20241224-master-gf74b0cf984
|
Generic function implementations for base data (graphics, sounds). More...
#include "base_media_base.h"
#include "debug.h"
#include "ini_type.h"
#include "string_func.h"
#include "error_func.h"
#include "network/core/tcp_content_type.h"
Go to the source code of this file.
Macros | |
#define | fetch_metadata(name) |
Try to read a single piece of metadata and return false if it doesn't exist. | |
#define | INSTANTIATE_BASE_MEDIA_METHODS(repl_type, set_type) |
Force instantiation of methods so we don't get linker errors. | |
Functions | |
void | CheckExternalFiles () |
Checks whether the MD5 checksums of the files are correct. | |
template<class Tbase_set > | |
const char * | TryGetBaseSetFile (const ContentInfo *ci, bool md5sum, const Tbase_set *s) |
Check whether there's a base set matching some information. | |
Generic function implementations for base data (graphics, sounds).
Definition in file base_media_func.h.
#define fetch_metadata | ( | name | ) |
Try to read a single piece of metadata and return false if it doesn't exist.
name | the name of the item to fetch. |
Definition at line 25 of file base_media_func.h.
#define INSTANTIATE_BASE_MEDIA_METHODS | ( | repl_type, | |
set_type | |||
) |
Force instantiation of methods so we don't get linker errors.
repl_type | the type of the BaseMedia to instantiate |
set_type | the type of the BaseSet to instantiate |
Definition at line 414 of file base_media_func.h.
|
extern |
Checks whether the MD5 checksums of the files are correct.
Definition at line 114 of file gfxinit.cpp.
References BASESET_DIR, BaseSet< SoundsSet, 1, true >::CheckMD5(), GraphicsSet::CheckMD5(), MD5File::CR_MATCH, MD5File::CR_MISMATCH, Debug, MD5File::filename, BaseSet< T, Tnum_files, Tsearch_in_tars >::files, BaseSet< T, Tnum_files, Tsearch_in_tars >::GetNumInvalid(), BaseMedia< GraphicsSet >::GetUsedSet(), BaseMedia< SoundsSet >::GetUsedSet(), MD5File::missing_warning, BaseSet< T, Tnum_files, Tsearch_in_tars >::name, and BaseSet< SoundsSet, 1, true >::NUM_FILES.
Referenced by BaseMedia< Tbase_set >::SetSet().
const char * TryGetBaseSetFile | ( | const ContentInfo * | ci, |
bool | md5sum, | ||
const Tbase_set * | s | ||
) |
Check whether there's a base set matching some information.
ci | The content info to compare it to. |
md5sum | Should the MD5 checksum be tested as well? |
s | The list with sets. |
nullptr
if there is no match. Definition at line 319 of file base_media_func.h.
References MD5File::hash, ContentInfo::md5sum, and ContentInfo::unique_id.
Referenced by ContentInfo::GetTextfile(), and BaseMedia< Tbase_set >::HasSet().