diff options
author | Paul Gilbert | 2019-01-31 20:50:34 -0800 |
---|---|---|
committer | Paul Gilbert | 2019-01-31 21:54:34 -0800 |
commit | af2b1252d868ea07a45e5f567f8109c339cb63fe (patch) | |
tree | 0e6907671502e2097d4ed90333d0544a359db61e /engines/glk/glk_api.cpp | |
parent | 307dd44fba7efb763c611dc45af7535d2b20ca46 (diff) | |
download | scummvm-rg350-af2b1252d868ea07a45e5f567f8109c339cb63fe.tar.gz scummvm-rg350-af2b1252d868ea07a45e5f567f8109c339cb63fe.tar.bz2 scummvm-rg350-af2b1252d868ea07a45e5f567f8109c339cb63fe.zip |
GLK: Change use of RGB tuplets to uint
This has several advantages, such as simplifying copying and
comparing colors. It will also make it easier to specify
zcolor_Transparent as a color
Diffstat (limited to 'engines/glk/glk_api.cpp')
-rw-r--r-- | engines/glk/glk_api.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp index 329f4e9b08..21640afe62 100644 --- a/engines/glk/glk_api.cpp +++ b/engines/glk/glk_api.cpp @@ -465,15 +465,11 @@ void GlkAPI::glk_stylehint_set(uint wintype, uint style, uint hint, int val) { switch (hint) { case stylehint_TextColor: - styles[style].fg[0] = (val >> 16) & 0xff; - styles[style].fg[1] = (val >> 8) & 0xff; - styles[style].fg[2] = (val) & 0xff; + styles[style].fg = val; break; case stylehint_BackColor: - styles[style].bg[0] = (val >> 16) & 0xff; - styles[style].bg[1] = (val >> 8) & 0xff; - styles[style].bg[2] = (val) & 0xff; + styles[style].bg = val; break; case stylehint_ReverseColor: @@ -505,12 +501,12 @@ void GlkAPI::glk_stylehint_set(uint wintype, uint style, uint hint, int val) { } if (wintype == wintype_TextBuffer && style == style_Normal && hint == stylehint_BackColor) { - memcpy(g_conf->_windowColor, styles[style].bg, 3); + g_conf->_windowColor = styles[style].bg; } if (wintype == wintype_TextBuffer && style == style_Normal && hint == stylehint_TextColor) { - memcpy(g_conf->_propInfo._moreColor, styles[style].fg, 3); - memcpy(g_conf->_propInfo._caretColor, styles[style].fg, 3); + g_conf->_propInfo._moreColor = styles[style].fg; + g_conf->_propInfo._caretColor = styles[style].fg; } } @@ -539,15 +535,11 @@ void GlkAPI::glk_stylehint_clear(uint wintype, uint style, uint hint) { switch (hint) { case stylehint_TextColor: - styles[style].fg[0] = defaults[style].fg[0]; - styles[style].fg[1] = defaults[style].fg[1]; - styles[style].fg[2] = defaults[style].fg[2]; + styles[style].fg = defaults[style].fg; break; case stylehint_BackColor: - styles[style].bg[0] = defaults[style].bg[0]; - styles[style].bg[1] = defaults[style].bg[1]; - styles[style].bg[2] = defaults[style].bg[2]; + styles[style].bg = defaults[style].bg; break; case stylehint_ReverseColor: @@ -608,13 +600,11 @@ bool GlkAPI::glk_style_measure(winid_t win, uint style, uint hint, uint *result) break; case stylehint_TextColor: - *result = - (styles[style].fg[0] << 16) | (styles[style].fg[1] << 8) | (styles[style].fg[2]); + *result = styles[style].fg; break; case stylehint_BackColor: - *result = - (styles[style].bg[0] << 16) | (styles[style].bg[1] << 8) | (styles[style].bg[2]); + *result = styles[style].bg; break; case stylehint_ReverseColor: |