@@ -89,10 +89,10 @@ vec4 ColorModulateToColor( const in int colorMod ) {
89
89
int rgbIndex = colorMod & 3 ;
90
90
int alphaIndex = ( colorMod & 24 ) >> 3 ;
91
91
#else
92
- int rgbBit0 = colorMod % 2 ;
93
- int rgbBit1 = ( colorMod / 2 ) % 2 ;
94
- int alphaBit0 = ( colorMod / 8 ) % 2 ;
95
- int alphaBit1 = ( colorMod / 16 ) % 2 ;
92
+ int rgbBit0 = int ( mod ( colorMod , 2 ) ) ;
93
+ int rgbBit1 = int ( mod ( int ( colorMod / 2 ), 2 ) ) ;
94
+ int alphaBit0 = int ( mod ( int ( colorMod / 8 ), 2 ) ) ;
95
+ int alphaBit1 = int ( mod ( int ( colorMod / 16 ), 2 ) ) ;
96
96
int rgbIndex = rgbBit0 + ( rgbBit1 * 2 );
97
97
int alphaIndex = alphaBit0 + ( alphaBit1 * 2 );
98
98
#endif
@@ -108,11 +108,11 @@ vec4 ColorModulateToColor( const in int colorMod, const in float lightFactor ) {
108
108
int alphaIndex = ( colorMod & 24 ) >> 3 ;
109
109
int hasLight = ( colorMod & 4 ) >> 2 ;
110
110
#else
111
- int rgbBit0 = colorMod % 2 ;
112
- int rgbBit1 = ( colorMod / 2 ) % 2 ;
113
- int hasLight = ( colorMod / 4 ) % 2 ;
114
- int alphaBit0 = ( colorMod / 8 ) % 2 ;
115
- int alphaBit1 = ( colorMod / 16 ) % 2 ;
111
+ int rgbBit0 = int ( mod ( colorMod, 2 ) ) ;
112
+ int rgbBit1 = int ( mod ( int ( colorMod / 2 ), 2 ) ) ;
113
+ int hasLight = int ( mod ( int ( colorMod / 4 ), 2 ) ) ;
114
+ int alphaBit0 = int ( mod ( int ( colorMod / 8 ), 2 ) ) ;
115
+ int alphaBit1 = int ( mod ( int ( colorMod / 16 ), 2 ) ) ;
116
116
int rgbIndex = rgbBit0 + ( rgbBit1 * 2 );
117
117
int alphaIndex = alphaBit0 + ( alphaBit1 * 2 );
118
118
#endif
@@ -142,6 +142,6 @@ bool ColorModulateToVertexColor( const in int colorMod ) {
142
142
#if defined(HAVE_EXT_gpu_shader4)
143
143
return ( colorMod & 32 ) == 32 ;
144
144
#else
145
- return ( colorMod / 32 ) % 2 == 1 ;
145
+ return int ( mod ( int ( colorMod / 32 ), 2 ) ) == 1 ;
146
146
#endif
147
147
}
0 commit comments