# gfx_type.h File Reference

Types related to the graphics and/or input devices. More...

`#include "core/endian_type.hpp"`
`#include "core/geometry_type.hpp"`
`#include "zoom_type.h"`

Go to the source code of this file.

## Data Structures
struct | PalSpriteID
| Combination of a palette sprite and a 'real' sprite. More...
struct | AnimCursor
| A single sprite of a list of animated cursors. More...
struct | CursorVars
| Collection of variables for cursor-display and -animation. More...
struct | DrawPixelInfo
| Data about how and where to blit pixels. More...
union | Colour
| Structure to access the alpha, red, green, and blue channels from a 32 bit number. More...
struct | SubSprite
| Used to only draw a part of the sprite. More...
## Typedefs
typedef uint32 | SpriteID
| The number of a sprite, without mapping bits and colourtables.
typedef uint32 | PaletteID
| The number of the palette.
typedef uint32 | CursorID
| The number of the cursor (sprite).
## Enumerations
enum | WindowKeyCodes { WKC_SHIFT = 0x8000, WKC_CTRL = 0x4000, WKC_ALT = 0x2000, WKC_META = 0x1000, WKC_NONE = 0, WKC_ESC = 1, WKC_BACKSPACE = 2, WKC_INSERT = 3, WKC_DELETE = 4, WKC_PAGEUP = 5, WKC_PAGEDOWN = 6, WKC_END = 7, WKC_HOME = 8, WKC_LEFT = 9, WKC_UP = 10, WKC_RIGHT = 11, WKC_DOWN = 12, WKC_RETURN = 13, WKC_TAB = 14, WKC_SPACE = 32, WKC_F1 = 33, WKC_F2 = 34, WKC_F3 = 35, WKC_F4 = 36, WKC_F5 = 37, WKC_F6 = 38, WKC_F7 = 39, WKC_F8 = 40, WKC_F9 = 41, WKC_F10 = 42, WKC_F11 = 43, WKC_F12 = 44, WKC_BACKQUOTE = 45, WKC_PAUSE = 46, WKC_NUM_DIV = 138, WKC_NUM_MUL = 139, WKC_NUM_MINUS = 140, WKC_NUM_PLUS = 141, WKC_NUM_ENTER = 142, WKC_NUM_DECIMAL = 143, WKC_SLASH = 144, WKC_SEMICOLON = 145, WKC_EQUALS = 146, WKC_L_BRACKET = 147, WKC_BACKSLASH = 148, WKC_R_BRACKET = 149, WKC_SINGLEQUOTE = 150, WKC_COMMA = 151, WKC_PERIOD = 152, WKC_MINUS = 153 }
enum | FontSize { FS_NORMAL, FS_SMALL, FS_LARGE, FS_END, FS_BEGIN = FS_NORMAL }
| Available font sizes. More...
enum | Colours { COLOUR_DARK_BLUE, COLOUR_PALE_GREEN, COLOUR_PINK, COLOUR_YELLOW, COLOUR_RED, COLOUR_LIGHT_BLUE, COLOUR_GREEN, COLOUR_DARK_GREEN, COLOUR_BLUE, COLOUR_CREAM, COLOUR_MAUVE, COLOUR_PURPLE, COLOUR_ORANGE, COLOUR_BROWN, COLOUR_GREY, COLOUR_WHITE, COLOUR_END, INVALID_COLOUR = 0xFF }
enum | TextColour { TC_FROMSTRING = 0x00, TC_BLUE = 0x00, TC_SILVER = 0x01, TC_GOLD = 0x02, TC_RED = 0x03, TC_PURPLE = 0x04, TC_LIGHT_BROWN = 0x05, TC_ORANGE = 0x06, TC_GREEN = 0x07, TC_YELLOW = 0x08, TC_DARK_GREEN = 0x09, TC_CREAM = 0x0A, TC_BROWN = 0x0B, TC_WHITE = 0x0C, TC_LIGHT_BLUE = 0x0D, TC_GREY = 0x0E, TC_DARK_BLUE = 0x0F, TC_BLACK = 0x10, TC_INVALID = 0xFF, IS_PALETTE_COLOUR = 0x100 }
| Colour of the strings, see _string_colourmap in table/palettes.h or docs/ottd-colourtext-palette.png. More...
enum | PaletteAnimationSizes { PALETTE_ANIM_SIZE_WIN = 28, PALETTE_ANIM_SIZE_DOS = 38, PALETTE_ANIM_SIZE_START = 217 }
| Defines a few values that are related to animations using palette changes. More...
enum | FillRectMode { FILLRECT_OPAQUE, FILLRECT_CHECKER, FILLRECT_RECOLOUR }
| Define the operation GfxFillRect performs. More...
enum | PaletteType { PAL_DOS, PAL_WINDOWS, PAL_AUTODETECT, MAX_PAL = 2 }
| Palettes OpenTTD supports. More...
enum | SpriteType { ST_NORMAL = 0, ST_MAPGEN = 1, ST_FONT = 2, ST_RECOLOUR = 3, ST_INVALID = 4 }
| Types of sprites that might be loaded. More...
## Functions
| DECLARE_POSTFIX_INCREMENT (FontSize)
| DECLARE_ENUM_AS_BIT_SET (TextColour)

