mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-29 18:54:07 +00:00
successful win32 build, unran. untested. handing off to sperl
- hand wrote defines for a few standard math functions for non C99 compliant platforms - added #ifdefs to handle glew includes - put some preprocessor macros and includes to project file git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@467 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -15,6 +15,8 @@
|
||||
//
|
||||
|
||||
#include "MoodBar.hpp"
|
||||
#include "Common.hpp"
|
||||
|
||||
#include <cmath>
|
||||
extern "C" {
|
||||
#include <malloc.h>
|
||||
@ -272,8 +274,8 @@ void MoodBar::stretchNormalize (float * rgb)
|
||||
avgbb /= (float) tb;
|
||||
|
||||
// lost from here- what is theory behind this?
|
||||
mini = fmaxf (avg + (avgb - avg) * 2.f, avgbb);
|
||||
maxi = fminf (avg + (avgu - avg) * 2.f, avguu);
|
||||
mini = projectM_fmax (avg + (avgb - avg) * 2.f, avgbb);
|
||||
maxi = projectM_fmin (avg + (avgu - avg) * 2.f, avguu);
|
||||
delta = maxi - mini;
|
||||
|
||||
if (delta == 0.f)
|
||||
@ -282,7 +284,10 @@ void MoodBar::stretchNormalize (float * rgb)
|
||||
// Assign colos to normalized m_ringBufferue of last item in buffer
|
||||
// i = numvals-1;
|
||||
// m_ringBuffers[c].
|
||||
rgb[c] = finite (rgb[c]) ? fminf(1.f, fmaxf(0.f, (rgb[c] - mini) / delta))
|
||||
#ifdef LINUX
|
||||
rgb[c] = finite (rgb[c]) ? projectM_fmin(1.f, projectM_fmax(0.f, (rgb[c] - mini) / delta))
|
||||
: 0.f;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user