MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / FloatComponentToByte

Function FloatComponentToByte

TombEngine/Specific/RGBAColor8Byte.cpp:4–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "Specific/RGBAColor8Byte.h"
3
4static byte FloatComponentToByte(float value)
5{
6 // TODO: Look into what these actually do and test them to see if they are actually not undefined.
7 long byteValue = std::lroundf((value / 2.0f) * 255.0f);
8 return (byte)byteValue;
9}
10
11static float ByteComponentToFloat(byte b)
12{

Callers 1

RGBAColor8ByteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected