# gfx_func.h File Reference

Functions related to the gfx engine. More...

`#include "gfx_type.h"`
`#include "strings_type.h"`

Go to the source code of this file.

## Defines
#define | FONT_HEIGHT_SMALL (GetCharacterHeight(FS_SMALL))
| Height of characters in the small (FS_SMALL) font.
#define | FONT_HEIGHT_NORMAL (GetCharacterHeight(FS_NORMAL))
| Height of characters in the normal (FS_NORMAL) font.
#define | FONT_HEIGHT_LARGE (GetCharacterHeight(FS_LARGE))
| Height of characters in the large (FS_LARGE) font.
## Enumerations
enum | { DRAW_STRING_BUFFER = 2048 }
enum | StringAlignment { SA_LEFT, SA_CENTER, SA_RIGHT, SA_MASK = 3, SA_FORCE = 4, SA_STRIP = 8 }
| How to align the to-be drawn text. More...
## Functions
void | GameLoop ()
void | CreateConsole ()
void | HandleKeypress (uint32 key)
| Handle keyboard input.
void | HandleCtrlChanged ()
| State of CONTROL key has changed.
void | HandleMouseEvents ()
| Handle a mouse event from the video driver.
void | CSleep (int milliseconds)
void | UpdateWindows ()
| Update the continuously changing contents of the windows, such as the viewports.
void | DrawMouseCursor ()
void | ScreenSizeChanged ()
void | GameSizeChanged ()
| Size of the application screen changed.
void | UndrawMouseCursor ()
void | RedrawScreenRect (int left, int top, int right, int bottom)
void | GfxScroll (int left, int top, int width, int height, int xo, int yo)
Dimension | GetSpriteSize (SpriteID sprid)
| Get the size of a sprite.
void | DrawSprite (SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub=NULL)
| Draw a sprite.
| DECLARE_ENUM_AS_BIT_SET (StringAlignment)
int | DrawString (int left, int right, int top, const char *str, TextColour colour=TC_FROMSTRING, StringAlignment align=SA_LEFT, bool underline=false)
| Draw string, possibly truncated to make it fit in its allocated space.
int | DrawString (int left, int right, int top, StringID str, TextColour colour=TC_FROMSTRING, StringAlignment align=SA_LEFT, bool underline=false)
| Draw string, possibly truncated to make it fit in its allocated space.
int | DrawStringMultiLine (int left, int right, int top, int bottom, StringID str, TextColour colour=TC_FROMSTRING, StringAlignment align=SA_LEFT, bool underline=false)
| Draw string, possibly over multiple lines.
void | DrawCharCentered (uint32 c, int x, int y, TextColour colour)
void | GfxFillRect (int left, int top, int right, int bottom, int colour, FillRectMode mode=FILLRECT_OPAQUE)
| Applies a certain FillRectMode-operation to a rectangle [left, right] x [top, bottom] on the screen.
void | GfxDrawLine (int left, int top, int right, int bottom, int colour)
void | DrawBox (int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3)
| Draws the projection of a parallelepiped.
Dimension | GetStringBoundingBox (const char *str)
| Return the string dimension in pixels.
Dimension | GetStringBoundingBox (StringID strid)
| Get bounding box of a string.
uint32 | FormatStringLinebreaks (char *str, const char *last, int maxw)
| 'Correct' a string to a maximum length.
int | GetStringHeight (StringID str, int maxw)
| Calculates height of string (in pixels).
Dimension | GetStringMultiLineBoundingBox (StringID str, const Dimension &suggestion)
| Calculate string bounding box for multi-line strings.
void | LoadStringWidthTable ()
| Initialize _stringwidth_table cache.
void | DrawDirtyBlocks ()
| Let the dirty blocks repainting by the video driver.
void | SetDirtyBlocks (int left, int top, int right, int bottom)
| Set a new dirty block.
void | MarkWholeScreenDirty ()
| Marks the whole screen as dirty.
void | GfxInitPalettes ()
bool | FillDrawPixelInfo (DrawPixelInfo *n, int left, int top, int width, int height)
| Set up a clipping area for only drawing into a certain area.
void | DrawOverlappedWindowForAll (int left, int top, int right, int bottom)
| From a rectangle that needs redrawing, find the windows that intersect with the rectangle.
void | SetMouseCursor (CursorID cursor, PaletteID pal)
void | SetAnimatedMouseCursor (const AnimCursor *table)
void | CursorTick ()
bool | ChangeResInGame (int w, int h)
void | SortResolutions (int count)
bool | ToggleFullScreen (bool fs)
byte | GetCharacterWidth (FontSize size, uint32 key)
byte | GetDigitWidth (FontSize size=FS_NORMAL)
| Return the maximum width of single digit.
static byte | GetCharacterHeight (FontSize size)
| Get height of a character for a given font size.
## Variables
byte | _dirkeys
| 1 = left, 2 = up, 4 = right, 8 = down
bool | _fullscreen
CursorVars | _cursor
bool | _ctrl_pressed
| Is Ctrl pressed?
bool | _shift_pressed
| Is Shift pressed?
byte | _fast_forward
bool | _left_button_down
| Is left mouse button pressed?
bool | _left_button_clicked
| Is left mouse button clicked?
bool | _right_button_down
| Is right mouse button pressed?
bool | _right_button_clicked
| Is right mouse button clicked?
DrawPixelInfo | _screen
bool | _screen_disable_anim
| Disable palette animation (important for 32bpp-anim blitter during giant screenshot).
int | _pal_first_dirty
int | _pal_count_dirty
int | _num_resolutions
Dimension | _resolutions [32]
Dimension | _cur_resolution
Colour | _cur_palette [256]
| Current palette. Entry 0 has to be always fully transparent!
FontSize | _cur_fontsize
| Currently selected font.
DrawPixelInfo * | _cur_dpi
byte | _colour_gradient [COLOUR_END][8]
| All 16 colour gradients 8 colours per gradient from darkest (0) to lightest (7).
PaletteType | _use_palette
| The currently used palette.
bool | _palette_remap_grf []
| Whether the given NewGRFs must get a palette remap or not.
const byte * | _palette_remap
| Palette map to go from the !_use_palette to the _use_palette.
const byte * | _palette_reverse_remap
| Palette map to go from the _use_palette to the !_use_palette.

