newgrf_text.h
author celestar
Fri, 02 Jun 2006 13:05:41 +0000
changeset 3933 231ae3c419f4
parent 3821 57db5bab0f24
child 4305 a28f3849ceae
permissions -rw-r--r--
(svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above:
Any railway track combination (excluding depots and waypoints)
Any road combination (excluding depots)
Clear tiles (duh), including fields
Tunnel entrances
Bridge heads

Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing

There are still a number of visual problems remaining, especially when electric railways are on or under the bridge.
DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
3601
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     1
/* $Id$ */
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     2
#ifndef NEWGRF_TEXT_H
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     3
#define NEWGRF_TEXT_H
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     4
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     5
/** @file
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     6
 * Header of Action 04 "universal holder" structure and functions
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     7
 */
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     8
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
     9
/**
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    10
 * Element of the linked list.
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    11
 * Each of those elements represent the string,
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    12
 * but according to a different lang.
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    13
 */
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    14
typedef struct GRFText {
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    15
	byte langid;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    16
	char *text;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    17
	struct GRFText *next;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    18
} GRFText;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    19
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    20
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    21
/**
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    22
 * Holder of the above structure.
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    23
 * Putting both grfid and stringid togueter allow us to avoid duplicates,
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    24
 * since it is NOT SUPPOSED to happen.
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    25
 */
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    26
typedef struct GRFTextEntry {
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    27
	uint32 grfid;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    28
	uint16 stringid;
3821
57db5bab0f24 (svn r4832) - NewGRF: add support for original string ID to newgrf text handling. So far, this is used for vehicles when no English or American translation is provided.
peter1138
parents: 3641
diff changeset
    29
	StringID def_string;
3601
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    30
	GRFText *textholder;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    31
} GRFTextEntry;
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    32
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    33
3821
57db5bab0f24 (svn r4832) - NewGRF: add support for original string ID to newgrf text handling. So far, this is used for vehicles when no English or American translation is provided.
peter1138
parents: 3641
diff changeset
    34
StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, bool new_scheme, const char *text_to_add, StringID def_string);
3601
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    35
StringID GetGRFStringID(uint32 grfid, uint16 stringid);
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    36
char *GetGRFString(char *buff, uint16 stringid);
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    37
void CleanUpStrings(void);
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    38
void SetCurrentGrfLangID(const char *iso_name);
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    39
138bf309cf27 (svn r4493) Newgrf : Action 04. Beginning of implementation.
belugas
parents:
diff changeset
    40
#endif /* NEWGRF_TEXT_H */