townname_type.h

Go to the documentation of this file.
00001 /* $Id: townname_type.h 20283 2010-08-01 19:22:34Z frosch $ */
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 
00015 #ifndef TOWNNAME_TYPE_H
00016 #define TOWNNAME_TYPE_H
00017 
00018 #include "newgrf_townname.h"
00019 
00024 struct TownNameParams {
00025   uint32 grfid; 
00026   uint16 type;  
00027 
00032   TownNameParams(byte town_name)
00033   {
00034     extern int _nb_orig_names;
00035     bool grf = town_name >= _nb_orig_names;
00036     this->grfid = grf ? GetGRFTownNameId(town_name - _nb_orig_names) : 0;
00037     this->type = grf ? GetGRFTownNameType(town_name - _nb_orig_names) : SPECSTR_TOWNNAME_START + town_name;
00038   }
00039 
00040   TownNameParams(const struct Town *t);
00041 };
00042 
00043 #endif /* TOWNNAME_TYPE_H */

Generated on Sun May 15 19:20:17 2011 for OpenTTD by  doxygen 1.6.1