src/newgrf_townname.h
author skidd13
Tue, 20 Nov 2007 14:11:19 +0000
changeset 8428 f8300c908bd9
parent 7452 f6fd23727af0
child 6872 1c4a4a609f85
permissions -rw-r--r--
(svn r11485) -Codechange: Remove the doubled function ToggleBitT and rename the remaining to fit with the naming style
7452
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     1
/* $Id$ */
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     2
#ifndef NEWGRF_TOWNNAME_H
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     3
#define NEWGRF_TOWNNAME_H
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     4
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     5
/** @file newgrf_townname.h
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     6
 * Header of Action 0F "universal holder" structure and functions
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     7
 */
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     8
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     9
struct NamePart {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    10
	byte prob;     ///< The relative probablity of the following name to appear in the bottom 7 bits.
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    11
	union {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    12
		char *text;    ///< If probability bit 7 is clear
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    13
		byte id;       ///< If probability bit 7 is set
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    14
	} data;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    15
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    16
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    17
struct NamePartList {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    18
	byte partcount;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    19
	byte bitstart;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    20
	byte bitcount;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    21
	uint16 maxprob;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    22
	NamePart *parts;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    23
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    24
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    25
struct GRFTownName {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    26
	uint32 grfid;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    27
	byte nb_gen;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    28
	byte id[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    29
	StringID name[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    30
	byte nbparts[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    31
	NamePartList *partlist[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    32
	GRFTownName *next;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    33
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    34
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    35
GRFTownName *AddGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    36
GRFTownName *GetGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    37
void DelGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    38
void CleanUpGRFTownNames();
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    39
StringID *GetGRFTownNameList();
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    40
char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    41
uint32 GetGRFTownNameId(int gen);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    42
uint16 GetGRFTownNameType(int gen);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    43
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    44
#endif /* NEWGRF_TOWNNAME_H */