Files @ r7581:0085036e989e
Branch filter:

Location: cpp/openttd-patchpack/source/src/newgrf_townname.h

truelight
(svn r11106) -Add: added .tar support; you can pack all files in your data/ dir in how ever many .tar files you like, keeping the dir-structure equal to the unpacked version, and OpenTTD can handle them just like the files were unpacked
-Note: useful for GRF-packs and 32bpp PNGs. Don't forget to keep the dir-structure alive for 32bpp PNGs!
-Note: file-loading-order: search-paths, .tar-files in the order found on disk (can be anything at all, don't depend on it.. use 'openttd -d1' to see which order they are added)
/* $Id$ */
#ifndef NEWGRF_TOWNNAME_H
#define NEWGRF_TOWNNAME_H

/** @file newgrf_townname.h
 * Header of Action 0F "universal holder" structure and functions
 */

struct NamePart {
	byte prob;     ///< The relative probablity of the following name to appear in the bottom 7 bits.
	union {
		char *text;    ///< If probability bit 7 is clear
		byte id;       ///< If probability bit 7 is set
	} data;
};

struct NamePartList {
	byte partcount;
	byte bitstart;
	byte bitcount;
	uint16 maxprob;
	NamePart *parts;
};

struct GRFTownName {
	uint32 grfid;
	byte nb_gen;
	byte id[128];
	StringID name[128];
	byte nbparts[128];
	NamePartList *partlist[128];
	GRFTownName *next;
};

GRFTownName *AddGRFTownName(uint32 grfid);
GRFTownName *GetGRFTownName(uint32 grfid);
void DelGRFTownName(uint32 grfid);
void CleanUpGRFTownNames();
StringID *GetGRFTownNameList();
char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
uint32 GetGRFTownNameId(int gen);
uint16 GetGRFTownNameType(int gen);

#endif /* NEWGRF_TOWNNAME_H */