(Windows) Fixed a few MSVC compiler warnings.

This commit is contained in:
Leon Styhre 2022-02-11 23:45:25 +01:00
parent a42d63e567
commit 35970dd95d
3 changed files with 8 additions and 8 deletions

View file

@ -459,9 +459,9 @@ void Window::render()
#if (CLOCK_BACKGROUND_CREATION) #if (CLOCK_BACKGROUND_CREATION)
const auto backgroundStartTime = std::chrono::system_clock::now(); const auto backgroundStartTime = std::chrono::system_clock::now();
#endif #endif
unsigned char* processedTexture = unsigned char* processedTexture {
new unsigned char[Renderer::getScreenWidth() * Renderer::getScreenHeight() * new unsigned char[static_cast<size_t>(Renderer::getScreenWidth()) *
4.0f]; static_cast<size_t>(Renderer::getScreenHeight()) * 4]};
// De-focus the background using multiple passes of gaussian blur, with the number // De-focus the background using multiple passes of gaussian blur, with the number
// of iterations relative to the screen resolution. // of iterations relative to the screen resolution.

View file

@ -453,10 +453,10 @@ namespace Renderer
{ {
Vertex vertices[4]; Vertex vertices[4];
std::vector<unsigned int> shaderList; std::vector<unsigned int> shaderList;
GLuint width = getScreenWidth(); GLuint width {static_cast<GLuint>(getScreenWidth())};
GLuint height = getScreenHeight(); GLuint height {static_cast<GLuint>(getScreenHeight())};
float widthf = static_cast<float>(width); float widthf {static_cast<float>(width)};
float heightf = static_cast<float>(height); float heightf {static_cast<float>(height)};
// Set vertex positions and texture coordinates to full screen as all // Set vertex positions and texture coordinates to full screen as all
// postprocessing is applied to the complete screen area. // postprocessing is applied to the complete screen area.

View file

@ -84,7 +84,7 @@ Font::Font(int size, const std::string& path)
LOG(LogWarning) << "Requested font size too small, changing to minimum supported size"; LOG(LogWarning) << "Requested font size too small, changing to minimum supported size";
} }
else if (mSize > Renderer::getScreenHeight()) { else if (mSize > Renderer::getScreenHeight()) {
mSize = Renderer::getScreenHeight(); mSize = static_cast<int>(Renderer::getScreenHeight());
LOG(LogWarning) << "Requested font size too large, changing to maximum supported size"; LOG(LogWarning) << "Requested font size too large, changing to maximum supported size";
} }