OpenTTD Source: src/newgrf_townname.cpp File Reference

OpenTTD Source 15.0-RC2

Functions | Variables
newgrf_townname.cpp File Reference

Implementation of Action 0F "universal holder" structure and functions. More...

`#include "stdafx.h"`
`#include "newgrf_townname.h"`
`#include "string_func.h"`
`#include "strings_internal.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
GRFTownName * | GetGRFTownName (uint32_t grfid)
GRFTownName * | AddGRFTownName (uint32_t grfid)
void | DelGRFTownName (uint32_t grfid)
static void | RandomPart (StringBuilder &builder, const GRFTownName *t, uint32_t seed, uint8_t id)
void | GRFTownNameGenerate (StringBuilder &builder, uint32_t grfid, uint16_t gen, uint32_t seed)
void | InitGRFTownGeneratorNames ()
| Allocate memory for the NewGRF town names.
const std::vector< StringID > & | GetGRFTownNameList ()
StringID | GetGRFTownNameName (uint16_t gen)
void | CleanUpGRFTownNames ()
uint32_t | GetGRFTownNameId (uint16_t gen)
uint16_t | GetGRFTownNameType (uint16_t gen)

## Variables
static std::vector< GRFTownName > | _grf_townnames
static std::vector< StringID > | _grf_townname_names

## Detailed Description

Implementation of Action 0F "universal holder" structure and functions.

This file implements a linked-lists of townname generators, holding everything that the newgrf action 0F will send over to OpenTTD.

Definition in file newgrf_townname.cpp.

## Function Documentation

## ◆ AddGRFTownName()

GRFTownName * AddGRFTownName | ( | uint32_t | grfid | ) |

Definition at line 34 of file newgrf_townname.cpp.

## ◆ CleanUpGRFTownNames()

void CleanUpGRFTownNames | ( |  | ) |

Definition at line 100 of file newgrf_townname.cpp.

## ◆ DelGRFTownName()

void DelGRFTownName | ( | uint32_t | grfid | ) |

Definition at line 44 of file newgrf_townname.cpp.

## ◆ GetGRFTownName()

GRFTownName * GetGRFTownName | ( | uint32_t | grfid | ) |

Definition at line 27 of file newgrf_townname.cpp.

## ◆ GetGRFTownNameId()

uint32_t GetGRFTownNameId | ( | uint16_t | gen | ) |

Definition at line 105 of file newgrf_townname.cpp.

## ◆ GetGRFTownNameList()

const std::vector< StringID > & GetGRFTownNameList | ( |  | ) |

Definition at line 90 of file newgrf_townname.cpp.

## ◆ GetGRFTownNameName()

StringID GetGRFTownNameName | ( | uint16_t | gen | ) |

Definition at line 95 of file newgrf_townname.cpp.

## ◆ GetGRFTownNameType()

uint16_t GetGRFTownNameType | ( | uint16_t | gen | ) |

Definition at line 115 of file newgrf_townname.cpp.

## ◆ GRFTownNameGenerate()

void GRFTownNameGenerate | ( | StringBuilder & | builder,
|  | uint32_t | grfid,
|  | uint16_t | gen,
|  | uint32_t | seed
| ) |  |

Definition at line 69 of file newgrf_townname.cpp.

## ◆ InitGRFTownGeneratorNames()

void InitGRFTownGeneratorNames | ( |  | ) |

Allocate memory for the NewGRF town names.

Definition at line 80 of file newgrf_townname.cpp.

References GRFTownName::styles.

Referenced by AfterLoadGRFs().

## ◆ RandomPart()

static void RandomPart | ( | StringBuilder & | builder,
|  | const GRFTownName * | t,
|  | uint32_t | seed,
|  | uint8_t | id
| ) |  |
| static

Definition at line 49 of file newgrf_townname.cpp.

## Variable Documentation

## ◆ _grf_townname_names

std::vector<StringID> _grf_townname_names
| static

Definition at line 25 of file newgrf_townname.cpp.

## ◆ _grf_townnames

std::vector<GRFTownName> _grf_townnames
| static

Definition at line 24 of file newgrf_townname.cpp.