aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/screen.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-01-31 20:50:34 -0800
committerPaul Gilbert2019-01-31 21:54:34 -0800
commitaf2b1252d868ea07a45e5f567f8109c339cb63fe (patch)
tree0e6907671502e2097d4ed90333d0544a359db61e /engines/glk/screen.cpp
parent307dd44fba7efb763c611dc45af7535d2b20ca46 (diff)
downloadscummvm-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/screen.cpp')
-rw-r--r--engines/glk/screen.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/engines/glk/screen.cpp b/engines/glk/screen.cpp
index 465adab082..c460a216f1 100644
--- a/engines/glk/screen.cpp
+++ b/engines/glk/screen.cpp
@@ -59,16 +59,13 @@ void Screen::initialize() {
}
}
-void Screen::fill(const byte *rgb) {
- uint color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
+void Screen::fill(uint color) {
clear(color);
}
-void Screen::fillRect(const Rect &box, const byte *rgb) {
- if (rgb[0] != TRANSPARENT_RGB || rgb[1] != TRANSPARENT_RGB || rgb[2] != TRANSPARENT_RGB) {
- uint color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
+void Screen::fillRect(const Rect &box, uint color) {
+ if (color != zcolor_Transparent)
Graphics::Screen::fillRect(box, color);
- }
}
bool Screen::loadFonts() {
@@ -145,22 +142,20 @@ FACES Screen::getFontId(const Common::String &name) {
return MONOR;
}
-int Screen::drawString(const Point &pos, int fontIdx, const byte *rgb, const Common::String &text, int spw) {
+int Screen::drawString(const Point &pos, int fontIdx, uint color, const Common::String &text, int spw) {
int baseLine = (fontIdx >= PROPR) ? g_conf->_propInfo._baseLine : g_conf->_monoInfo._baseLine;
Point pt(pos.x / GLI_SUBPIX, pos.y - baseLine);
const Graphics::Font *font = _fonts[fontIdx];
- const uint32 color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
font->drawString(this, text, pt.x, pt.y, w - pt.x, color);
pt.x += font->getStringWidth(text);
return MIN((int)pt.x, (int)w) * GLI_SUBPIX;
}
-int Screen::drawStringUni(const Point &pos, int fontIdx, const byte *rgb, const Common::U32String &text, int spw) {
+int Screen::drawStringUni(const Point &pos, int fontIdx, uint color, const Common::U32String &text, int spw) {
int baseLine = (fontIdx >= PROPR) ? g_conf->_propInfo._baseLine : g_conf->_monoInfo._baseLine;
Point pt(pos.x / GLI_SUBPIX, pos.y - baseLine);
const Graphics::Font *font = _fonts[fontIdx];
- const uint32 color = format.RGBToColor(rgb[0], rgb[1], rgb[2]);
font->drawString(this, text, pt.x, pt.y, w - pt.x, color);
pt.x += font->getStringWidth(text);