10 #ifndef TRANSPARENCY_H
11 #define TRANSPARENCY_H
Functions related to bit mathematics.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
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.
constexpr T ToggleBit(T &x, const uint8_t y)
Toggles a bit in a variable.
constexpr T ClrBit(T &x, const uint8_t y)
Clears a bit in a variable.
Functions related to the gfx engine.
void MarkWholeScreenDirty()
This function mark the whole screen as dirty.
void ResetRestoreAllTransparency()
Set or clear all non-locked transparency options.
TransparencyOptionBits _transparency_opt
The bits that should be transparent.
void ToggleTransparency(TransparencyOption to)
Toggle the transparency option bit.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
@ TO_INVALID
Invalid transparency option.
@ TO_BUILDINGS
company buildings - depots, stations, HQ, ...
@ TO_TEXT
loading and cost/income text
@ TO_HOUSES
town buildings
@ TO_STRUCTURES
other objects such as transmitters and lighthouses
@ TO_INDUSTRIES
industries
bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
void ToggleInvisibility(TransparencyOption to)
Toggle the invisibility option bit.
TransparencyOptionBits _transparency_lock
Prevent these bits from flipping with X.
void ToggleInvisibilityWithTransparency(TransparencyOption to)
Toggles between invisible and solid state.
TransparencyOptionBits _invisibility_opt
The bits that should be invisible.
uint8_t _display_opt
What do we want to draw/do?
uint TransparencyOptionBits
transparency option bits
bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
void ToggleTransparencyLock(TransparencyOption to)
Toggle the transparency lock bit.