OpenTTD Source: src/newgrf_act5.h Source File

OpenTTD Source 15.3

newgrf_act5.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef NEWGRF_ACT5_H
11#define NEWGRF_ACT5_H
12
13#include "gfx_type.h"
14
16 enum Action5BlockType : uint8_t {
17 A5BLOCK_FIXED,
18 A5BLOCK_ALLOW_OFFSET,
19 A5BLOCK_INVALID,
20};
21
23 struct Action5Type {
24 Action5BlockType block_type;
25 SpriteID sprite_base;
26 uint16_t min_sprites;
27 uint16_t max_sprites;
28 const std::string_view name;
29};
30
31std::span<const Action5Type> GetAction5Types();
32
33#endif /* NEWGRF_ACT5_H */
gfx_type.h
Types related to the graphics and/or input devices.
SpriteID
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
GetAction5Types
std::span< const Action5Type > GetAction5Types()
Get list of all action 5 types.
Definition newgrf_act5.cpp:88
Action5BlockType
Action5BlockType
The type of action 5 type.
Definition newgrf_act5.h:16
A5BLOCK_ALLOW_OFFSET
@ A5BLOCK_ALLOW_OFFSET
Allow replacing any subset by specifying an offset.
Definition newgrf_act5.h:18
A5BLOCK_INVALID
@ A5BLOCK_INVALID
unknown/not-implemented type
Definition newgrf_act5.h:19
A5BLOCK_FIXED
@ A5BLOCK_FIXED
Only allow replacing a whole block of sprites. (TTDP compatible)
Definition newgrf_act5.h:17
Action5Type
Information about a single action 5 type.
Definition newgrf_act5.h:23
Action5Type::block_type
Action5BlockType block_type
How is this Action5 type processed?
Definition newgrf_act5.h:24
Action5Type::max_sprites
uint16_t max_sprites
If the Action5 contains more sprites, only the first max_sprites sprites will be used.
Definition newgrf_act5.h:27
Action5Type::min_sprites
uint16_t min_sprites
If the Action5 contains less sprites, the whole block will be ignored.
Definition newgrf_act5.h:26
Action5Type::sprite_base
SpriteID sprite_base
Load the sprites starting from this sprite.
Definition newgrf_act5.h:25
Action5Type::name
const std::string_view name
Name for error messages.
Definition newgrf_act5.h:28