src/newgrf_townname.h
author rubidium
Thu, 24 Apr 2008 12:32:37 +0000
branch0.6
changeset 10327 2274772a4424
parent 8760 ce0891c412ce
child 10429 1b99254f9607
permissions -rw-r--r--
(svn r12868) [0.6] -Backport from trunk r12795, r12776, r12683, r12681, r12678:
- Fix: Vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefor break downs now do not happen when loading [FS#1938] (r12795)
- Fix: [OSX] In some rare cases when using an uncalibrated monitor the system colour space could not be retrieved. Show an error when this happens instead of just trying an assertion (r12776)
- Fix: In some cases a news messages would not be shown [FS#1906] (r12683)
- Fix: When a road vehicle has a tram only stop multiple times in a row in it's orders, only the first one would be skipped [FS#1918] (r12678)
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
8760
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 7452
diff changeset
     5
#include "strings_type.h"
ce0891c412ce (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 7452
diff changeset
     6
7452
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     7
/** @file newgrf_townname.h
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     8
 * Header of Action 0F "universal holder" structure and functions
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
     9
 */
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    10
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    11
struct NamePart {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    12
	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
    13
	union {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    14
		char *text;    ///< If probability bit 7 is clear
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    15
		byte id;       ///< If probability bit 7 is set
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    16
	} data;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    17
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    18
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    19
struct NamePartList {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    20
	byte partcount;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    21
	byte bitstart;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    22
	byte bitcount;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    23
	uint16 maxprob;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    24
	NamePart *parts;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    25
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    26
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    27
struct GRFTownName {
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    28
	uint32 grfid;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    29
	byte nb_gen;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    30
	byte id[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    31
	StringID name[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    32
	byte nbparts[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    33
	NamePartList *partlist[128];
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    34
	GRFTownName *next;
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    35
};
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    36
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    37
GRFTownName *AddGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    38
GRFTownName *GetGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    39
void DelGRFTownName(uint32 grfid);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    40
void CleanUpGRFTownNames();
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    41
StringID *GetGRFTownNameList();
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    42
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
    43
uint32 GetGRFTownNameId(int gen);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    44
uint16 GetGRFTownNameType(int gen);
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    45
f6fd23727af0 (svn r10211) -Feature: [NewGRF] Add support for action 0F
glx
parents:
diff changeset
    46
#endif /* NEWGRF_TOWNNAME_H */