OpenTTD Source 20241224-master-gf74b0cf984
|
Functions related to transparency. More...
Go to the source code of this file.
Typedefs | |
typedef uint | TransparencyOptionBits |
transparency option bits | |
Enumerations | |
enum | TransparencyOption { TO_SIGNS = 0 , TO_TREES , TO_HOUSES , TO_INDUSTRIES , TO_BUILDINGS , TO_BRIDGES , TO_STRUCTURES , TO_CATENARY , TO_TEXT , TO_END , TO_INVALID } |
Transparency option bits: which position in _transparency_opt stands for which transparency. More... | |
Functions | |
bool | IsTransparencySet (TransparencyOption to) |
Check if the transparency option bit is set and if we aren't in the game menu (there's never transparency) | |
bool | IsInvisibilitySet (TransparencyOption to) |
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transparency) | |
void | ToggleTransparency (TransparencyOption to) |
Toggle the transparency option bit. | |
void | ToggleInvisibility (TransparencyOption to) |
Toggle the invisibility option bit. | |
void | ToggleInvisibilityWithTransparency (TransparencyOption to) |
Toggles between invisible and solid state. | |
void | ToggleTransparencyLock (TransparencyOption to) |
Toggle the transparency lock bit. | |
void | ResetRestoreAllTransparency () |
Set or clear all non-locked transparency options. | |
Variables | |
TransparencyOptionBits | _transparency_opt |
The bits that should be transparent. | |
TransparencyOptionBits | _transparency_lock |
Prevent these bits from flipping with X. | |
TransparencyOptionBits | _invisibility_opt |
The bits that should be invisible. | |
uint8_t | _display_opt |
What do we want to draw/do? | |
Functions related to transparency.
Definition in file transparency.h.
typedef uint TransparencyOptionBits |
transparency option bits
Definition at line 36 of file transparency.h.
enum TransparencyOption |
Transparency option bits: which position in _transparency_opt stands for which transparency.
If you change the order, change the order of the ShowTransparencyToolbar() stuff in transparency_gui.cpp too. If you add or remove an option don't forget to change the transparency 'hot keys' in main_gui.cpp.
Definition at line 22 of file transparency.h.
|
inline |
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transparency)
to | the structure which invisibility option is ask for |
Definition at line 59 of file transparency.h.
References _invisibility_opt, _transparency_opt, and HasBit().
Referenced by CheckClickOnViewportSign(), DoDrawVehicle(), DrawBridgeMiddle(), DrawBridgeRoadBits(), DrawCommonTileSeq(), DrawRoadBits(), DrawTile_Town(), DrawWaterTileStruct(), HasRailCatenaryDrawn(), HasRoadCatenaryDrawn(), and ToggleInvisibilityWithTransparency().
|
inline |
Check if the transparency option bit is set and if we aren't in the game menu (there's never transparency)
to | the structure which transparency option is ask for |
Definition at line 48 of file transparency.h.
References _transparency_opt, and HasBit().
Referenced by DoDrawVehicle(), DrawBridgeMiddle(), DrawBridgeRoadBits(), DrawCommonTileSeq(), DrawPillar(), DrawRailCatenary(), DrawRailCatenaryOnBridge(), DrawRailCatenaryOnTunnel(), DrawRailCatenaryRailway(), DrawRoadBits(), DrawRoadTypeCatenary(), DrawTile_Town(), DrawTile_TunnelBridge(), DrawWaterTileStruct(), TransparenciesWindow::OnClick(), TransparenciesWindow::OnInvalidateData(), and ToolbarOptionsClick().
|
inline |
Set or clear all non-locked transparency options.
Definition at line 113 of file transparency.h.
References _transparency_lock, _transparency_opt, GB(), and MarkWholeScreenDirty().
Referenced by MainWindow::OnHotkey().
|
inline |
Toggle the invisibility option bit.
to | the structure which invisibility option is toggle |
Definition at line 79 of file transparency.h.
References _invisibility_opt, and ToggleBit().
Referenced by TransparenciesWindow::OnClick().
|
inline |
Toggles between invisible and solid state.
If object is transparent, then it is made invisible. Used by the keyboard shortcuts.
to | the object type which invisibility option to toggle |
Definition at line 91 of file transparency.h.
References _invisibility_opt, _transparency_opt, ClrBit(), IsInvisibilitySet(), and SetBit().
Referenced by MainWindow::OnHotkey().
|
inline |
Toggle the transparency option bit.
to | the transparency option to be toggled |
Definition at line 69 of file transparency.h.
References _transparency_opt, and ToggleBit().
Referenced by MenuClickSettings(), TransparenciesWindow::OnClick(), and MainWindow::OnHotkey().
|
inline |
Toggle the transparency lock bit.
to | the transparency option to be locked or unlocked |
Definition at line 107 of file transparency.h.
References _transparency_lock, and ToggleBit().
Referenced by TransparenciesWindow::OnClick().
|
extern |
What do we want to draw/do?
Definition at line 26 of file transparency_gui.cpp.
Referenced by CheckClickOnViewportSign(), DrawRoadBits(), SignList::FilterSignList(), LoadNewGRF(), MenuClickSettings(), SignList::OwnerVisibilityFilter(), SwitchNewGRFBlitter(), and ToolbarOptionsClick().
|
extern |
The bits that should be invisible.
Definition at line 25 of file transparency_gui.cpp.
Referenced by TransparenciesWindow::DrawWidget(), IsInvisibilitySet(), ToggleInvisibility(), and ToggleInvisibilityWithTransparency().
|
extern |
Prevent these bits from flipping with X.
Definition at line 24 of file transparency_gui.cpp.
Referenced by TransparenciesWindow::DrawWidget(), ResetRestoreAllTransparency(), and ToggleTransparencyLock().
|
extern |
The bits that should be transparent.
Definition at line 23 of file transparency_gui.cpp.
Referenced by NWidgetViewport::Draw(), IsInvisibilitySet(), IsTransparencySet(), ResetRestoreAllTransparency(), ToggleInvisibilityWithTransparency(), and ToggleTransparency().