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/windows.h | |
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/windows.h')
-rw-r--r-- | engines/glk/windows.h | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/engines/glk/windows.h b/engines/glk/windows.h index c917d2f04b..acb727e39e 100644 --- a/engines/glk/windows.h +++ b/engines/glk/windows.h @@ -137,15 +137,15 @@ public: static bool _forceRedraw; static bool _claimSelect; static bool _moreFocus; - static int _overrideFgVal; - static int _overrideBgVal; - static int _zcolor_fg, _zcolor_bg; - static byte _zcolor_LightGrey[3]; - static byte _zcolor_Foreground[3]; - static byte _zcolor_Background[3]; - static byte _zcolor_Bright[3]; - - static byte *rgbShift(byte *rgb); + static uint _overrideFgVal; + static uint _overrideBgVal; + static uint _zcolor_fg, _zcolor_bg; + static uint _zcolor_LightGrey; + static uint _zcolor_Foreground; + static uint _zcolor_Background; + static uint _zcolor_Bright; + + static uint rgbShift(uint color); public: /** * Constructor @@ -240,13 +240,33 @@ public: }; /** - * Window styles + * Used for the static definition of default styles */ -struct WindowStyle { +struct WindowStyleStatic { FACES font; byte bg[3]; byte fg[3]; bool reverse; +}; + +/** + * Window styles + */ +struct WindowStyle { + FACES font; + uint bg; + uint fg; + bool reverse; + + /** + * Constructor + */ + WindowStyle() : font(MONOR), fg(0), bg(0), reverse(false) {} + + /** + * Constructor + */ + WindowStyle(const WindowStyleStatic &src); /** * Equality comparison @@ -345,12 +365,12 @@ struct Attributes { /** * Return the background color for the current font style */ - const byte *attrBg(const WindowStyle *styles); + uint attrBg(const WindowStyle *styles); /** * Return the foreground color for the current font style */ - const byte *attrFg(const WindowStyle *styles); + uint attrFg(const WindowStyle *styles); /** * Get the font for the current font style @@ -392,8 +412,7 @@ public: uint _termCt; Attributes _attr; - byte _bgColor[3]; - byte _fgColor[3]; + uint _bgColor, _fgColor; gidispatch_rock_t _dispRock; public: |