mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
pstatserver: Fix compilation error with STDFLOAT_DOUBLE=1
Regression in 7da70cf9399e2703ac9cacbb6977edeb173de159 Fixes #1259
This commit is contained in:
parent
2a904f3985
commit
5bb616dca7
@ -274,13 +274,13 @@ get_collector_pattern(int collector_index, bool highlight) {
|
|||||||
// Ask the monitor what color this guy should be.
|
// Ask the monitor what color this guy should be.
|
||||||
LRGBColor rgb = _monitor->get_collector_color(collector_index);
|
LRGBColor rgb = _monitor->get_collector_color(collector_index);
|
||||||
cairo_pattern_t *pattern = cairo_pattern_create_rgb(
|
cairo_pattern_t *pattern = cairo_pattern_create_rgb(
|
||||||
encode_sRGB_float(rgb[0]),
|
encode_sRGB_float((float)rgb[0]),
|
||||||
encode_sRGB_float(rgb[1]),
|
encode_sRGB_float((float)rgb[1]),
|
||||||
encode_sRGB_float(rgb[2]));
|
encode_sRGB_float((float)rgb[2]));
|
||||||
cairo_pattern_t *hpattern = cairo_pattern_create_rgb(
|
cairo_pattern_t *hpattern = cairo_pattern_create_rgb(
|
||||||
encode_sRGB_float(rgb[0] * 0.75f),
|
encode_sRGB_float((float)rgb[0] * 0.75f),
|
||||||
encode_sRGB_float(rgb[1] * 0.75f),
|
encode_sRGB_float((float)rgb[1] * 0.75f),
|
||||||
encode_sRGB_float(rgb[2] * 0.75f));
|
encode_sRGB_float((float)rgb[2] * 0.75f));
|
||||||
|
|
||||||
_brushes[collector_index] = std::make_pair(pattern, hpattern);
|
_brushes[collector_index] = std::make_pair(pattern, hpattern);
|
||||||
return highlight ? hpattern : pattern;
|
return highlight ? hpattern : pattern;
|
||||||
|
@ -55,14 +55,14 @@ GtkStatsLabel(GtkStatsMonitor *monitor, GtkStatsGraph *graph,
|
|||||||
// Set the fg and bg colors on the label.
|
// Set the fg and bg colors on the label.
|
||||||
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
|
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
|
||||||
_bg_color = LRGBColor(
|
_bg_color = LRGBColor(
|
||||||
encode_sRGB_float(rgb[0]),
|
encode_sRGB_float((float)rgb[0]),
|
||||||
encode_sRGB_float(rgb[1]),
|
encode_sRGB_float((float)rgb[1]),
|
||||||
encode_sRGB_float(rgb[2]));
|
encode_sRGB_float((float)rgb[2]));
|
||||||
|
|
||||||
_highlight_bg_color = LRGBColor(
|
_highlight_bg_color = LRGBColor(
|
||||||
encode_sRGB_float(rgb[0] * 0.75f),
|
encode_sRGB_float((float)rgb[0] * 0.75f),
|
||||||
encode_sRGB_float(rgb[1] * 0.75f),
|
encode_sRGB_float((float)rgb[1] * 0.75f),
|
||||||
encode_sRGB_float(rgb[2] * 0.75f));
|
encode_sRGB_float((float)rgb[2] * 0.75f));
|
||||||
|
|
||||||
// Should our foreground be black or white?
|
// Should our foreground be black or white?
|
||||||
PN_stdfloat bright = _bg_color.dot(LRGBColor(0.2126, 0.7152, 0.0722));
|
PN_stdfloat bright = _bg_color.dot(LRGBColor(0.2126, 0.7152, 0.0722));
|
||||||
|
@ -242,14 +242,14 @@ get_collector_brush(int collector_index, bool highlight) {
|
|||||||
|
|
||||||
// Ask the monitor what color this guy should be.
|
// Ask the monitor what color this guy should be.
|
||||||
LRGBColor rgb = _monitor->get_collector_color(collector_index);
|
LRGBColor rgb = _monitor->get_collector_color(collector_index);
|
||||||
int r = (int)encode_sRGB_uchar(rgb[0]);
|
int r = (int)encode_sRGB_uchar((float)rgb[0]);
|
||||||
int g = (int)encode_sRGB_uchar(rgb[1]);
|
int g = (int)encode_sRGB_uchar((float)rgb[1]);
|
||||||
int b = (int)encode_sRGB_uchar(rgb[2]);
|
int b = (int)encode_sRGB_uchar((float)rgb[2]);
|
||||||
HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
|
HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
|
||||||
|
|
||||||
int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f);
|
int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f);
|
||||||
int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f);
|
int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f);
|
||||||
int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f);
|
int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f);
|
||||||
HBRUSH hbrush = CreateSolidBrush(RGB(hr, hg, hb));
|
HBRUSH hbrush = CreateSolidBrush(RGB(hr, hg, hb));
|
||||||
|
|
||||||
_brushes[collector_index] = std::make_pair(brush, hbrush);
|
_brushes[collector_index] = std::make_pair(brush, hbrush);
|
||||||
|
@ -44,15 +44,15 @@ WinStatsLabel(WinStatsMonitor *monitor, WinStatsGraph *graph,
|
|||||||
update_text(use_fullname);
|
update_text(use_fullname);
|
||||||
|
|
||||||
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
|
LRGBColor rgb = _monitor->get_collector_color(_collector_index);
|
||||||
int r = (int)encode_sRGB_uchar(rgb[0]);
|
int r = (int)encode_sRGB_uchar((float)rgb[0]);
|
||||||
int g = (int)encode_sRGB_uchar(rgb[1]);
|
int g = (int)encode_sRGB_uchar((float)rgb[1]);
|
||||||
int b = (int)encode_sRGB_uchar(rgb[2]);
|
int b = (int)encode_sRGB_uchar((float)rgb[2]);
|
||||||
_bg_brush = CreateSolidBrush(RGB(r, g, b));
|
_bg_brush = CreateSolidBrush(RGB(r, g, b));
|
||||||
|
|
||||||
// Calculate the color when it is highlighted.
|
// Calculate the color when it is highlighted.
|
||||||
int hr = (int)encode_sRGB_uchar(rgb[0] * 0.75f);
|
int hr = (int)encode_sRGB_uchar((float)rgb[0] * 0.75f);
|
||||||
int hg = (int)encode_sRGB_uchar(rgb[1] * 0.75f);
|
int hg = (int)encode_sRGB_uchar((float)rgb[1] * 0.75f);
|
||||||
int hb = (int)encode_sRGB_uchar(rgb[2] * 0.75f);
|
int hb = (int)encode_sRGB_uchar((float)rgb[2] * 0.75f);
|
||||||
_highlight_bg_brush = CreateSolidBrush(RGB(hr, hg, hb));
|
_highlight_bg_brush = CreateSolidBrush(RGB(hr, hg, hb));
|
||||||
|
|
||||||
// Should our foreground be black or white?
|
// Should our foreground be black or white?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user