Decouple <cstdint>

This commit is contained in:
Martin Natano
2023-04-20 12:34:12 +02:00
parent bcea05dd67
commit aa87f85eef
167 changed files with 1533 additions and 1307 deletions
+5 -4
View File
@@ -14,6 +14,7 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <numeric>
const float min_state_delay= 0.0001f;
@@ -237,16 +238,16 @@ void ActorMultiVertex::DrawPrimitives()
for( std::size_t i=0; i < TS.vertices.size(); i++ )
{
// RageVColor uses a uint8_t for each channel. 0-255.
// RageVColor uses a std::uint8_t for each channel. 0-255.
// RageColor uses a float. 0-1.
// So each channel of the RageVColor needs to be converted to a float,
// multiplied by the channel from the RageColor, then the result
// converted to uint8_t. If implicit conversion is allowed to happen,
// sometimes the compiler decides to turn the RageColor into a uint8_t,
// converted to std::uint8_t. If implicit conversion is allowed to happen,
// sometimes the compiler decides to turn the RageColor into a std::uint8_t,
// which makes any value other than 1 into 0. Thus, the explicit
// conversions. -Kyz
#define MULT_COLOR_ELEMENTS(color_a, color_b) \
color_a= static_cast<uint8_t>(static_cast<float>(color_a) * color_b);
color_a= static_cast<std::uint8_t>(static_cast<float>(color_a) * color_b);
// RageVColor * RageColor
MULT_COLOR_ELEMENTS(TS.vertices[i].c.b, m_pTempState->diffuse[0].b);
MULT_COLOR_ELEMENTS(TS.vertices[i].c.r, m_pTempState->diffuse[0].r);