## Detailed Description

Functions related to the gfx engine.

Definition in file gfx_func.h.

## Define Documentation

#define FONT_HEIGHT_LARGE (GetCharacterHeight(FS_LARGE))

Height of characters in the large (FS_LARGE) font.

Definition at line 184 of file gfx_func.h.

#define FONT_HEIGHT_NORMAL (GetCharacterHeight(FS_NORMAL))

Height of characters in the normal (FS_NORMAL) font.

Definition at line 181 of file gfx_func.h.

Referenced by CheckClickOnViewportSign(), DrawAircraftDetails(), StationViewWindow::DrawCargoRatings(), DrawCategories(), DrawEngineList(), DrawFrame(), DrawOrderString(), TownAuthorityWindow::DrawRatings(), DrawRoadVehDetails(), DrawShipDetails(), DrawString(), DrawTrainDetails(), DrawVehiclePurchaseInfo(), StationViewWindow::DrawWaitingCargo(), VehicleDetailsWindow::DrawWidget(), TownAuthorityWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), NewGRFWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), CompanyWindow::DrawWidget(), SelectCompanyLiveryWindow::DrawWidget(), AIListWindow::DrawWidget(), DrawYearColumn(), GetEngineListHeight(), MakeAsdfgKeys(), MakeNumberKeys(), MakeNWidgetCompanyLines(), MakeQwertyKeys(), MakeSpacebarKeys(), MakeTopKeys(), MakeZxcvbKeys(), ViewportSign::MarkDirty(), TownAuthorityWindow::OnClick(), StationViewWindow::OnClick(), CompanyStationsWindow::OnClick(), SelectCompanyLiveryWindow::OnClick(), NWidgetBackground::SetupSmallestSize(), VehicleDetailsWindow::UpdateWidgetSize(), RefitWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), StationViewWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), NewGRFAddWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), CompanyFinancesWindow::UpdateWidgetSize(), AIDebugWindow::UpdateWidgetSize(), AIConfigWindow::UpdateWidgetSize(), AISettingsWindow::UpdateWidgetSize(), AIListWindow::UpdateWidgetSize(), and ViewportAddString().

#define FONT_HEIGHT_SMALL (GetCharacterHeight(FS_SMALL))

Height of characters in the small (FS_SMALL) font.

