summaryrefslogtreecommitdiffstats
path: root/src/waveform/renderers/glwaveformrenderersimplesignal.cpp
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 13:09:01 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-25 14:14:34 +0200
commita62d2e55a5975148f4ad7896676083a651547cda (patch)
tree634ac7362aaa42d0ad67c33a90a49498d49d0f16 /src/waveform/renderers/glwaveformrenderersimplesignal.cpp
parent9373854a13e6febc442137b1722220d943646c15 (diff)
waveform/renderers/glwaveformrenderersimplesignal: Use GLfloat
Diffstat (limited to 'src/waveform/renderers/glwaveformrenderersimplesignal.cpp')
-rw-r--r--src/waveform/renderers/glwaveformrenderersimplesignal.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp
index 3a161f74f9..c434b19a2b 100644
--- a/src/waveform/renderers/glwaveformrenderersimplesignal.cpp
+++ b/src/waveform/renderers/glwaveformrenderersimplesignal.cpp
@@ -45,14 +45,18 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even
return;
}
- double firstVisualIndex = m_waveformRenderer->getFirstDisplayedPosition() * dataSize;
- double lastVisualIndex = m_waveformRenderer->getLastDisplayedPosition() * dataSize;
- double lineWidth = (1.0 / m_waveformRenderer->getVisualSamplePerPixel()) + 1.0;
-
- const int firstIndex = int(firstVisualIndex+0.5);
+ GLfloat firstVisualIndex = static_cast<GLfloat>(
+ m_waveformRenderer->getFirstDisplayedPosition() * dataSize);
+ GLfloat lastVisualIndex = static_cast<GLfloat>(
+ m_waveformRenderer->getLastDisplayedPosition() * dataSize);
+ GLfloat lineWidth = static_cast<GLfloat>(1.0 /
+ m_waveformRenderer->getVisualSamplePerPixel()) +
+ 1;
+
+ const int firstIndex = static_cast<int>(firstVisualIndex + 0.5);
firstVisualIndex = firstIndex - firstIndex%2;
- const int lastIndex = int(lastVisualIndex+0.5);
+ const int lastIndex = static_cast<int>(lastVisualIndex + 0.5);
lastVisualIndex = lastIndex + lastIndex%2;
// Reset device for native painting
@@ -85,8 +89,10 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even
//draw reference line
glBegin(GL_LINES); {
- glColor4f(m_axesColor_r, m_axesColor_g,
- m_axesColor_b, m_axesColor_a);
+ glColor4f(static_cast<GLfloat>(m_axesColor_r),
+ static_cast<GLfloat>(m_axesColor_g),
+ static_cast<GLfloat>(m_axesColor_b),
+ static_cast<GLfloat>(m_axesColor_a));
glVertex2f(firstVisualIndex,0);
glVertex2f(lastVisualIndex,0);
}
@@ -99,7 +105,10 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even
int firstIndex = math_max(static_cast<int>(firstVisualIndex), 0);
int lastIndex = math_min(static_cast<int>(lastVisualIndex), dataSize);
- glColor4f(m_signalColor_r, m_signalColor_g, m_signalColor_b, 0.9);
+ glColor4f(static_cast<GLfloat>(m_signalColor_r),
+ static_cast<GLfloat>(m_signalColor_g),
+ static_cast<GLfloat>(m_signalColor_b),
+ 0.9f);
for (int visualIndex = firstIndex;
visualIndex < lastIndex;
visualIndex += 2) {
@@ -137,7 +146,10 @@ void GLWaveformRendererSimpleSignal::draw(QPainter* painter, QPaintEvent* /*even
int firstIndex = math_max(static_cast<int>(firstVisualIndex), 0);
int lastIndex = math_min(static_cast<int>(lastVisualIndex), dataSize);
- glColor4f(m_signalColor_r, m_signalColor_g, m_signalColor_b, 0.8);
+ glColor4f(static_cast<GLfloat>(m_signalColor_r),
+ static_cast<GLfloat>(m_signalColor_g),
+ static_cast<GLfloat>(m_signalColor_b),
+ 0.8f);
for (int visualIndex = firstIndex;
visualIndex < lastIndex;
visualIndex += 2) {