OpenTTD Source: src/spritecache_type.h Source File

OpenTTD Source 15.0-RC2

spritecache_type.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 SPRITECACHE_TYPE_H
11#define SPRITECACHE_TYPE_H
12
13#include "core/enum_type.hpp"
14
16 struct Sprite {
17 uint16_t height;
18 uint16_t width;
19 int16_t x_offs;
20 int16_t y_offs;
21 std::byte data[];
22};
23
24 enum class SpriteCacheCtrlFlag : uint8_t {
25 AllowZoomMin1xPal,
26 AllowZoomMin1x32bpp,
27 AllowZoomMin2xPal,
28 AllowZoomMin2x32bpp,
29};
30
31using SpriteCacheCtrlFlags = EnumBitSet<SpriteCacheCtrlFlag, uint8_t>;
32
33#endif /* SPRITECACHE_TYPE_H */
EnumBitSet< SpriteCacheCtrlFlag, uint8_t >
enum_type.hpp
Type (helpers) for enums.
SpriteCacheCtrlFlag
SpriteCacheCtrlFlag
Definition spritecache_type.h:24
SpriteCacheCtrlFlag::AllowZoomMin1x32bpp
@ AllowZoomMin1x32bpp
Allow use of sprite min zoom setting at 1x in 32bpp mode.
SpriteCacheCtrlFlag::AllowZoomMin2x32bpp
@ AllowZoomMin2x32bpp
Allow use of sprite min zoom setting at 2x in 32bpp mode.
SpriteCacheCtrlFlag::AllowZoomMin1xPal
@ AllowZoomMin1xPal
Allow use of sprite min zoom setting at 1x in palette mode.
SpriteCacheCtrlFlag::AllowZoomMin2xPal
@ AllowZoomMin2xPal
Allow use of sprite min zoom setting at 2x in palette mode.
Sprite
Data structure describing a sprite.
Definition spritecache_type.h:16
Sprite::width
uint16_t width
Width of the sprite.
Definition spritecache_type.h:18
Sprite::height
uint16_t height
Height of the sprite.
Definition spritecache_type.h:17
Sprite::y_offs
int16_t y_offs
Number of pixels to shift the sprite downwards.
Definition spritecache_type.h:20
Sprite::data
std::byte data[]
Sprite data.
Definition spritecache_type.h:21
Sprite::x_offs
int16_t x_offs
Number of pixels to shift the sprite to the right.
Definition spritecache_type.h:19