mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r15740) -Codechange: make code in namegen.cpp ~50% faster, apply coding style and add comments
This commit is contained in:
parent
5f57ea7198
commit
d23c9f7a6c
931
src/namegen.cpp
931
src/namegen.cpp
File diff suppressed because it is too large
Load Diff
@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
/** @file namegen_func.h Town name generator stuff. */
|
/** @file namegen_func.h Town name generator stuff. */
|
||||||
|
|
||||||
#ifndef NAMEGEN_H
|
#ifndef NAMEGEN_FUNC_H
|
||||||
#define NAMEGEN_H
|
#define NAMEGEN_FUNC_H
|
||||||
|
|
||||||
typedef byte TownNameGenerator(char *buf, uint32 seed, const char *last);
|
char *GenerateTownNameString(char *buf, const char *last, size_t lang, uint32 seed);
|
||||||
|
|
||||||
extern TownNameGenerator * const _town_name_generators[];
|
#endif /* NAMEGEN_FUNC_H */
|
||||||
|
|
||||||
#endif /* NAMEGEN_H */
|
|
||||||
|
@ -1084,10 +1084,7 @@ static char *StationGetSpecialString(char *buff, int x, const char *last)
|
|||||||
|
|
||||||
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed, const char *last)
|
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed, const char *last)
|
||||||
{
|
{
|
||||||
char name[512];
|
return GenerateTownNameString(buff, last, ind, seed);
|
||||||
|
|
||||||
_town_name_generators[ind](name, seed, lastof(name));
|
|
||||||
return strecpy(buff, name, last);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * const _silly_company_names[] = {
|
static const char * const _silly_company_names[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user