src/newgrf_townname.h
author Tero Marttila <terom@fixme.fi>
Fri, 19 Dec 2008 02:25:44 +0200
branchterom-mini
changeset 10442 7089fa402bfd
parent 9111 48ce04029fe4
permissions -rw-r--r--
mini-branch
6956
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     1
/* $Id$ */
9111
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8264
diff changeset
     2
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8264
diff changeset
     3
/** @file newgrf_townname.h
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8264
diff changeset
     4
 * Header of Action 0F "universal holder" structure and functions
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8264
diff changeset
     5
 */
48ce04029fe4 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents: 8264
diff changeset
     6
6956
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     7
#ifndef NEWGRF_TOWNNAME_H
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     8
#define NEWGRF_TOWNNAME_H
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     9
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 6956
diff changeset
    10
#include "strings_type.h"
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 6956
diff changeset
    11
6956
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    12
struct NamePart {
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    13
	byte prob;     ///< The relative probablity of the following name to appear in the bottom 7 bits.
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    14
	union {
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    15
		char *text;    ///< If probability bit 7 is clear
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    16
		byte id;       ///< If probability bit 7 is set
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    17
	} data;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    18
};
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    19
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    20
struct NamePartList {
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    21
	byte partcount;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    22
	byte bitstart;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    23
	byte bitcount;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    24
	uint16 maxprob;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    25
	NamePart *parts;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    26
};
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    27
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    28
struct GRFTownName {
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    29
	uint32 grfid;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    30
	byte nb_gen;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    31
	byte id[128];
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    32
	StringID name[128];
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    33
	byte nbparts[128];
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    34
	NamePartList *partlist[128];
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    35
	GRFTownName *next;
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    36
};
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    37
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    38
GRFTownName *AddGRFTownName(uint32 grfid);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    39
GRFTownName *GetGRFTownName(uint32 grfid);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    40
void DelGRFTownName(uint32 grfid);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    41
void CleanUpGRFTownNames();
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    42
StringID *GetGRFTownNameList();
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    43
char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    44
uint32 GetGRFTownNameId(int gen);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    45
uint16 GetGRFTownNameType(int gen);
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    46
3579bfc5157b (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    47
#endif /* NEWGRF_TOWNNAME_H */