Browse Source

Remove some type conversion warnings.

vrld 13 years ago
parent
commit
cde8b92113

+ 5 - 2
src/modules/graphics/opengl/Graphics.cpp

@@ -841,8 +841,11 @@ namespace opengl
 			Color *colors = new Color[count];
 			Color *colors = new Color[count];
 			for (size_t i = 0; i < count; ++i)
 			for (size_t i = 0; i < count; ++i)
 			{
 			{
-				colors[i] = Color(c[0] * 255.f, c[1] * 255.f, c[2] * 255.f,
-						c[3] * 255.f * int(i%2 == 0));// avoids branching. equiv to colors[i].a *= (i%2==0) ? 1 : 0;
+				colors[i] = Color(GLubyte(c[0] * 255.f),
+						GLubyte(c[1] * 255.f),
+						GLubyte(c[2] * 255.f),
+						// avoids branching. equiv to if (i%2 == 1) colors[i].a = 0;
+						GLubyte(c[3] * 255.f) * GLubyte(i%2 == 0));
 			}
 			}
 
 
 			// TODO: overdraw at line start and end
 			// TODO: overdraw at line start and end

+ 1 - 1
src/modules/graphics/opengl/wrap_PixelEffect.cpp

@@ -93,7 +93,7 @@ namespace opengl
 				lua_rawgeti(L, 3 + i, k);
 				lua_rawgeti(L, 3 + i, k);
 				values[i * dimension + k - 1] = (float)lua_tonumber(L, -1);
 				values[i * dimension + k - 1] = (float)lua_tonumber(L, -1);
 			}
 			}
-			lua_pop(L, dimension);
+			lua_pop(L, int(dimension));
 		}
 		}
 
 
 		try
 		try