3 /** @file overlay.h Functions related to overlays. */
10 #include "core/bitmath_func.hpp"
14 * Transparency option bits: which position in _transparency_opt stands for which transparency.
15 * If you change the order, change the order of the ShowTransparencyToolbar() stuff in transparency_gui.cpp too.
16 * If you add or remove an option don't forget to change the transparency 'hot keys' in main_gui.cpp.
19 OO_COVERAGES
= 0, ///< coverage
23 typedef uint OverlayOptionBits
; ///< overlay option bits
24 extern OverlayOptionBits _overlay_opt
;
25 extern OverlayOptionBits _overlay_lock
;
28 * Check if the overlay option bit is set
29 * and if we aren't in the game menu (there's no overlay)
31 * @param to the structure which overlay option is ask for
33 static inline bool IsOverlaySet(OverlayOption to
)
35 return (HasBit(_overlay_opt
, to
) && _game_mode
!= GM_MENU
);
39 * Toggle the overlay option bit
41 * @param to the overlay option to be toggled
43 static inline void ToggleOverlay(OverlayOption to
)
45 ToggleBit(_overlay_opt
, to
);
49 * Toggle the overlay lock bit
51 * @param to the overlay option to be locked or unlocked
53 static inline void ToggleOverlayLock(OverlayOption to
)
55 ToggleBit(_overlay_lock
, to
);
58 /** Set or clear all non-locked overlay options */
59 static inline void ResetRestoreAllOverlays()
61 /* if none of the non-locked options are set */
62 if ((_overlay_opt
& ~_overlay_lock
) == 0) {
63 /* set all non-locked options */
64 _overlay_opt
|= GB(~_overlay_lock
, 0, OO_END
);
66 /* clear all non-locked options */
67 _overlay_opt
&= _overlay_lock
;
70 MarkWholeScreenDirty();
73 #endif /* OVERLAY_H */