townname_type.h

Go to the documentation of this file.
00001 /* $Id$ */
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 #include "town_type.h"
00020 
00025 struct TownNameParams {
00026   uint32 grfid; 
00027   uint16 type;  
00028 
00033   TownNameParams(byte town_name)
00034   {
00035     extern int _nb_orig_names;
00036     bool grf = town_name >= _nb_orig_names;
00037     this->grfid = grf ? GetGRFTownNameId(town_name - _nb_orig_names) : 0;
00038     this->type = grf ? GetGRFTownNameType(town_name - _nb_orig_names) : SPECSTR_TOWNNAME_START + town_name;
00039   }
00040 
00041   TownNameParams(const Town *t);
00042 };
00043 
00044 #endif /* TOWNNAME_TYPE_H */

Generated on Fri Jun 3 05:19:00 2011 for OpenTTD by  doxygen 1.6.1