## Detailed Description

Types related to the graphics and/or input devices.

Definition in file gfx_type.h.

## Enumeration Type Documentation

enum FillRectMode

Define the operation GfxFillRect performs.

Enumerator:

  FILLRECT_OPAQUE | Fill rectangle with a single colour.
  FILLRECT_CHECKER | Draw only every second pixel, used for greying-out.
  FILLRECT_RECOLOUR | Apply a recolour sprite to the screen content.

Definition at line 234 of file gfx_type.h.

enum FontSize

Available font sizes.

Enumerator:

  FS_NORMAL | Index of the normal font in the font tables.
  FS_SMALL | Index of the small font in the font tables.
  FS_LARGE | Index of the large font in the font tables.
  FS_BEGIN | First font.

Definition at line 160 of file gfx_type.h.

enum PaletteAnimationSizes

Defines a few values that are related to animations using palette changes.

Enumerator:

  PALETTE_ANIM_SIZE_WIN | number of animated colours in Windows palette
  PALETTE_ANIM_SIZE_DOS | number of animated colours in DOS palette
  PALETTE_ANIM_SIZE_START | Index in the _palettes array from which all animations are taking places (table/palettes.h).

Definition at line 227 of file gfx_type.h.

enum PaletteType

Palettes OpenTTD supports.

Enumerator:

  PAL_DOS | Use the DOS palette.
  PAL_WINDOWS | Use the Windows palette.
  PAL_AUTODETECT | Automatically detect the palette based on the graphics pack.
  MAX_PAL | The number of palettes.

Definition at line 241 of file gfx_type.h.

enum SpriteType

Types of sprites that might be loaded.

Enumerator:

  ST_NORMAL | The most basic (normal) sprite.
  ST_MAPGEN | Special sprite for the map generator.
  ST_FONT | A sprite used for fonts.
  ST_RECOLOUR | Recolour sprite.
  ST_INVALID | Pseudosprite or other unusable sprite, used only internally.

Definition at line 249 of file gfx_type.h.

enum TextColour

Colour of the strings, see _string_colourmap in table/palettes.h or docs/ottd-colourtext-palette.png.

Enumerator:

  IS_PALETTE_COLOUR | colour value is already a real palette colour index, not an index of a StringColour

Definition at line 201 of file gfx_type.h.

enum WindowKeyCodes

Enumerator:

  WKC_SLASH | / Forward slash
  WKC_SEMICOLON | ; Semicolon
  WKC_EQUALS | = Equals
  WKC_L_BRACKET | [ Left square bracket
  WKC_BACKSLASH | \ Backslash
  WKC_R_BRACKET | ] Right square bracket
  WKC_SINGLEQUOTE | ' Single quote
  WKC_COMMA | , Comma
  WKC_PERIOD | . Period
  WKC_MINUS | Minus

Definition at line 29 of file gfx_type.h.