Definition at line 178 of file gfx_func.h.

Referenced by CheckClickOnViewportSign(), DrawEngineList(), SmallMapWindow::DrawTowns(), SmallMapWindow::DrawWidget(), SmallMapWindow::GetLegendHeight(), SmallMapWindow::GetMaxLegendHeight(), GetVehicleListHeight(), SmallMapWindow::OnClick(), and CompanyStationsWindow::UpdateWidgetSize().

## Enumeration Type Documentation

enum StringAlignment

How to align the to-be drawn text.

Enumerator:

  SA_LEFT | Left align the text.
  SA_CENTER | Center the text.
  SA_RIGHT | Right align the text.
  SA_MASK | Mask for base alignment.
  SA_FORCE | Force the alignment, i.e. don't swap for RTL languages.
  SA_STRIP | Strip the SETX/SETXY commands from the string.

Definition at line 97 of file gfx_func.h.

## Function Documentation

void DrawBox | ( | int | x,
|  | int | y,
|  | int | dx1,
|  | int | dy1,
|  | int | dx2,
|  | int | dy2,
|  | int | dx3,
|  | int | dy3 |
| ) |  |  |

Draws the projection of a parallelepiped.

This can be used to draw boxes in world coordinates.

Parameters:

  | x | Screen X-coordinate of top front corner.
  | y | Screen Y-coordinate of top front corner.
  | dx1 | Screen X-length of first edge.
  | dy1 | Screen Y-length of first edge.
  | dx2 | Screen X-length of second edge.
  | dy2 | Screen Y-length of second edge.
  | dx3 | Screen X-length of third edge.
  | dy3 | Screen Y-length of third edge.

Definition at line 215 of file gfx.cpp.

Referenced by ViewportDrawBoundingBoxes().

void DrawOverlappedWindowForAll | ( | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom |
| ) |  |  |

From a rectangle that needs redrawing, find the windows that intersect with the rectangle.

These windows should be re-painted.

Parameters:

  | left | Left edge of the rectangle that should be repainted
  | top | Top edge of the rectangle that should be repainted
  | right | Right edge of the rectangle that should be repainted
  | bottom | Bottom edge of the rectangle that should be repainted

Definition at line 492 of file window.cpp.

References DrawOverlappedWindow(), Window::height, Window::left, Window::top, and Window::width.

void DrawSprite | ( | SpriteID | img,
|  | PaletteID | pal,
|  | int | x,
|  | int | y,
|  | const SubSprite * | sub |
| ) |  |  |

Draw a sprite.

Parameters:

  | img | Image number to draw
  | pal | Palette to use.
  | x | Left coordinate of image
  | y | Top coordinate of image
  | sub | If available, draw only specified part of the sprite

Definition at line 1031 of file gfx.cpp.

References GB(), HasBit(), PALETTE_MODIFIER_TRANSPARENT, PALETTE_WIDTH, SPRITE_WIDTH, ST_NORMAL, and ST_RECOLOUR.

Referenced by SettingEntry::Draw(), DrawAircraftImage(), DrawArrowButtons(), DrawCargoIcons(), DrawCommonTileSeqInGUI(), DrawCompanyManagerFace(), DrawHorizontalScrollbar(), DrawImageButtons(), DrawOrderString(), TownAuthorityWindow::DrawRatings(), DrawResizeBox(), DrawRoadVehImage(), DrawShadeBox(), DrawShipImage(), DrawStationTile(), DrawStickyBox(), DrawTrainDetails(), DrawTrainImage(), DrawVehicleProfitButton(), VehicleViewWindow::DrawWidget(), BuildTreesWindow::DrawWidget(), NewGRFWindow::DrawWidget(), CompanyWindow::DrawWidget(), and SelectCompanyLiveryWindow::DrawWidget().

int DrawString | ( | int | left,
|  | int | right,
|  | int | top,
|  | StringID | str,
|  | TextColour | colour,
|  | StringAlignment | align,
|  | bool | underline |
| ) |  |  |

Draw string, possibly truncated to make it fit in its allocated space.

Parameters:

  | left | The left most position to draw on.
  | right | The right most position to draw on.
  | top | The top most position to draw on.
  | str | String to draw.
  | colour | Colour used for drawing the string, see DoDrawString() for details
  | align | The alignment of the string when drawing left-to-right. In the case a right-to-left language is chosen this is inverted so it will be drawn in the right direction.
  | underline | Whether to underline what has been drawn or not.

