diff --git a/pandatool/src/gtk-stats/gtkStatsGraph.cxx b/pandatool/src/gtk-stats/gtkStatsGraph.cxx index 4a34ca75fe..2734498b12 100644 --- a/pandatool/src/gtk-stats/gtkStatsGraph.cxx +++ b/pandatool/src/gtk-stats/gtkStatsGraph.cxx @@ -274,13 +274,13 @@ get_collector_pattern(int collector_index, bool highlight) { // Ask the monitor what color this guy should be. LRGBColor rgb = _monitor->get_collector_color(collector_index); cairo_pattern_t *pattern = cairo_pattern_create_rgb( - encode_sRGB_float(rgb[0]), - encode_sRGB_float(rgb[1]), - encode_sRGB_float(rgb[2])); + encode_sRGB_float((float)rgb[0]), + encode_sRGB_float((float)rgb[1]), + encode_sRGB_float((float)rgb[2])); cairo_pattern_t *hpattern = cairo_pattern_create_rgb( - encode_sRGB_float(rgb[0] * 0.75f), - encode_sRGB_float(rgb[1] * 0.75f), - encode_sRGB_float(rgb[2] * 0.75f)); + encode_sRGB_float((float)rgb[0] * 0.75f), + encode_sRGB_float((float)rgb[1] * 0.75f), + encode_sRGB_float((float)rgb[2] * 0.75f)); _brushes[collector_index] = std::make_pair(pattern, hpattern); return highlight ? hpattern : pattern; diff --git a/pandatool/src/gtk-stats/gtkStatsLabel.cxx b/pandatool/src/gtk-stats/gtkStatsLabel.cxx index 4eb766246e..9db4c8cd9c 100644 --- a/pandatool/src/gtk-stats/gtkStatsLabel.cxx +++ b/pandatool/src/gtk-stats/gtkStatsLabel.cxx @@ -55,14 +55,14 @@ GtkStatsLabel(GtkStatsMonitor *monitor, GtkStatsGraph *graph, // Set the fg and bg colors on the label. LRGBColor rgb = _monitor->get_collector_color(_collector_index); _bg_color = LRGBColor( - encode_sRGB_float(rgb[0]), - encode_sRGB_float(rgb[1]), - encode_sRGB_float(rgb[2])); + encode_sRGB_float((float)rgb[0]), + encode_sRGB_float((float)rgb[1]), + encode_sRGB_float((float)rgb[2])); _highlight_bg_color = LRGBColor( - encode_sRGB_float(rgb[0] * 0.75f), - encode_sRGB_float(rgb[1] * 0.75f), - encode_sRGB_float(rgb[2] * 0.75f)); + encode_sRGB_float((float)rgb[0] * 0.75f), + encode_sRGB_float((float)rgb[1] * 0.75f), + encode_sRGB_float((float)rgb[2] * 0.75f)); // Should our foreground be black or white? PN_stdfloat bright = _bg_color.dot(LRGBColor(0.2126, 0.7152, 0.0722)); diff --git a/pandatool/src/win-stats/winStatsGraph.cxx b/pandatool/src/win-stats/winStatsGraph.cxx index 7fd3b251fa..a95c95f46d 100644 --- a/pandatool/src/win-stats/winStatsGraph.cxx +++ b/pandatool/src/win-stats/winStatsGraph.cxx @@ -242,14 +242,14 @@ get_collector_brush(int collector_index, bool highlight) { // Ask the monitor what color this guy should be. LRGBColor rgb = _monitor->get_collector_color(collector_index); - int r = (int)encode_sRGB_uchar(rgb[0]); - int g = (int)encode_sRGB_uchar(rgb[1]); - int b = (int)encode_sRGB_uchar(rgb[2]); + int r = (int)encode_sRGB_uchar((float)rgb[0]); + int g = (int)encode_sRGB_uchar((float)rgb[1]); + int b = (int)encode_sRGB_uchar((float)rgb[2]); HBRUSH brush = CreateSolidBrush(RGB(r, g, b)); - int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f); - int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f); - int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f); + int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f); + int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f); + int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f); HBRUSH hbrush = CreateSolidBrush(RGB(hr, hg, hb)); _brushes[collector_index] = std::make_pair(brush, hbrush); diff --git a/pandatool/src/win-stats/winStatsLabel.cxx b/pandatool/src/win-stats/winStatsLabel.cxx index 00021e7376..51b9cb9208 100644 --- a/pandatool/src/win-stats/winStatsLabel.cxx +++ b/pandatool/src/win-stats/winStatsLabel.cxx @@ -44,15 +44,15 @@ WinStatsLabel(WinStatsMonitor *monitor, WinStatsGraph *graph, update_text(use_fullname); LRGBColor rgb = _monitor->get_collector_color(_collector_index); - int r = (int)encode_sRGB_uchar(rgb[0]); - int g = (int)encode_sRGB_uchar(rgb[1]); - int b = (int)encode_sRGB_uchar(rgb[2]); + int r = (int)encode_sRGB_uchar((float)rgb[0]); + int g = (int)encode_sRGB_uchar((float)rgb[1]); + int b = (int)encode_sRGB_uchar((float)rgb[2]); _bg_brush = CreateSolidBrush(RGB(r, g, b)); // Calculate the color when it is highlighted. - int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f); - int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f); - int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f); + int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f); + int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f); + int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f); _highlight_bg_brush = CreateSolidBrush(RGB(hr, hg, hb)); // Should our foreground be black or white?