(svn r4493) Newgrf : Action 04. Beginning of implementation.

Some TODOs left, but the core is there.
Thanks to Peter1138 for code, advice and patience
And to Patchman for letting us define a lot of langids :)
This commit is contained in:
belugas
2006-04-21 03:00:20 +00:00
parent 9febcd5ef8
commit aab91d287a
8 changed files with 386 additions and 22 deletions

41
newgrf_text.h Normal file
View File

@@ -0,0 +1,41 @@
/* $Id$ */
#ifndef NEWGRF_TEXT_H
#define NEWGRF_TEXT_H
/** @file
* Header of Action 04 "universal holder" structure and functions
*/
#define MAX_LANG 28
/**
* Element of the linked list.
* Each of those elements represent the string,
* but according to a different lang.
*/
typedef struct GRFText {
byte langid;
char *text;
struct GRFText *next;
} GRFText;
/**
* Holder of the above structure.
* Putting both grfid and stringid togueter allow us to avoid duplicates,
* since it is NOT SUPPOSED to happen.
*/
typedef struct GRFTextEntry {
uint32 grfid;
uint16 stringid;
GRFText *textholder;
} GRFTextEntry;
StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, const char *text_to_add);
StringID GetGRFStringID(uint32 grfid, uint16 stringid);
char *GetGRFString(char *buff, uint16 stringid);
void CleanUpStrings(void);
void SetCurrentGrfLangID(const char *iso_name);
#endif /* NEWGRF_TEXT_H */