summaryrefslogtreecommitdiff
path: root/src/gfx_layout.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2018-04-19 19:33:21 +0100
committerGitHub <noreply@github.com>2018-04-19 19:33:21 +0100
commit3b32075e8a3440c9bca8764289c0b1e3c2f4c28d (patch)
treecc5dde691f49ec264e0f932bb2ad56a689dc3c80 /src/gfx_layout.cpp
parentf4f9e18790b23862239164721dba831756ae24d7 (diff)
downloadopenttd-3b32075e8a3440c9bca8764289c0b1e3c2f4c28d.tar.xz
Add: {PUSH_COLOUR} and {POP_COLOUR} control codes to handle switching colours. (#6737)
This replaces the internal SCC_PREVIOUS_COLOUR swap.
Diffstat (limited to 'src/gfx_layout.cpp')
-rw-r--r--src/gfx_layout.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index de59fc5c8..3290aea65 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -594,8 +594,10 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str,
break;
} else if (c >= SCC_BLUE && c <= SCC_BLACK) {
state.SetColour((TextColour)(c - SCC_BLUE));
- } else if (c == SCC_PREVIOUS_COLOUR) { // Revert to the previous colour.
- state.SetPreviousColour();
+ } else if (c == SCC_PUSH_COLOUR) {
+ state.PushColour();
+ } else if (c == SCC_POP_COLOUR) {
+ state.PopColour();
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
} else {