Commit 5ec2549a authored by Chen Bill's avatar Chen Bill Committed by GitHub

fix signed/unsigned compare (#2809)

parent c3e25993
......@@ -143,8 +143,8 @@ void ImageManager::ResizeTexture() {
}
// function by Warr1024, from https://github.com/minetest/minetest/issues/2419 , modified
void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
const irr::core::dimension2d<irr::u32> srcDim = src->getDimension();
const irr::core::dimension2d<irr::u32> destDim = dest->getDimension();
const auto& srcDim = src->getDimension();
const auto& destDim = dest->getDimension();
// Cache scale ratios.
const double rx = (double)srcDim.Width / destDim.Width;
......@@ -157,8 +157,8 @@ void imageScaleNNAA(irr::video::IImage *src, irr::video::IImage *dest) {
// Walk each destination image pixel.
#pragma omp for schedule(dynamic)
for(irr::s32 dy = 0; dy < destDim.Height; dy++) {
for(irr::s32 dx = 0; dx < destDim.Width; dx++) {
for(irr::s32 dy = 0; dy < (irr::s32)destDim.Height; dy++) {
for(irr::s32 dx = 0; dx < (irr::s32)destDim.Width; dx++) {
// Calculate floating-point source rectangle bounds.
minsx = dx * rx;
maxsx = minsx + rx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment