Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenTTD/OpenTTD
/ functions
Functions
16,191 in github.com/OpenTTD/OpenTTD
⨍
Functions
16,191
◇
Types & classes
3,771
↓ 53 callers
Function
printf
src/3rdparty/fmt/printf.h:621
↓ 52 callers
Method
InitNested
* Perform complete initialization of the #Window with nested widgets, to allow use. * @param window_number Number of the new window. */
src/window.cpp:1823
↓ 52 callers
Method
IsPrimaryVehicle
src/ship.h:48
↓ 52 callers
Method
ReInit
* Re-initialize a window, and optionally change its size. * @param rx Horizontal resize of the window. * @param ry Vertical resize of the window. *
src/window.cpp:980
↓ 52 callers
Method
Recv_string
* Reads characters (bytes) from the packet until it finds a '\0', or reaches a * maximum of \c length characters. * When the '\0' has not been reach
src/network/core/packet.cpp:425
↓ 52 callers
Function
TrackdirToTrack
* Returns the Track that a given Trackdir represents * * This function filters the Track which is used in the Trackdir value and * returns it as a
src/track_func.h:262
↓ 52 callers
Method
Width
* Get width of Rect. * @return width of Rect. */
src/core/geometry_type.hpp:111
↓ 52 callers
Method
begin
src/3rdparty/fmt/ranges.h:763
↓ 51 callers
Function
HandlePlacePushButton
* This code is shared for the majority of the pushbuttons. * Handles e.g. the pressing of a button (to build things), playing of click sound and sets
src/main_gui.cpp:63
↓ 51 callers
Function
SetWindowClassesDirty
* Mark all windows of a particular class as dirty (in need of repainting) * @param cls Window class */
src/window.cpp:3205
↓ 50 callers
Function
DiagDirToAxis
* Convert a DiagDirection to the axis. * * This function returns the axis which belongs to the given * DiagDirection. The axis X belongs to the Dia
src/direction_func.h:214
↓ 50 callers
Method
GetEngine
* Retrieves the engine of the vehicle. * @return Engine of the vehicle. * @pre HasEngineType() == true */
src/vehicle.cpp:718
↓ 50 callers
Method
Height
* Get height of Rect. * @return height of Rect. */
src/core/geometry_type.hpp:117
↓ 50 callers
Method
PushTarget
src/3rdparty/squirrel/squirrel/sqfuncstate.cpp:268
↓ 49 callers
Method
DrawWidgets
* Paint all widgets of a window. */
src/widget.cpp:784
↓ 49 callers
Method
GetDescription
src/saveload/saveload.cpp:1882
↓ 49 callers
Method
GetOrder
* Returns order 'index' of a vehicle or nullptr when it doesn't exists * @param index the order to fetch * @return the found (or not) order */
src/vehicle_base.h:890
↓ 49 callers
Method
Send_string
* Sends a string over the network. It sends out * the string + '\0'. No size-byte or something. * @param data The string to send */
src/network/core/packet.cpp:172
↓ 49 callers
Method
SetCapacityFromWidget
* Set capacity of visible elements from the size and resize properties of a widget. * @param w Window. * @param widget Widget with size and r
src/widget.cpp:2527
↓ 49 callers
Function
SndClickBeep
* Play a beep sound for a click event if enabled in settings. */
src/sound.cpp:253
↓ 49 callers
Function
UnScaleGUI
* Short-hand to apply GUI zoom level. * @param value Pixel amount at #ZoomLevel::Min (full zoom in). * @return Pixel amount at current interface siz
src/zoom_func.h:77
↓ 49 callers
Function
get
src/3rdparty/nlohmann/json.hpp:5342
↓ 49 callers
Method
str
src/3rdparty/catch2/catch.hpp:12081
↓ 49 callers
Function
stringify
src/3rdparty/catch2/catch.hpp:1644
↓ 48 callers
Function
CountBits
src/core/bitmath_func.hpp:238
↓ 48 callers
Function
DrawFrameRect
* Draw frame rectangle. * @param left Left edge of the frame * @param top Top edge of the frame * @param right Right edge of the frame * @pa
src/widget.cpp:307
↓ 48 callers
Function
ShowDropDownList
* Show a drop down list. * @param w Parent window for the list. * @param list Prepopulated DropDownList. * @param selected The initially
src/dropdown.cpp:418
↓ 48 callers
Function
SlCompatTableHeader
* Load a table header in a savegame compatible way. If the savegame was made * before table headers were added, it will fall back to the * SaveLoadC
src/saveload/saveload.cpp:2037
↓ 48 callers
Method
UpdatePosition
* Update the position of the vehicle. This will update the hash that tells * which vehicles are on a tile. */
src/vehicle.cpp:1662
↓ 48 callers
Function
report_error
src/3rdparty/fmt/format-inl.h:135
↓ 47 callers
Function
IsTileOwner
* Checks if a tile belongs to the given owner * * @param tile The tile to check * @param owner The owner to check against * @return True if a tile
src/tile_map.h:214
↓ 47 callers
Function
SlSetArrayIndex
src/saveload/saveload.h:1333
↓ 47 callers
Method
ToStationID
src/order_type.h:31
↓ 46 callers
Method
GetCurrentPos
src/3rdparty/squirrel/squirrel/sqfuncstate.h:26
↓ 46 callers
Function
GetRoadType
src/road_map.h:159
↓ 46 callers
Function
GetSlopePixelZ
* Return world \c Z coordinate of a given point of a tile. Normally this is the * Z of the ground/foundation at the given location, but in some cases
src/landscape.cpp:307
↓ 46 callers
Function
GetTunnelBridgeTransportType
* Tunnel: Get the transport type of the tunnel (road or rail) * Bridge: Get the transport type of the bridge's ramp * @param t The tile to analyze
src/tunnelbridge_map.h:39
↓ 46 callers
Function
IsTransparencySet
* Check if the transparency option bit is set * and if we aren't in the game menu (there's never transparency) * * @param to the structure which tr
src/transparency.h:50
↓ 46 callers
Method
Restore
* Restore the data of this order to the given vehicle. * @param v The vehicle to restore to. * @param user The user that built the vehicle, thus
src/order_backup.cpp:102
↓ 46 callers
Function
SetWindowWidgetDirty
* Mark a particular widget in a particular window as dirty (in need of repainting) * @param cls Window class * @param number Window number in that c
src/window.cpp:3192
↓ 46 callers
Function
ShowQueryString
* Show a query popup window with a textbox in it. * @param str StringID for the text shown in the textbox * @param caption StringID of text shown in
src/misc_gui.cpp:1064
↓ 46 callers
Method
parse_error
src/3rdparty/nlohmann/json.hpp:4510
↓ 45 callers
Method
GetLoadDescription
src/saveload/saveload.cpp:3444
↓ 45 callers
Method
ReadUtf8
* Read UTF-8 character, and advance reader. * @param def Default value to return, if no valid data. * @return Read char, 'def' if no valid data.
src/core/string_consumer.hpp:425
↓ 44 callers
Function
Begin
src/core/pool_type.hpp:58
↓ 44 callers
Function
GetCargoTypeByLabel
src/cargotype.h:216
↓ 44 callers
Method
GetDepotActionType
What are we going to do when in the depot. */
src/order_base.h:152
↓ 44 callers
Method
IsGroundVehicle
* Check if the engine is a ground vehicle. * @return True iff the engine is a train or a road vehicle. */
src/engine_base.h:156
↓ 44 callers
Function
SetAlignment
* Widget part function for setting the alignment of text/images. * @param align Alignment of text/image within widget. * @ingroup NestedWidgetParts
src/widget_type.h:1211
↓ 44 callers
Method
WithHeight
* Copy Rect and set its height. * @param height height in pixels for new Rect. * @param end if set, set height at end of Rect, i.e. at bottom.
src/core/geometry_type.hpp:237
↓ 44 callers
Function
sq_getinteger
src/3rdparty/squirrel/squirrel/sqapi.cpp:524
↓ 43 callers
Method
GetGRF
* Retrieve the NewGRF the vehicle is tied to. * This is the GRF providing the Action 3 for the engine type. * @return NewGRF associated to the vehic
src/vehicle.cpp:728
↓ 43 callers
Function
GetRoadTramType
src/road.h:200
↓ 43 callers
Function
GetWaterClass
* Get the water class at a tile. * @param t Water tile to query. * @pre IsTileType(t, MP_WATER) || IsTileType(t, MP_STATION) || IsTileType(t, MP_IND
src/water_map.h:114
↓ 43 callers
Method
Send_uint32
* Package a 32 bits integer in the packet. * @param data The data to send. */
src/network/core/packet.cpp:141
↓ 43 callers
Method
size
src/3rdparty/fmt/format.h:1292
↓ 42 callers
Method
CloseChildWindows
* Close all children a window might have in a head-recursive manner * @param wc Window class of the window to remove; #WC_INVALID if class does not m
src/window.cpp:1077
↓ 42 callers
Method
RaiseWidget
* Marks a widget as raised. * @param widget_index index of this widget in the window */
src/window_gui.h:470
↓ 42 callers
Method
ReceiveInvalidPacket
* Helper for logging receiving invalid packets. * @param type The received packet type. * @return The status the network should have, in this case:
src/network/core/tcp_game.cpp:147
↓ 42 callers
Function
RemapCoords
* Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap. * @param x X world or tile coordinate (runs in S
src/landscape.h:81
↓ 42 callers
Function
SeedModChance
* Generates a number from given seed. Uses different algorithm than SeedChance(). * @param shift_by number of bits seed is shifted to the right * @p
src/townname.cpp:178
↓ 42 callers
Function
SetPIPRatio
* Widget part function for setting a pre/inter/post ratio. * @param pre The ratio of space before the first widget. * @param inter The ratio of spac
src/widget_type.h:1390
↓ 42 callers
Function
TileAddByDiagDir
* Adds a DiagDir to a tile. * * @param tile The current tile * @param dir The direction in which we want to step * @return the moved tile */
src/map_func.h:624
↓ 42 callers
Method
empty
src/3rdparty/nlohmann/json.hpp:6308
↓ 42 callers
Function
type_name
@brief return the type as string @sa https://json.nlohmann.me/api/basic_json/type_name/
src/3rdparty/nlohmann/json.hpp:23459
↓ 41 callers
Function
CeilDiv
* Computes ceil(a / b) for non-negative a and b. * @param a Numerator * @param b Denominator * @return Quotient, rounded up */
src/core/math_func.hpp:310
↓ 41 callers
Function
GetStationType
* Get the station type of this tile * @param t the tile to query * @pre IsTileType(t, MP_STATION) * @return the station type */
src/station_map.h:44
↓ 41 callers
Function
GetTileMaxZ
* Get top height of the tile inside the map. * @param t Tile to compute height of * @return Maximum height of the tile */
src/tile_map.cpp:136
↓ 41 callers
Function
SetTileOwner
* Sets the owner of a tile * * This function sets the owner status of a tile. Note that you cannot * set a owner for tiles of type MP_HOUSE, MP_VOI
src/tile_map.h:198
↓ 41 callers
Method
data
Returns a pointer to the buffer data (not null-terminated).
src/3rdparty/fmt/base.h:1768
↓ 41 callers
Method
fill
src/3rdparty/fmt/base.h:812
↓ 41 callers
Method
value
src/3rdparty/fmt/base.h:2126
↓ 40 callers
Method
FirstShared
* Get the first vehicle of this vehicle chain. * @return the first vehicle of the chain. */
src/vehicle_base.h:693
↓ 40 callers
Function
RandomRange
* Pick a random number between 0 and \a limit - 1, inclusive. That means 0 * can be returned and \a limit - 1 can be returned, but \a limit can not b
src/core/random_func.hpp:88
↓ 40 callers
Method
ReadDword
* Read a double word (32 bits) from the file (in low endian format). * @return Read word. */
src/random_access_file.cpp:134
↓ 40 callers
Method
ReadIf
* Check whether the next data matches 'str', and skip it. */
src/core/string_consumer.hpp:454
↓ 40 callers
Method
UsesOverlay
src/road.h:170
↓ 39 callers
Function
ClosestTownFromTile
* Return the town closest (in distance or ownership) to a given tile, within a given threshold. * @param tile Starting point of the search. * @
src/town_cmd.cpp:3961
↓ 39 callers
Function
DirtyCompanyInfrastructureWindows
* Redraw all windows with company infrastructure counts. * @param company The company to redraw the windows of. */
src/company_gui.cpp:2318
↓ 39 callers
Method
GetText
* Get the current text. * @return Current text. */
src/textbuf.cpp:284
↓ 39 callers
Function
GetTrackBits
* Gets the track bits of the given tile * @param tile the tile to get the track bits from * @return the track bits of the tile */
src/rail_map.h:136
↓ 39 callers
Function
IsSteepSlope
* Checks if a slope is steep. * * @param s The given #Slope. * @return True if the slope is steep, else false. */
src/slope_func.h:36
↓ 39 callers
Function
IsWaterTile
* Is it a water tile with plain water? * @param t Tile to query. * @return \c true if it is a plain water tile. */
src/water_map.h:192
↓ 39 callers
Method
Pop
src/3rdparty/squirrel/squirrel/sqvm.cpp:1533
↓ 39 callers
Method
ReadByte
* Read a byte from the file. * @return Read byte. */
src/random_access_file.cpp:107
↓ 39 callers
Method
ReceiveInvalidPacket
* Helper for logging receiving invalid packets. * @param type The received packet type. * @return The status the network should have, in this case:
src/network/core/tcp_admin.cpp:120
↓ 39 callers
Function
sq_gettop
src/3rdparty/squirrel/squirrel/sqapi.cpp:679
↓ 38 callers
Function
Chance16
* Flips a coin with given probability. * * This function returns true with (a/b) probability. * * @see Chance16I() * @param a The nominator of th
src/core/random_func.hpp:134
↓ 38 callers
Method
DisableWidget
* Sets a widget to disabled. * @param widget_index index of this widget in the window */
src/window_gui.h:392
↓ 38 callers
Function
EnsureNoVehicleOnGround
* Ensure there is no vehicle at the ground at the given position. * @param tile Position to examine. * @return Succeeded command (ground is free) or
src/vehicle.cpp:527
↓ 38 callers
Function
FioFOpenFile
* Opens a OpenTTD file somewhere in a personal or global directory. * @param filename Name of the file to open. * @param subdir Subdirectory to open
src/fileio.cpp:242
↓ 38 callers
Function
GetRoadTypeRoad
src/road_map.h:147
↓ 38 callers
Function
GfxDrawLine
src/gfx.cpp:393
↓ 38 callers
Function
RoadTypeIsRoad
src/road.h:190
↓ 38 callers
Method
SetSprite
* Set sprite of the nested widget. * @param sprite The new sprite. */
src/widget.cpp:1202
↓ 38 callers
Method
Translate
* Copy and translate Rect by x,y pixels. * @param x number of pixels to move horizontally. * @param y number of pixels to move vertically. * @re
src/core/geometry_type.hpp:200
↓ 38 callers
Function
add
add a character to token_buffer
src/3rdparty/nlohmann/json.hpp:8773
↓ 37 callers
Function
DiagDirToRoadBits
* Create the road-part which belongs to the given DiagDirection * * This function returns a RoadBits value which belongs to * the given DiagDirecti
src/road_func.h:96
↓ 37 callers
Method
GetNonStopType
At which stations must we stop? */
src/order_base.h:146
↓ 37 callers
Function
SndPlayTileFx
src/sound.cpp:225
← previous
next →
201–300 of 16,191, ranked by callers