MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawTextEffects

Function DrawTextEffects

src/texteff.cpp:117–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void DrawTextEffects(DrawPixelInfo *dpi)
118{
119 /* Don't draw the text effects when zoomed out a lot */
120 if (dpi->zoom > ZoomLevel::TextEffect) return;
121 if (IsTransparencySet(TO_TEXT)) return;
122
123 ViewportStringFlags flags{};
124 if (dpi->zoom >= ZoomLevel::TextEffect) flags.Set(ViewportStringFlag::Small);
125
126 for (const TextEffect &te : _text_effects) {
127 if (!te.IsValid()) continue;
128
129 if (te.mode == TE_RISING || _settings_client.gui.loading_indicators) {
130 std::string *str = ViewportAddString(dpi, &te, flags, INVALID_COLOUR);
131 if (str == nullptr) continue;
132
133 *str = te.msg.GetDecodedString();
134 }
135 }
136}

Callers 1

ViewportDoDrawFunction · 0.85

Calls 5

IsTransparencySetFunction · 0.85
ViewportAddStringFunction · 0.85
GetDecodedStringMethod · 0.80
SetMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected