Bugfix + linux support

This commit is contained in:
Ryzerth
2020-07-20 13:36:16 +02:00
parent 43f6802199
commit 379d6f8101
3 changed files with 18 additions and 14 deletions

View File

@ -2,6 +2,7 @@
#include <condition_variable>
#include <algorithm>
#include <math.h>
#include <string.h>
#define STREAM_BUF_SZ 1000000

View File

@ -388,6 +388,8 @@ namespace ImGui {
for (int i = 0; i < WATERFALL_RESOLUTION; i++) {
int lowerId = floorf(((float)i / (float)WATERFALL_RESOLUTION) * colorCount);
int upperId = ceilf(((float)i / (float)WATERFALL_RESOLUTION) * colorCount);
lowerId = std::clamp<int>(lowerId, 0, colorCount - 1);
upperId = std::clamp<int>(upperId, 0, colorCount - 1);
float ratio = (((float)i / (float)WATERFALL_RESOLUTION) * colorCount) - lowerId;
float r = (colors[lowerId][0] * (1.0f - ratio)) + (colors[upperId][0] * (ratio));
float g = (colors[lowerId][1] * (1.0f - ratio)) + (colors[upperId][1] * (ratio));