Avoid some VC++ compiler warnings

This commit is contained in:
Alex Szpakowski
2015-04-02 00:28:09 -03:00
parent 2a6bffaa5a
commit cf0968fc6d
13 changed files with 25 additions and 26 deletions
+1 -1
View File
@@ -396,7 +396,7 @@ void Canvas::setupGrab()
gl.setViewport({0, 0, width, height});
// Set up the projection matrix
gl.matrices.projection.push_back(Matrix::ortho(0.0, width, 0.0, height));
gl.matrices.projection.push_back(Matrix::ortho(0.0, (float) width, 0.0, (float) height));
// Make sure the correct sRGB setting is used when drawing to the canvas.
if (GLAD_VERSION_1_0 || GLAD_EXT_sRGB_write_control)
+1 -1
View File
@@ -226,7 +226,7 @@ void Graphics::setViewportSize(int width, int height)
Canvas::systemViewport = gl.getViewport();
// Set up the projection matrix
gl.matrices.projection.back() = Matrix::ortho(0.0, width, height, 0.0);
gl.matrices.projection.back() = Matrix::ortho(0.0, (float) width, (float) height, 0.0);
// Restore the previously active Canvas.
setCanvas(canvases);
+1 -1
View File
@@ -586,7 +586,7 @@ GLenum Image::getCompressedFormat(image::CompressedImageData::Format cformat) co
bool Image::hasAnisotropicFilteringSupport()
{
return GLAD_EXT_texture_filter_anisotropic;
return GLAD_EXT_texture_filter_anisotropic != GL_FALSE;
}
bool Image::hasCompressedTextureSupport(image::CompressedImageData::Format format, bool sRGB)
+1 -1
View File
@@ -49,7 +49,7 @@ void Polyline::render(const float *coords, size_t count, size_t size_hint, float
// prepare vertex arrays
if (draw_overdraw)
halfwidth -= pixel_size * .3;
halfwidth -= pixel_size * 0.3f;
// compute sleeve
bool is_looping = (coords[0] == coords[count - 2]) && (coords[1] == coords[count - 1]);
@@ -494,8 +494,8 @@ int w_newShader(lua_State *L)
}
}
bool has_arg1 = lua_isstring(L, 1);
bool has_arg2 = lua_isstring(L, 2);
bool has_arg1 = lua_isstring(L, 1) != 0;
bool has_arg2 = lua_isstring(L, 2) != 0;
// require at least one string argument
if (!(has_arg1 || has_arg2))