base_media_func.h File Reference

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 "network/network_content.h"

Go to the source code of this file.

Defines

#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

template<class Tbase_set >
bool HasBaseSet (const ContentInfo *ci, bool md5sum, const Tbase_set *s)
 Check whether there's a base set matching some information.

Detailed Description

Generic function implementations for base data (graphics, sounds).

Definition in file base_media_func.h.


Define Documentation

#define fetch_metadata ( name   ) 
Value:
item = metadata->GetItem(name, false); \
  if (item == NULL || StrEmpty(item->value)) { \
    DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing.", name); \
    DEBUG(grf, 0, "  Is %s readable for the user running OpenTTD?", full_filename); \
    return false; \
  }

Try to read a single piece of metadata and return false if it doesn't exist.

Parameters:
name the name of the item to fetch.

Definition at line 26 of file base_media_func.h.

Referenced by BaseSet< T, Tnum_files, Tsubdir >::FillSetDetails().

#define INSTANTIATE_BASE_MEDIA_METHODS ( repl_type,
set_type   ) 
Value:
template const char *repl_type::ini_set; \
  template const char *repl_type::GetExtension(); \
  template bool repl_type::AddFile(const char *filename, size_t pathlength); \
  template bool repl_type::HasSet(const struct ContentInfo *ci, bool md5sum); \
  template bool repl_type::SetSet(const char *name); \
  template char *repl_type::GetSetsList(char *p, const char *last); \
  template int repl_type::GetNumSets(); \
  template int repl_type::GetIndexOfUsedSet(); \
  template const set_type *repl_type::GetSet(int index); \
  template const set_type *repl_type::GetUsedSet(); \
  template bool repl_type::DetermineBestSet();

Force instantiation of methods so we don't get linker errors.

Parameters:
repl_type the type of the BaseMedia to instantiate
set_type the type of the BaseSet to instantiate

Definition at line 382 of file base_media_func.h.


Function Documentation

template<class Tbase_set >
bool HasBaseSet ( const ContentInfo ci,
bool  md5sum,
const Tbase_set *  s 
) [inline]

Check whether there's a base set matching some information.

Parameters:
ci The content info to compare it to.
md5sum Should the MD5 checksum be tested as well?
s The list with sets.

Definition at line 283 of file base_media_func.h.

References ContentInfo::md5sum, and ContentInfo::unique_id.

Referenced by BaseMedia< Tbase_set >::HasSet().


Generated on Fri May 27 04:19:53 2011 for OpenTTD by  doxygen 1.6.1