Changeset - r12670:39f36ac861e2
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-08-09 18:44:35
rubidium@openttd.org
(svn r17135) -Fix (r17133): some (older) GCCs failed to compile
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/base_media_base.h
Show inline comments
 
/* $Id$ */
 

	
 
/** @file base_media_base.h Generic functions for replacing base data (graphics, sounds). */
 

	
 
#ifndef BASE_MEDIA_BASE_H
 
#define BASE_MEDIA_BASE_H
 

	
 
#include "fileio_func.h"
 

	
 
/* Forward declare these; can't do 'struct X' in functions as older GCCs barf on that */
 
struct IniFile;
 
struct ContentInfo;
 

	
 
/** Structure holding filename and MD5 information about a single file */
 
struct MD5File {
 
	const char *filename;        ///< filename
 
	uint8 hash[16];              ///< md5 sum of the file
 
	const char *missing_warning; ///< warning when this file is missing
 

	
 
	bool CheckMD5() const;
 
};
 

	
 
/**
 
 * Information about a single base set.
 
 * @tparam T the real class we're going to be
 
@@ -58,25 +62,25 @@ struct BaseSet {
 
	 */
 
	int GetNumMissing() const
 
	{
 
		return Tnum_files - this->found_files;
 
	}
 

	
 
	/**
 
	 * Read the set information from a loaded ini.
 
	 * @param ini      the ini to read from
 
	 * @param path     the path to this ini file (for filenames)
 
	 * @return true if loading was successful.
 
	 */
 
	bool FillSetDetails(struct IniFile *ini, const char *path);
 
	bool FillSetDetails(IniFile *ini, const char *path);
 
};
 

	
 
/**
 
 * Base for all base media (graphics, sound)
 
 * @tparam Tbase_set the real set we're going to be
 
 */
 
template <class Tbase_set>
 
class BaseMedia : FileScanner {
 
protected:
 
	static Tbase_set *available_sets; ///< All available sets
 
	static const Tbase_set *used_set; ///< The currently used set
 

	
 
@@ -140,25 +144,25 @@ public:
 
	/**
 
	 * Return the used set.
 
	 * @return the used set.
 
	 */
 
	static const Tbase_set *GetUsedSet();
 

	
 
	/**
 
	 * Check whether we have an set with the exact characteristics as ci.
 
	 * @param ci the characteristics to search on (shortname and md5sum)
 
	 * @param md5sum whether to check the MD5 checksum
 
	 * @return true iff we have an set matching.
 
	 */
 
	static bool HasSet(const struct ContentInfo *ci, bool md5sum);
 
	static bool HasSet(const ContentInfo *ci, bool md5sum);
 
};
 

	
 

	
 
/** Types of graphics in the base graphics set */
 
enum GraphicsFileType {
 
	GFT_BASE,     ///< Base sprites for all climates
 
	GFT_LOGOS,    ///< Logos, landscape icons and original terrain generator sprites
 
	GFT_ARCTIC,   ///< Landscape replacement sprites for arctic
 
	GFT_TROPICAL, ///< Landscape replacement sprites for tropical
 
	GFT_TOYLAND,  ///< Landscape replacement sprites for toyland
 
	GFT_EXTRA,    ///< Extra sprites that were not part of the original sprites
 
	MAX_GFT       ///< We are looking for this amount of GRFs
0 comments (0 inline, 0 general)