Definition at line 614 of file gfx.cpp.

References DrawString(), and lastof.

int DrawString | ( | int | left,
|  | int | right,
|  | int | top,
|  | const char * | str,
|  | TextColour | colour,
|  | StringAlignment | align,
|  | bool | underline |
| ) |  |  |

Draw string, possibly truncated to make it fit in its allocated space.

Parameters:

  | left | The left most position to draw on.
  | right | The right most position to draw on.
  | top | The top most position to draw on.
  | str | String to draw.
  | colour | Colour used for drawing the string, see DoDrawString() for details
  | align | The alignment of the string when drawing left-to-right. In the case a right-to-left language is chosen this is inverted so it will be drawn in the right direction.
  | underline | Whether to underline what has been drawn or not.

Definition at line 594 of file gfx.cpp.

References DrawString(), lastof, and strecpy().

int DrawStringMultiLine | ( | int | left,
|  | int | right,
|  | int | top,
|  | int | bottom,
|  | StringID | str,
|  | TextColour | colour,
|  | StringAlignment | align,
|  | bool | underline |
| ) |  |  |

Draw string, possibly over multiple lines.

Parameters:

  | left | The left most position to draw on.
  | right | The right most position to draw on.
  | top | The top most position to draw on.
  | bottom | The bottom most position to draw on.
  | str | String to draw.
  | colour | Colour used for drawing the string, see DoDrawString() for details
  | align | The alignment of the string when drawing left-to-right. In the case a right-to-left language is chosen this is inverted so it will be drawn in the right direction.
  | underline | Whether to underline all strings

Returns:
  The bottom to where we have written.

Definition at line 801 of file gfx.cpp.

References _cur_fontsize, DrawString(), FormatStringLinebreaks(), FS_NORMAL, GB(), GetCharacterHeight(), lastof, SA_CENTER, and strecpy().

Referenced by DrawCargoListText(), RefitWindow::DrawWidget(), TownAuthorityWindow::DrawWidget(), NewsWindow::DrawWidget(), QueryWindow::DrawWidget(), TooltipsWindow::DrawWidget(), ErrmsgWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), CompanyWindow::DrawWidget(), AIListWindow::DrawWidget(), EndGameWindow::OnPaint(), ShowAdditionalText(), and ShowRefitOptionsList().

bool FillDrawPixelInfo | ( | DrawPixelInfo * | n,
|  | int | left,
|  | int | top,
|  | int | width,
|  | int | height |
| ) |  |  |

Set up a clipping area for only drawing into a certain area.

To do this, Fill a DrawPixelInfo object with the supplied relative rectangle, backup the original (calling) _cur_dpi and assign the just returned DrawPixelInfo _cur_dpi. When you are done, give restore _cur_dpi's original value

Parameters:

  | *n | the DrawPixelInfo that will be the clipping rectangle box allowed for drawing
  | left,top,width,height | the relative coordinates of the clipping rectangle relative to the current _cur_dpi. This will most likely be the offset from the calling window coordinates

Returns:
  return false if the requested rectangle is not possible with the current dpi pointer. Only continue of the return value is true, or you'll get some nasty results

Definition at line 1602 of file gfx.cpp.

References DrawPixelInfo::dst_ptr, BlitterFactoryBase::GetCurrentBlitter(), DrawPixelInfo::height, DrawPixelInfo::left, Blitter::MoveTo(), DrawPixelInfo::pitch, DrawPixelInfo::top, DrawPixelInfo::width, and DrawPixelInfo::zoom.

Referenced by DrawTrainImage(), and SmallMapWindow::DrawWidget().

uint32 FormatStringLinebreaks | ( | char * | str,
|  | const char * | last,
|  | int | maxw |
| ) |  |  |

'Correct' a string to a maximum length.

Longer strings will be cut into additional lines at whitespace characters if possible. The string parameter is modified with terminating characters mid-string which are the placeholders for the newlines. The string WILL be truncated if there was no whitespace for the current line's maximum width.

Note:
  To know if the terminating '' is the string end or just a newline, the returned 'num' value should be consulted. The num'th '', starting with index 0 is the real string end.

