46 #include "table/strings.h"
60 return GB(window_number, 0, 24);
72 assert((index >> 24) == 0);
73 return (feature << 24) | index;
85 typedef const void *NIOffsetProc(
const void *b);
149 virtual const void *
GetSpec(uint index)
const = 0;
172 virtual uint
Resolve(uint index, uint var, uint param,
bool &avail)
const = 0;
189 virtual const std::span<int32_t>
GetPSA([[maybe_unused]] uint index, [[maybe_unused]] uint32_t grfid)
const
215 SetDParam(0, STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT);
298 this->caller_grfid = grfid;
308 return f == GSF_TRAINS || f == GSF_ROADVEHICLES;
318 if (this->chain_index > 0) {
321 v = v->
Move(this->chain_index);
322 if (v !=
nullptr) index = v->
index;
332 if (this->chain_index == 0)
return;
337 v = v->
Move(this->chain_index);
338 if (v ==
nullptr) this->chain_index = 0;
353 void SetStringParameters(
WidgetID widget)
const override
388 if (offset < 0 || offset >= this->vscroll->
GetCapacity())
return;
404 if (u == v) sel_start = total_width;
408 default: NOT_REACHED();
410 if (u == v) sel_end = total_width;
416 if (total_width >
width) {
417 int sel_center = (sel_start + sel_end) / 2;
418 if (sel_center >
width / 2) skip = std::min(total_width -
width, sel_center -
width / 2);
444 const void *base_spec = nih->
GetSpec(index);
452 uint value = nih->
Resolve(index, niv->var, param, avail);
454 if (!avail)
continue;
457 this->
DrawString(r, i++, fmt::format(
" {:02x}[{:02x}]: {:08x} ({})", niv->var, param, value, niv->name));
459 this->
DrawString(r, i++, fmt::format(
" {:02x}: {:08x} ({})", niv->var, value, niv->name));
464 auto psa = nih->
GetPSA(index, this->caller_grfid);
467 this->
DrawString(r, i++, fmt::format(
"Persistent storage [{:08X}]:",
BSWAP32(this->caller_grfid)));
469 this->
DrawString(r, i++,
"Persistent storage:");
471 assert(psa.size() % 4 == 0);
472 for (
size_t j = 0; j < psa.size(); j += 4) {
473 this->
DrawString(r, i++, fmt::format(
" {}: {} {} {} {}", j, psa[j], psa[j + 1], psa[j + 2], psa[j + 3]));
480 const void *ptr = nip->offset_proc(base);
482 switch (nip->read_size) {
483 case 1: value = *(
const uint8_t *)ptr;
break;
484 case 2: value = *(
const uint16_t *)ptr;
break;
485 case 4: value = *(
const uint32_t *)ptr;
break;
486 default: NOT_REACHED();
493 string = STR_JUST_INT;
504 this->
DrawString(r, i++, fmt::format(
" {:02x}: {} ({})", nip->prop,
GetString(
string), nip->name));
512 const void *ptr = nic->offset_proc(base_spec);
514 switch (nic->read_size) {
515 case 1: value = *(
const uint8_t *)ptr;
break;
516 case 2: value = *(
const uint16_t *)ptr;
break;
517 case 4: value = *(
const uint32_t *)ptr;
break;
518 default: NOT_REACHED();
521 if (!
HasBit(value, nic->cb_bit))
continue;
522 this->
DrawString(r, i++, fmt::format(
" {:03x}: {}", nic->cb_id, nic->name));
524 this->
DrawString(r, i++, fmt::format(
" {:03x}: {} (unmasked)", nic->cb_id, nic->name));
535 void DrawWidget(
const Rect &r,
WidgetID widget)
const override
548 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
559 if (this->chain_index > 0) {
569 if (v !=
nullptr && v->
Next() !=
nullptr) {
583 if (line == INT32_MAX)
return;
587 if (line != 1)
continue;
591 this->current_edit_param = niv->var;
598 void OnQueryTextFinished(std::optional<std::string> str)
override
600 if (!str.has_value() || str->empty())
return;
616 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
618 if (!gui_scope)
return;
630 static constexpr
NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
654 static constexpr
NWidgetPart _nested_newgrf_inspect_widgets[] = {
673 WDP_AUTO,
"newgrf_inspect_chain", 400, 300,
676 _nested_newgrf_inspect_chain_widgets
680 WDP_AUTO,
"newgrf_inspect", 400, 300,
683 _nested_newgrf_inspect_widgets
700 WindowDesc &desc = (feature == GSF_TRAINS || feature == GSF_ROADVEHICLES) ? _newgrf_inspect_chain_desc : _newgrf_inspect_desc;
754 if (nif ==
nullptr)
return false;
775 case STATION_RAIL:
return GSF_STATIONS;
776 case STATION_AIRPORT:
return GSF_AIRPORTTILES;
777 case STATION_BUS:
return GSF_ROADSTOPS;
778 case STATION_TRUCK:
return GSF_ROADSTOPS;
793 case VEH_ROAD:
return GSF_ROADVEHICLES;
805 typedef std::pair<int16_t, int16_t>
XyOffs;
813 static bool crosshair;
824 this->SelectAction5Type();
837 void SetStringParameters(
WidgetID widget)
const override
842 if (this->act5_type !=
nullptr) {
843 SetDParam(0, STR_SPRITE_ALIGNER_CAPTION_ACTION5);
849 SetDParam(0, STR_SPRITE_ALIGNER_CAPTION_ACTIONA);
854 SetDParam(0, STR_SPRITE_ALIGNER_CAPTION_NO_ACTION);
869 const auto key_offs_pair = this->offs_start_map.find(this->current_sprite);
870 if (key_offs_pair != this->offs_start_map.end()) {
899 size.width = d.width + padding.width;
902 fill.height =
resize.height;
911 void DrawWidget(
const Rect &r,
WidgetID widget)
const override
920 if (SpriteAlignerWindow::centre) {
932 DrawSprite(this->current_sprite, PAL_NONE, x, y,
nullptr, SpriteAlignerWindow::zoom);
938 if (SpriteAlignerWindow::crosshair) {
949 const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(widget);
956 for (
auto it = first; it != last; ++it) {
958 if (file ==
nullptr) {
964 DrawString(ir, STR_SPRITE_ALIGNER_SPRITE, *it == this->current_sprite ? TC_WHITE : TC_BLACK);
973 void OnClick([[maybe_unused]]
Point pt,
WidgetID widget, [[maybe_unused]]
int click_count)
override
980 this->SelectAction5Type();
990 this->current_sprite = (this->current_sprite + 1) %
GetMaxSpriteID();
992 this->SelectAction5Type();
998 _newgrf_debug_sprite_picker.
mode = SPM_WAIT_CLICK;
1008 this->SelectAction5Type();
1033 if (this->offs_start_map.count(this->current_sprite) == 0) {
1052 this->offs_start_map.erase(this->current_sprite);
1057 SpriteAlignerWindow::centre = !SpriteAlignerWindow::centre;
1063 SpriteAlignerWindow::crosshair = !SpriteAlignerWindow::crosshair;
1077 void OnQueryTextFinished(std::optional<std::string> str)
override
1079 if (!str.has_value() || str->empty())
return;
1081 this->current_sprite = atoi(str->c_str());
1082 if (this->current_sprite >=
GetMaxSpriteID()) this->current_sprite = 0;
1084 this->current_sprite = (this->current_sprite + 1) %
GetMaxSpriteID();
1086 this->SelectAction5Type();
1095 void OnInvalidateData([[maybe_unused]]
int data = 0, [[maybe_unused]]
bool gui_scope =
true)
override
1097 if (!gui_scope)
return;
1117 void SelectAction5Type()
1120 for (
auto it = std::begin(act5types); it != std::end(act5types); ++it) {
1121 if (it->sprite_base <= this->current_sprite && this->current_sprite < it->sprite_base + it->max_sprites) {
1122 this->act5_type = &*it;
1126 this->act5_type =
nullptr;
1130 bool SpriteAlignerWindow::centre =
true;
1131 bool SpriteAlignerWindow::crosshair =
true;
1133 static constexpr
NWidgetPart _nested_sprite_aligner_widgets[] = {
1183 NWidget(
WWT_MATRIX, COLOUR_GREY,
WID_SA_LIST),
SetResize(1, 1),
SetMatrixDataTip(1, 0, STR_NULL),
SetFill(1, 1),
SetScrollbar(
WID_SA_SCROLLBAR),
1204 WDP_AUTO,
"sprite_aligner", 400, 300,
1207 _nested_sprite_aligner_widgets
1215 AllocateWindowDescFront<SpriteAlignerWindow>(_sprite_aligner_desc, 0);
Class for backupping variables and making sure they are restored later.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
static uint32_t BSWAP32(uint32_t x)
Perform a 32 bits endianness bitswap on x.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
bool IsValidCargoID(CargoID t)
Test whether cargo type is not INVALID_CARGO.
Helper class to wrap some functionality/queries in.
virtual const void * GetInstance(uint index) const =0
Get the instance given an index.
virtual uint Resolve(uint index, uint var, uint param, bool &avail) const =0
Resolve (action2) variable for a given 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 ~NIHelper()=default
Silence a warning.
void SetSimpleStringParameters(StringID string, uint32_t index) const
Helper to make setting the strings easier.
virtual const void * GetSpec(uint index) const =0
Get (NewGRF) specs given an index.
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 const std::span< int32_t > GetPSA([[maybe_unused]] uint index, [[maybe_unused]] uint32_t grfid) const
Gets the span containing the persistent storage.
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.
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.
@ SA_RIGHT
Right align the text (must be a single bit).
@ SA_FORCE
Force the alignment, i.e. don't swap for RTL languages.
@ FS_NORMAL
Index of the normal font in the font tables.
@ 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(StringID 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.
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.
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
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.
void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32_t grfid)
Show the inspect window for a given feature and index.
static const NIFeature * GetFeature(uint window_number)
Get the NIFeature related to the window number.
bool IsNewGRFInspectable(GrfSpecFeature feature, uint index)
Can we inspect the data given a certain feature and index.
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.
static const NIHelper * GetFeatureHelper(uint window_number)
Get the NIHelper 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.
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.
uint GetMaxSpriteID()
Get a reasonable (upper bound) estimate of the maximum SpriteID used in OpenTTD; there will be no spr...
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.
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.
@ TD_RTL
Text is written right-to-left by default.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
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 ID.
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.
const char * name
The human readable name of the callback.
uint8_t cb_bit
The bit that needs to be set for this callback to be enabled.
uint16_t cb_id
The number of the callback.
uint8_t read_size
The number of bytes (i.e. byte, word, dword etc) to read.
Container for all information for a given feature.
const NIHelper * helper
The class container all helper functions.
const NICallback * callbacks
The callbacks associated with this feature.
const NIVariable * variables
The variables associated with this feature.
const NIProperty * properties
The properties associated with this feature.
Representation of the data from a NewGRF property.
uint8_t read_size
Number of bytes (i.e. byte, word, dword etc)
const char * 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 DrawMainPanelWidget(const Rect &r) const
Helper function to draw the main panel widget.
void ValidateChainIndex()
Ensure that this->chain_index is in range.
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.
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 OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
void OnResize() override
Called after the window got resized.
uint chain_index
For ground vehicles: Index in vehicle chain.
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(size_t 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.
int Height() const
Get height of Rect.
Rect Translate(int x, int y) const
Copy and translate Rect by x,y pixels.
Rect Expand(int s) const
Copy and expand Rect by s pixels.
static T * From(Vehicle *v)
Converts a Vehicle to SpecializedVehicle with type checking.
Window used for aligning sprites.
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.
std::map< SpriteID, XyOffs > offs_start_map
Mapping of starting offsets for the sprites which have been aligned in the sprite aligner window.
void OnInvalidateData([[maybe_unused]] int data=0, [[maybe_unused]] bool gui_scope=true) override
Some data on this window has become invalid.
Data structure describing a sprite.
uint16_t width
Width of the sprite.
uint16_t height
Height of the sprite.
int16_t y_offs
Number of pixels to shift the sprite downwards.
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.
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.
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.
static const VehicleID INVALID_VEHICLE
Constant representing a non-existing vehicle.
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.
@ FR_BORDERONLY
Draw border only, no background.
@ WDP_AUTO
Find a place automatically.
int32_t WindowNumber
Number to differentiate different windows of the same class.
@ 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 ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
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.