2020-06-13 10:56:20 +02:00
|
|
|
//
|
|
|
|
// Created by versustune on 08.06.20.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Utils.h"
|
|
|
|
#include "Core/Config.h"
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
int VeNo::Utils::nextPowerOfTwo (float value)
|
|
|
|
{
|
2020-06-13 10:56:20 +02:00
|
|
|
unsigned int v = value;
|
|
|
|
v--;
|
|
|
|
v |= v >> 1;
|
|
|
|
v |= v >> 2;
|
|
|
|
v |= v >> 4;
|
|
|
|
v |= v >> 8;
|
|
|
|
v |= v >> 16;
|
|
|
|
v++;
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
2020-06-13 16:52:16 +02:00
|
|
|
float VeNo::Utils::setFontSize (float size, Graphics& g)
|
|
|
|
{
|
|
|
|
double scale = Config::getInstance ()->getScale ();
|
2020-06-13 10:56:20 +02:00
|
|
|
float s = size * scale;
|
2020-06-13 16:52:16 +02:00
|
|
|
g.setFont (s);
|
2020-06-13 10:56:20 +02:00
|
|
|
return s;
|
|
|
|
}
|