# townname_type.h

Go to the documentation of this file.

    00001 /* $Id: townname_type.h 17612 2009-09-22 13:54:54Z smatz $ */
    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 TOWNNAME_TYPE_H
    00015 #define TOWNNAME_TYPE_H
    00016
    00017 #include "newgrf_townname.h"
    00018
    00023 struct TownNameParams {
    00024   uint32 grfid;
    00025   uint16 type;
    00026
    00031   TownNameParams(byte town_name)
    00032   {
    00033     extern int _nb_orig_names;
    00034     bool grf = town_name >= _nb_orig_names;
    00035     this->grfid = grf ? GetGRFTownNameId(town_name - _nb_orig_names) : 0;
    00036     this->type = grf ? GetGRFTownNameType(town_name - _nb_orig_names) : SPECSTR_TOWNNAME_START + town_name;
    00037   }
    00038
    00039   TownNameParams(const struct Town *t);
    00040 };
    00041
    00042 #endif /* TOWNNAME_TYPE_H */