# newgrf_townname.h

Go to the documentation of this file.

    00001 /* $Id: newgrf_townname.h 17248 2009-08-21 20:21:05Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00014 #ifndef NEWGRF_TOWNNAME_H
    00015 #define NEWGRF_TOWNNAME_H
    00016
    00017 #include "strings_type.h"
    00018
    00019 struct NamePart {
    00020   byte prob;
    00021   union {
    00022     char *text;
    00023     byte id;
    00024   } data;
    00025 };
    00026
    00027 struct NamePartList {
    00028   byte partcount;
    00029   byte bitstart;
    00030   byte bitcount;
    00031   uint16 maxprob;
    00032   NamePart *parts;
    00033 };
    00034
    00035 struct GRFTownName {
    00036   uint32 grfid;
    00037   byte nb_gen;
    00038   byte id[128];
    00039   StringID name[128];
    00040   byte nbparts[128];
    00041   NamePartList *partlist[128];
    00042   GRFTownName *next;
    00043 };
    00044
    00045 GRFTownName *AddGRFTownName(uint32 grfid);
    00046 GRFTownName *GetGRFTownName(uint32 grfid);
    00047 void DelGRFTownName(uint32 grfid);
    00048 void CleanUpGRFTownNames();
    00049 StringID *GetGRFTownNameList();
    00050 char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
    00051 uint32 GetGRFTownNameId(int gen);
    00052 uint16 GetGRFTownNameType(int gen);
    00053
    00054 #endif /* NEWGRF_TOWNNAME_H */