Parameters:

  | str | string to check and correct for length restrictions
  | last | the last valid location (for '') in the buffer of str
  | maxw | the maximum width the string can have on one line

Returns:
  return a 32bit wide number consisting of 2 packed values: 0 - 15 the number of lines ADDED to the string 16 - 31 the fontsize in which the length calculation was done at

Definition at line 640 of file gfx.cpp.

References _cur_fontsize, FS_LARGE, FS_SMALL, GetCharacterWidth(), IsWhitespace(), SCC_BIGFONT, SCC_TINYFONT, and Utf8PrevChar().

Referenced by DrawStringMultiLine(), and GetStringHeight().

void GameSizeChanged | ( |  | ) |

Size of the application screen changed.

Adapt the game screen-size, re-allocate the open windows, and repaint everything

Definition at line 438 of file main_gui.cpp.

References DrawPixelInfo::height, Dimension::height, MarkWholeScreenDirty(), RelocateAllWindows(), DrawPixelInfo::width, and Dimension::width.

static byte GetCharacterHeight | ( | FontSize | size | ) | `[inline, static]`

Get height of a character for a given font size.

Parameters:

  | size | Font size to get height of

Returns:
  Height of characters in the given font (pixels)

Definition at line 170 of file gfx_func.h.

References _font_height.

Referenced by DrawStringMultiLine(), GetMultilineStringHeight(), GetStringBoundingBox(), LoadStringWidthTable(), ReallyDoDrawString(), NWidgetResizeBase::SetMinimalTextLines(), and StationsWndShowStationRating().

byte GetDigitWidth | ( | FontSize | size | ) |

Return the maximum width of single digit.

Parameters:

  | size | Font of the digit

Returns:
  Width of the digit.

Definition at line 1315 of file gfx.cpp.

References GetCharacterWidth(), and max().

Dimension GetSpriteSize | ( | SpriteID | sprid | ) |

Get the size of a sprite.

Parameters:

  | sprid | Sprite to examine.

Returns:
  Sprite size in pixels.

Note:
  The size assumes (0, 0) as top-left coordinate and ignores any part of the sprite drawn at the left or above that position.

Definition at line 1013 of file gfx.cpp.

References Sprite::height, Dimension::height, ST_NORMAL, Sprite::width, Dimension::width, Sprite::x_offs, and Sprite::y_offs.

Referenced by DrawOrderString(), OrdersWindow::DrawWidget(), MakeCompanyButtonRows(), SelectCompanyManagerFaceWindow::OnInit(), NWidgetLeaf::SetupSmallestSize(), and CompanyWindow::UpdateWidgetSize().

Dimension GetStringBoundingBox | ( | StringID | strid | ) |

Get bounding box of a string.

Uses parameters set by DParam if needed. Has the same restrictions as GetStringBoundingBox(const char *str).

Parameters:

  | strid | String to examine.

Returns:
  Width and height of the bounding box for the string in pixels.

Definition at line 903 of file gfx.cpp.

References GetStringBoundingBox(), and lastof.

Dimension GetStringBoundingBox | ( | const char * | str | ) |

Return the string dimension in pixels.

The height and width are returned in a single Dimension value. TINYFONT, BIGFONT modifiers are only supported as the first character of the string. The returned dimensions are therefore a rough estimation correct for all the current strings but not every possible combination

Parameters:

  | str | string to calculate pixel-width

Returns:
  string width and height in pixels

Definition at line 861 of file gfx.cpp.

References _cur_fontsize, FS_LARGE, FS_SMALL, GetCharacterHeight(), GetCharacterWidth(), Dimension::height, max(), SCC_BIGFONT, SCC_TINYFONT, and Dimension::width.

Referenced by DrawLabel(), DrawString(), DrawText(), OrdersWindow::DrawWidget(), ExpensesList::GetCategoriesWidth(), GetStringBoundingBox(), SmallMapWindow::OnInit(), SelectCompanyManagerFaceWindow::OnInit(), NWidgetLeaf::SetupSmallestSize(), NWidgetBackground::SetupSmallestSize(), ViewportSign::UpdatePosition(), VehicleDetailsWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), SelectStationWindow< T >::UpdateWidgetSize(), StationViewWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), TooltipsWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), SetDateWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), SelectCompanyManagerFaceWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), CompanyFinancesWindow::UpdateWidgetSize(), and ReplaceVehicleWindow::UpdateWidgetSize().

