47#include "table/strings.h"
61 return GB(window_number, 0, 24);
73 assert((index >> 24) == 0);
74 return (feature << 24) | index;
88typedef const void *NIOffsetProc(
const void *b);
125 std::string_view name;
161 virtual const void *
GetSpec(uint index)
const = 0;
181 virtual std::span<const BadgeID>
GetBadges(uint index)
const = 0;
191 virtual uint
Resolve(uint index, uint var, uint param,
bool &avail)
const = 0;
208 virtual const std::span<int32_t>
GetPSA([[maybe_unused]] uint index, [[maybe_unused]] uint32_t grfid)
const
234 SetDParam(0, STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT);
322 this->caller_grfid = grfid;
332 return f == GSF_TRAINS || f == GSF_ROADVEHICLES;
342 if (this->chain_index > 0) {
345 v = v->
Move(this->chain_index);
346 if (v !=
nullptr) index = v->
index.base();
356 if (this->chain_index == 0)
return;
361 v = v->
Move(this->chain_index);
362 if (v ==
nullptr) this->chain_index = 0;
427 for (
const Vehicle *u = v->
First(); u !=
nullptr; u = u->Next()) {
432 default: NOT_REACHED();
434 if (u == v)
sel_end = total_width;
440 if (total_width >
width) {
471 if (!
nif->variables.empty()) {
476 uint value =
nih.Resolve(index,
niv.var, param,
avail);
478 if (!
avail)
continue;
481 this->
DrawString(r, i++, fmt::format(
" {:02x}[{:02x}]: {:08x} ({})",
niv.var, param, value,
niv.name));
483 this->
DrawString(r, i++, fmt::format(
" {:02x}: {:08x} ({})",
niv.var, value,
niv.name));
488 auto psa =
nih.GetPSA(index, this->caller_grfid);
490 if (
nih.PSAWithParameter()) {
491 this->
DrawString(r, i++, fmt::format(
"Persistent storage [{:08X}]:", std::byteswap(this->caller_grfid)));
493 this->
DrawString(r, i++,
"Persistent storage:");
495 assert(psa.size() % 4 == 0);
496 for (
size_t j = 0; j < psa.size(); j += 4) {
497 this->
DrawString(r, i++, fmt::format(
" {}: {} {} {} {}", j, psa[j], psa[j + 1], psa[j + 2], psa[j + 3]));
501 auto badges =
nih.GetBadges(index);
502 if (!badges.empty()) {
510 if (!
nif->properties.empty()) {
513 const void *ptr =
nip.offset_proc(base);
515 switch (
nip.read_size) {
516 case 1: value = *(
const uint8_t *)ptr;
break;
517 case 2: value = *(
const uint16_t *)ptr;
break;
518 case 4: value = *(
const uint32_t *)ptr;
break;
519 default: NOT_REACHED();
541 if (!
nif->callbacks.empty()) {
544 if (!std::holds_alternative<std::monostate>(
nic.cb_bit)) {
547 switch (
nic.read_size) {
548 case 1: value = *(
const uint8_t *)ptr;
break;
549 case 2: value = *(
const uint16_t *)ptr;
break;
550 case 4: value = *(
const uint32_t *)ptr;
break;
551 default: NOT_REACHED();
557 bool operator()(
const std::monostate &) {
return false; }
570 if (!std::visit(
visitor{value},
nic.cb_bit))
continue;
573 this->
DrawString(r, i++, fmt::format(
" {:03x}: {} (unmasked)",
nic.cb_id,
nic.name));
608 if (this->chain_index > 0) {
618 if (v !=
nullptr && v->
Next() !=
nullptr) {
636 if (--line != 0)
continue;
640 this->current_edit_param =
niv.var;
649 if (!str.has_value() || str->empty())
return;
679static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
703static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = {
722 WDP_AUTO,
"newgrf_inspect_chain", 400, 300,
725 _nested_newgrf_inspect_chain_widgets
729 WDP_AUTO,
"newgrf_inspect", 400, 300,
732 _nested_newgrf_inspect_widgets
749 WindowDesc &desc = (feature == GSF_TRAINS || feature == GSF_ROADVEHICLES) ? _newgrf_inspect_chain_desc : _newgrf_inspect_desc;
803 if (nif ==
nullptr)
return false;
804 return nif->
helper->IsInspectable(index);
824 case StationType::Rail:
return GSF_STATIONS;
825 case StationType::Airport:
return GSF_AIRPORTTILES;
826 case StationType::Bus:
return GSF_ROADSTOPS;
827 case StationType::Truck:
return GSF_ROADSTOPS;
842 case VEH_ROAD:
return GSF_ROADVEHICLES;
854 typedef std::pair<int16_t, int16_t>
XyOffs;
862 static bool crosshair;
873 this->SelectAction5Type();
891 if (this->act5_type !=
nullptr) {
918 const auto key_offs_pair = this->offs_start_map.find(this->current_sprite);
948 size.width =
d.width + padding.width;
969 if (SpriteAlignerWindow::centre) {
981 DrawSprite(this->current_sprite, PAL_NONE, x, y,
nullptr, SpriteAlignerWindow::zoom);
987 if (SpriteAlignerWindow::crosshair) {
988 GfxDrawLine(x, 0, x,
ir.Height() - 1,
PC_WHITE, 1, 1);
989 GfxDrawLine(0, y,
ir.Width() - 1, y,
PC_WHITE, 1, 1);
999 int step_size =
nwid->resize_y;
1005 for (
auto it = first; it !=
last; ++it) {
1007 if (file ==
nullptr) {
1015 ir.top += step_size;
1029 this->SelectAction5Type();
1039 this->current_sprite = (this->current_sprite + 1) %
GetMaxSpriteID();
1041 this->SelectAction5Type();
1047 _newgrf_debug_sprite_picker.
mode = SPM_WAIT_CLICK;
1057 this->SelectAction5Type();
1082 if (this->offs_start_map.count(
this->current_sprite) == 0) {
1101 this->offs_start_map.erase(this->current_sprite);
1106 SpriteAlignerWindow::centre = !SpriteAlignerWindow::centre;
1112 SpriteAlignerWindow::crosshair = !SpriteAlignerWindow::crosshair;
1128 if (!str.has_value() || str->empty())
return;
1130 this->current_sprite =
atoi(str->c_str());
1131 if (this->current_sprite >=
GetMaxSpriteID()) this->current_sprite = 0;
1133 this->current_sprite = (this->current_sprite + 1) %
GetMaxSpriteID();
1135 this->SelectAction5Type();
1166 void SelectAction5Type()
1170 if (it->sprite_base <=
this->current_sprite &&
this->current_sprite < it->sprite_base + it->max_sprites) {
1171 this->act5_type = &*it;
1175 this->act5_type =
nullptr;
1179bool SpriteAlignerWindow::centre =
true;
1180bool SpriteAlignerWindow::crosshair =
true;
1182static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = {
1232 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_SA_LIST),
SetResize(1, 1),
SetMatrixDataTip(1, 0),
SetFill(1, 1),
SetScrollbar(
WID_SA_SCROLLBAR),
1253 WDP_AUTO,
"sprite_aligner", 400, 300,
1256 _nested_sprite_aligner_widgets
1264 AllocateWindowDescFront<SpriteAlignerWindow>(_sprite_aligner_desc, 0);
Class for backupping variables and making sure they are restored later.
debug_inline static constexpr uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
bool IsValidCargoType(CargoType t)
Test whether cargo type is not INVALID_CARGO.
std::string label
Label of badge.
Helper class to wrap some functionality/queries in.
virtual std::span< const BadgeID > GetBadges(uint index) const =0
Get the list of badges of this item.
virtual uint Resolve(uint index, uint var, uint param, bool &avail) const =0
Resolve (action2) variable for a given index.
virtual const void * GetSpec(uint index) const =0
Get (NewGRF) specs given an index.
virtual bool IsInspectable(uint index) const =0
Is the item with the given index inspectable?
virtual uint32_t GetGRFID(uint index) const =0
Get the GRFID of the file that includes this item.
virtual const void * GetInstance(uint index) const =0
Get the instance given an index.
virtual const std::span< int32_t > GetPSA(uint index, uint32_t grfid) const
Gets the span containing the persistent storage.
virtual ~NIHelper()=default
Silence a warning.
void SetSimpleStringParameters(StringID string, uint32_t index) const
Helper to make setting the strings easier.
virtual bool PSAWithParameter() const
Used to decide if the PSA needs a parameter or not.
void SetObjectAtStringParameters(StringID string, uint32_t index, TileIndex tile) const
Helper to make setting the strings easier for objects at a specific tile.
virtual void SetStringParameters(uint index) const =0
Set the string parameters to write the right data for a STRINGn.
virtual uint GetParent(uint index) const =0
Get the parent "window_number" of a given instance.
const std::string & GetSimplifiedFilename() const
Get the simplified filename of the opened file.
RandomAccessFile with some extra information specific for sprite files.
A type is considered 'convertible through base()' when it has a 'base()' function that returns someth...
VehicleCellSize GetVehicleImageCellSize(VehicleType type, EngineImageType image_type)
Get the GUI cell size for a vehicle image.
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
Dimension GetStringBoundingBox(std::string_view str, FontSize start_fontsize)
Return the string dimension in pixels.
void DrawRectOutline(const Rect &r, int colour, int width, int dash)
Draw the outline of a Rect.
int DrawString(int left, int right, int top, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly truncated to make it fit in its allocated space.
bool _ctrl_pressed
Is Ctrl pressed?
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
ZoomLevel _gui_zoom
GUI Zoom level.
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
Set up a clipping area for only drawing into a certain area.
int CenterBounds(int min, int max, int size)
Determine where to draw a centred object inside a widget.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
@ Normal
The most basic (normal) sprite.
@ FS_NORMAL
Index of the normal font in the font tables.
@ SA_RIGHT
Right align the text (must be a single bit).
@ SA_FORCE
Force the alignment, i.e. don't swap for RTL languages.
@ TC_NO_SHADE
Do not add shading to this text colour.
void SetDirty() const
Mark entire window as dirty (in need of re-paint)
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
constexpr bool IsInsideBS(const T x, const size_t base, const size_t size)
Checks if a value is between a window started at some base point.
constexpr T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
void ShowQueryString(std::string_view str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
std::span< const Action5Type > GetAction5Types()
Get list of all action 5 types.
@ GSF_INVALID
An invalid spec feature.
@ GSF_FAKE_END
End of the fake features.
Information about NewGRF Action 5.
NewGRF handling of airports.
NewGRF handling of airport tiles.
Badge * GetBadge(BadgeID index)
Get a badge if it exists.
Functions related to NewGRF badges.
AirportTileCallbackMask
Callback masks for airport tiles.
StationCallbackMask
Callback masks for stations.
VehicleCallbackMask
Callback masks for vehicles, indicates which callbacks are used by a vehicle.
CargoCallbackMask
Callback masks for cargoes.
IndustryCallbackMask
Callback masks for Industries.
CanalCallbackMask
Callback masks for canals.
ObjectCallbackMask
Callback masks for objects.
RoadStopCallbackMask
Callback masks for road stops.
IndustryTileCallbackMask
Callback masks for industry tiles.
HouseCallbackMask
Callback masks for houses.
Functions/types related to NewGRF debugging.
Data 'tables' for NewGRF debugging.
static const NIFeature *const _nifeatures[]
Table with all NIFeatures.
static uint GetInspectWindowNumber(GrfSpecFeature feature, uint index)
Get the window number for the inspect window given a feature and index.
NIType
The type of a property to show.
@ NIT_INT
The property is a simple integer.
@ NIT_CARGO
The property is a cargo.
void ShowSpriteAlignerWindow()
Show the window for aligning sprites.
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
void InvalidateNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Invalidate the inspect window for a given feature and index.
static const NIFeature * GetFeature(uint window_number)
Get the NIFeature related to the window number.
void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32_t grfid)
Show the inspect window for a given feature and index.
bool IsNewGRFInspectable(GrfSpecFeature feature, uint index)
Can we inspect the data given a certain feature and index.
static const NIHelper & GetFeatureHelper(uint window_number)
Get the NIHelper related to the window number.
static uint GetFeatureIndex(uint window_number)
Get the feature index related to the window number.
void DeleteNewGRFInspectWindow(GrfSpecFeature feature, uint index)
Delete inspect window for a given feature and index.
static GrfSpecFeature GetFeatureNum(uint window_number)
Get the feature number related to the window number.
NewGrfDebugSpritePicker _newgrf_debug_sprite_picker
The sprite picker.
Functions for NewGRF industries.
NewGRF handling of industry tiles.
Functions related to NewGRF objects.
NewGRF handling of rail types.
Header file for NewGRF stations.
Functions to handle the town part of NewGRF towns.
static const uint8_t PC_WHITE
White palette colour.
static const uint8_t PC_LIGHT_BLUE
Light blue palette colour.
Class related to random access to files.
bool IsLevelCrossing(Tile t)
Return whether a tile is a level crossing.
A number of safeguards to prevent using unsafe methods.
ClientSettings _settings_client
The current settings for this game.
SpriteType GetSpriteType(SpriteID sprite)
Get the sprite type of a given sprite.
SpriteID GetMaxSpriteID()
Get a reasonable (upper bound) estimate of the maximum SpriteID used in OpenTTD; there will be no spr...
std::span< const std::unique_ptr< SpriteFile > > GetCachedSpriteFiles()
Get the list of cached SpriteFiles.
SpriteFile * GetOriginFile(SpriteID sprite)
Get the SpriteFile of a given sprite.
uint32_t GetSpriteLocalID(SpriteID sprite)
Get the GRF-local sprite id of a given sprite.
Functions to cache sprites in memory.
static const SpriteID SPR_OPENTTD_BASE
Extra graphic spritenumbers.
Base classes/functions for stations.
StationType GetStationType(Tile t)
Get the station type of this tile.
Definition of base types and functions in a cross-platform compatible way.
static void StrMakeValid(T &dst, const char *str, const char *last, StringValidationSettings settings)
Copies the valid (UTF-8) characters from str up to last to the dst.
Functions related to low-level strings.
@ CS_HEXADECIMAL
Only hexadecimal characters.
@ CS_NUMERAL
Only numeric ones.
void SetDParam(size_t n, uint64_t v)
Set a string parameter v at index n in the global string parameter array.
std::string GetString(StringID string)
Resolve the given StringID into a std::string with all the associated DParam lookups and formatting.
TextDirection _current_text_dir
Text direction of the currently selected language.
void SetDParamStr(size_t n, const char *str)
This function is used to "bind" a C string to a OpenTTD dparam slot.
void SetDParamMaxDigits(size_t n, uint count, FontSize size)
Set DParam n to some number that is suitable for string size computations.
Functions related to OTTD's strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
@ TD_RTL
Text is written right-to-left by default.
Information about a single action 5 type.
SpriteID sprite_base
Load the sprites starting from this sprite.
Class to backup a specific variable and restore it upon destruction of this object to prevent stack v...
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo type.
StringID name
Name of this type of cargo.
GUISettings gui
settings related to the GUI
Dimensions (a width and height) of a rectangle in 2D.
Data about how and where to blit pixels.
ZoomLevel zoom_min
minimum zoom out level
ZoomLevel zoom_max
maximum zoom out level
Representation of the available callbacks with information on when they actually apply.
NIOffsetProc * offset_proc
Callback proc to get the actual variable address in memory.
std::string_view name
The human readable name of the callback.
uint16_t cb_id
The number of the callback.
std::variant< std::monostate, VehicleCallbackMask, StationCallbackMask, RoadStopCallbackMask, HouseCallbackMask, CanalCallbackMask, CargoCallbackMask, IndustryCallbackMask, IndustryTileCallbackMask, ObjectCallbackMask, AirportTileCallbackMask > cb_bit
The bit that needs to be set for this callback to be enabled.
uint8_t read_size
The number of bytes (i.e. byte, word, dword etc) to read.
Container for all information for a given feature.
std::span< const NICallback > callbacks
The callbacks associated with this feature.
std::span< const NIVariable > variables
The variables associated with this feature.
std::span< const NIProperty > properties
The properties associated with this feature.
std::unique_ptr< const NIHelper > helper
The class container all helper functions.
Representation of the data from a NewGRF property.
uint8_t read_size
Number of bytes (i.e. byte, word, dword etc)
std::string_view name
A (human readable) name for the property.
NIOffsetProc * offset_proc
Callback proc to get the actual variable address in memory.
uint8_t prop
The number of the property.
Representation on the NewGRF variables.
Window used for inspecting NewGRFs.
static bool HasVariableParameter(uint variable)
Check whether the given variable has a parameter.
static uint32_t var60params[GSF_FAKE_END][0x20]
The value for the variable 60 parameters.
void DrawWidget(const Rect &r, WidgetID widget) const override
Draw the contents of a nested widget.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
void DrawMainPanelWidget(const Rect &r) const
Helper function to draw the main panel widget.
void ValidateChainIndex()
Ensure that this->chain_index is in range.
void OnQueryTextFinished(std::optional< std::string > str) override
The query window opened from this window has closed.
void DrawString(const Rect &r, int offset, const std::string &string) const
Helper function to draw a string (line) in the window.
bool HasChainIndex() const
Check whether this feature has chain index, i.e.
uint32_t caller_grfid
GRFID of the caller of this window, 0 if it has no caller.
void DrawVehicleChainWidget(const Rect &r) const
Helper function to draw the vehicle chain widget.
void SetStringParameters(WidgetID widget) const override
Initialize string parameters for a widget.
uint GetFeatureIndex() const
Get the feature index.
void SetCallerGRFID(uint32_t grfid)
Set the GRFID of the item opening this window.
uint8_t current_edit_param
The currently edited parameter, to update the right one.
void OnResize() override
Called after the window got resized.
void UpdateWidgetSize(WidgetID widget, Dimension &size, const Dimension &padding, Dimension &fill, Dimension &resize) override
Update size and resize step of a widget in the window.
uint chain_index
For ground vehicles: Index in vehicle chain.
void OnClick(Point pt, WidgetID widget, int click_count) override
A click with the left mouse button has been made on the window.
Spritepicker of SpriteAligner.
NewGrfDebugSpritePickerMode mode
Current state.
std::vector< SpriteID > sprites
Sprites found.
Coordinates of a point in 2D.
Tindex index
Index of this pool item.
static Titem * Get(auto index)
Returns Titem with given index.
constexpr uint Vertical() const
Get total vertical padding of RectPadding.
Specification of a rectangle with absolute coordinates of all edges.
int Width() const
Get width of Rect.
Rect Shrink(int s) const
Copy and shrink Rect by s pixels.
Rect Translate(int x, int y) const
Copy and translate Rect by x,y pixels.
static T * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
Window used for aligning sprites.
void SetStringParameters(WidgetID widget) const override
Initialize string parameters for a widget.
void DrawWidget(const Rect &r, WidgetID widget) const override
Draw the contents of a nested widget.
void UpdateWidgetSize(WidgetID widget, Dimension &size, const Dimension &padding, Dimension &fill, Dimension &resize) override
Update size and resize step of a widget in the window.
std::pair< int16_t, int16_t > XyOffs
Pair for x and y offsets of the sprite before alignment. First value contains the x offset,...
const Action5Type * act5_type
Sprite Area of current selected sprite.
void OnResize() override
Called after the window got resized.
SpriteID current_sprite
The currently shown sprite.
void OnInvalidateData(int data=0, bool gui_scope=true) override
Some data on this window has become invalid.
std::map< SpriteID, XyOffs > offs_start_map
Mapping of starting offsets for the sprites which have been aligned in the sprite aligner window.
void OnClick(Point pt, WidgetID widget, int click_count) override
A click with the left mouse button has been made on the window.
void OnQueryTextFinished(std::optional< std::string > str) override
The query window opened from this window has closed.
Data structure describing a sprite.
int16_t x_offs
Number of pixels to shift the sprite to the right.
uint height
Vehicle cell height.
Vehicle * Move(int n)
Get the vehicle at offset n of this vehicle chain.
Vehicle * First() const
Get the first vehicle of this vehicle chain.
Vehicle * Next() const
Get the next vehicle of this vehicle.
High level window description.
Number to differentiate different windows of the same class.
Data structure for an opened window.
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
void InvalidateData(int data=0, bool gui_scope=true)
Mark this window's data as invalid (in need of re-computing)
void RaiseWidget(WidgetID widget_index)
Marks a widget as raised.
virtual void ShowNewGRFInspectWindow() const
Show the NewGRF inspection window.
ResizeInfo resize
Resize information.
void SetWidgetsDisabledState(bool disab_stat, Args... widgets)
Sets the enabled/disabled status of a list of widgets.
void CreateNestedTree()
Perform the first part of the initialization of a nested widget tree.
void SetWidgetsLoweredState(bool lowered_stat, Args... widgets)
Sets the lowered/raised status of a list of widgets.
void SetWidgetLoweredState(WidgetID widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
const NWID * GetWidget(WidgetID widnum) const
Get the nested widget with number widnum from the nested widget tree.
void LowerWidget(WidgetID widget_index)
Marks a widget as lowered.
const Scrollbar * GetScrollbar(WidgetID widnum) const
Return the Scrollbar to a widget index.
void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
Sets the enabled/disabled status of a widget.
int height
Height of the window (number of pixels down in y direction)
int width
width of the window (number of pixels to the right in x direction)
WindowNumber window_number
Window number within the window class.
Stuff related to the text buffer GUI.
static debug_inline TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
@ MP_ROAD
A tile with road (or tram tracks)
@ MP_STATION
A tile of a station.
@ MP_HOUSE
A house by a town.
@ MP_INDUSTRY
Part of an industry.
@ MP_OBJECT
Contains objects such as transmitters and owned land.
Base for the train class.
Base class for all vehicles.
void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip)
Draws an image of a vehicle chain.
Functions related to the vehicle's GUIs.
@ EIT_IN_DEPOT
Vehicle drawn in depot.
@ EIT_IN_DETAILS
Vehicle drawn in vehicle details, refit window, ...
VehicleType
Available vehicle types.
@ VEH_ROAD
Road vehicle type.
@ VEH_AIRCRAFT
Aircraft vehicle type.
@ VEH_SHIP
Ship vehicle type.
@ VEH_TRAIN
Train vehicle type.
void CloseWindowById(WindowClass cls, WindowNumber number, bool force, int data)
Close a window by its class and window number (if it is open).
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data, bool gui_scope)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
Window functions not directly related to making/drawing windows.
Functions, definitions and such used only by the GUI.
@ BorderOnly
Draw border only, no background.
@ WDP_AUTO
Find a place automatically.
@ WC_LAND_INFO
Land info window; Window numbers:
@ WC_SPRITE_ALIGNER
Sprite aligner (debug); Window numbers:
@ WC_NONE
No window, redirects to WC_MAIN_WINDOW.
@ WC_NEWGRF_INSPECT
NewGRF inspect (debug); Window numbers:
Functions related to zooming.
int ScaleByZoom(int value, ZoomLevel zoom)
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_MIN) When shifting right,...
int UnScaleByZoom(int value, ZoomLevel zoom)
Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_MIN) When shifting right,...
ZoomLevel
All zoom levels we know.
@ ZOOM_LVL_NORMAL
The normal zoom level.
@ ZOOM_LVL_BEGIN
Begin for iteration.
@ ZOOM_LVL_OUT_4X
Zoomed 4 times out.
@ ZOOM_LVL_OUT_2X
Zoomed 2 times out.
@ ZOOM_LVL_OUT_8X
Zoomed 8 times out.
@ ZOOM_LVL_IN_2X
Zoomed 2 times in.
@ ZOOM_LVL_END
End for iteration.
@ ZOOM_LVL_IN_4X
Zoomed 4 times in.