ref_soft: hide color loops to macro

This commit is contained in:
mittorn 2019-03-20 21:55:04 +07:00
parent f23ecc6895
commit 6784b9062e

View File

@ -87,17 +87,14 @@ void R_BuildScreenMap()
#endif #endif
} }
#define FOR_EACH_COLOR(x) for( r##x = 0; r##x < BIT(3); r##x++ ) for( g##x = 0; g##x < BIT(3); g##x++ ) for( b##x = 0; b##x < BIT(2); b##x++ )
void R_BuildBlendMaps() void R_BuildBlendMaps()
{ {
unsigned int r1, g1, b1; unsigned int r1, g1, b1;
unsigned int r2, g2, b2; unsigned int r2, g2, b2;
for( r1 = 0; r1 < BIT(3); r1++ ) FOR_EACH_COLOR(1)FOR_EACH_COLOR(2)
for( g1 = 0; g1 < BIT(3); g1++ )
for( b1 = 0; b1 < BIT(2); b1++ )
for( r2 = 0; r2 < BIT(3); r2++ )
for( g2 = 0; g2 < BIT(3); g2++ )
for( b2 = 0; b2 < BIT(2); b2++ )
{ {
unsigned int r, g, b; unsigned int r, g, b;
unsigned short index1 = r1 << (2 + 3) | g1 << 2 | b1; unsigned short index1 = r1 << (2 + 3) | g1 << 2 | b1;