Files
@ r25754:d19207ab5c69
Branch filter:
Location: cpp/openttd-patchpack/source/src/newgrf_townname.h - annotation
r25754:d19207ab5c69
1.7 KiB
text/x-c
Cleanup: remove SLE_NULL and friends
We no longer need them. If you want to remove a field .. just
remove it! Because of the headers in the savegame, on loading,
it will do the right thing and skip the field.
Do remember to bump the savegame version, as otherwise older
clients can still load the game, but will reset the field you
have removed .. that might be unintentially.
We no longer need them. If you want to remove a field .. just
remove it! Because of the headers in the savegame, on loading,
it will do the right thing and skip the field.
Do remember to bump the savegame version, as otherwise older
clients can still load the game, but will reset the field you
have removed .. that might be unintentially.
r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r15610:623a23fb6560 r15610:623a23fb6560 r9111:983de9c5a848 r9111:983de9c5a848 r9111:983de9c5a848 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r24804:1320798728bb r8264:d493cb51fe8a r8264:d493cb51fe8a r6956:6398843f1341 r19944:25a78576fb5e r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r6956:6398843f1341 r24804:1320798728bb r24804:1320798728bb r24804:1320798728bb r6956:6398843f1341 r6956:6398843f1341 | /*
* This file is part of OpenTTD.
* 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.
* 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.
* 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/>.
*/
/**
* @file newgrf_townname.h
* Header of Action 0F "universal holder" structure and functions
*/
#ifndef NEWGRF_TOWNNAME_H
#define NEWGRF_TOWNNAME_H
#include <vector>
#include "strings_type.h"
struct NamePart {
byte prob; ///< The relative probability of the following name to appear in the bottom 7 bits.
union {
char *text; ///< If probability bit 7 is clear
byte id; ///< If probability bit 7 is set
} data;
};
struct NamePartList {
byte partcount;
byte bitstart;
byte bitcount;
uint16 maxprob;
NamePart *parts;
};
struct GRFTownName {
uint32 grfid;
byte nb_gen;
byte id[128];
StringID name[128];
byte nbparts[128];
NamePartList *partlist[128];
GRFTownName *next;
};
GRFTownName *AddGRFTownName(uint32 grfid);
GRFTownName *GetGRFTownName(uint32 grfid);
void DelGRFTownName(uint32 grfid);
void CleanUpGRFTownNames();
char *GRFTownNameGenerate(char *buf, uint32 grfid, uint16 gen, uint32 seed, const char *last);
uint32 GetGRFTownNameId(int gen);
uint16 GetGRFTownNameType(int gen);
StringID GetGRFTownNameName(uint gen);
const std::vector<StringID>& GetGRFTownNameList();
#endif /* NEWGRF_TOWNNAME_H */
|