int GetStringHeight | ( | StringID | str,
|  | int | maxw |
| ) |  |  |

Calculates height of string (in pixels).

The string is changed to a multiline string if needed.

Parameters:

  | str | string to check
  | maxw | maximum string width

Returns:
  height of pixels of string when it is drawn

Definition at line 763 of file gfx.cpp.

References FormatStringLinebreaks(), GB(), GetMultilineStringHeight(), and lastof.

Referenced by GetStringMultiLineBoundingBox(), TooltipsWindow::UpdateWidgetSize(), and ErrmsgWindow::UpdateWidgetSize().

Dimension GetStringMultiLineBoundingBox | ( | StringID | str,
|  | const Dimension & | suggestion |
| ) |  |  |

Calculate string bounding box for multi-line strings.

Parameters:

  | str | String to check.
  | suggestion | Suggested bounding box.

Returns:
  Bounding box for the multi-line string, may be bigger than suggestion.

Definition at line 779 of file gfx.cpp.

References GetStringHeight(), and Dimension::width.

Referenced by TownAuthorityWindow::UpdateWidgetSize(), NewsWindow::UpdateWidgetSize(), and QueryWindow::UpdateWidgetSize().

void GfxFillRect | ( | int | left,
|  | int | top,
|  | int | right,
|  | int | bottom,
|  | int | colour,
|  | FillRectMode | mode |
| ) |  |  |

Applies a certain FillRectMode-operation to a rectangle [left, right] x [top, bottom] on the screen.

Precondition:
  dpi->zoom == ZOOM_LVL_NORMAL, right >= left, bottom >= top

Parameters:

  | left | Minimum X (inclusive)
  | top | Minimum Y (inclusive)
  | right | Maximum X (inclusive)
  | bottom | Maximum Y (inclusive)
  | colour | A 8 bit palette index (FILLRECT_OPAQUE and FILLRECT_CHECKER) or a recolour spritenumber (FILLRECT_RECOLOUR)
  | mode | FILLRECT_OPAQUE: Fill the rectangle with the specified colour FILLRECT_CHECKER: Like FILLRECT_OPAQUE, but only draw every second pixel (used to grey out things) FILLRECT_RECOLOUR: Apply a recolour sprite to every pixel in the rectangle currently on screen

Definition at line 115 of file gfx.cpp.

References Blitter::DrawColourMappingRect(), Blitter::DrawRect(), DrawPixelInfo::dst_ptr, FILLRECT_CHECKER, FILLRECT_RECOLOUR, GB(), BlitterFactoryBase::GetCurrentBlitter(), DrawPixelInfo::height, DrawPixelInfo::left, Blitter::MoveTo(), PALETTE_WIDTH, Blitter::SetPixel(), DrawPixelInfo::top, DrawPixelInfo::width, and DrawPixelInfo::zoom.

Referenced by NWidgetLeaf::Draw(), NWidgetViewport::Draw(), NWidgetBackground::Draw(), NWidgetToolbarContainer::Draw(), DrawArrowButtons(), DrawCaption(), DrawFrame(), DrawFrameRect(), SmallMapWindow::DrawHorizMapIndicator(), DrawHorizontalScrollbar(), DrawMatrix(), SmallMapWindow::DrawSmallMap(), DrawString(), DrawTrainDetails(), DrawVerticalScrollbar(), SmallMapWindow::DrawVertMapIndicator(), DropdownWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), SmallMapWindow::DrawWidget(), NewsWindow::DrawWidget(), NewGRFAddWindow::DrawWidget(), TooltipsWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), CompanyFinancesWindow::DrawWidget(), DrawYearColumn(), and StationsWndShowStationRating().

void HandleKeypress | ( | uint32 | raw_key | ) |

Handle keyboard input.

Parameters:

  | raw_key | Lower 8 bits contain the ASCII character, the higher 16 bits the keycode

Definition at line 1880 of file window.cpp.

References EditBoxInGlobalFocus(), Window::ES_HANDLED, FindWindowById(), GB(), IsGeneratingWorld(), Window::OnKeyPress(), and Window::window_class.

## Variable Documentation

bool _palette_remap_grf[]

Whether the given NewGRFs must get a palette remap or not.

Definition at line 30 of file gfxinit.cpp.