From 580946913ab6684f73d751a964d8e96b407a9bbd Mon Sep 17 00:00:00 2001 From: Lars Doucet Date: Wed, 22 Mar 2017 15:44:29 -0500 Subject: [PATCH] explicit casting, removes warnings --- project/include/math/color/RGBA.h | 2 +- project/src/graphics/utils/ImageDataUtil.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/project/include/math/color/RGBA.h b/project/include/math/color/RGBA.h index 259126806..b39514d64 100644 --- a/project/include/math/color/RGBA.h +++ b/project/include/math/color/RGBA.h @@ -19,7 +19,7 @@ namespace lime { for (int i = 0; i < 256; i++) { - __alpha16[i] = ceil ((float)(i + 1) * ((1 << 16) / 0xFF)); + __alpha16[i] = (int) ceil ((float)(i + 1) * ((1 << 16) / 0xFF)); } diff --git a/project/src/graphics/utils/ImageDataUtil.cpp b/project/src/graphics/utils/ImageDataUtil.cpp index 6d8a243d5..057c57d03 100644 --- a/project/src/graphics/utils/ImageDataUtil.cpp +++ b/project/src/graphics/utils/ImageDataUtil.cpp @@ -525,7 +525,7 @@ namespace lime { void ImageDataUtil::SetFormat (Image* image, PixelFormat format) { - int index, a16; + int index; int length = image->buffer->data->Length () / 4; int r1, g1, b1, a1, r2, g2, b2, a2; int r, g, b, a; @@ -796,10 +796,10 @@ namespace lime { stride = image->buffer->Stride (); - x = ceil (this->rect->x); - y = ceil (this->rect->y); - width = floor (this->rect->width); - height = floor (this->rect->height); + x = (int) ceil (this->rect->x); + y = (int) ceil (this->rect->y); + width = (int) floor (this->rect->width); + height = (int) floor (this->rect->height); offset = (stride * (this->y + image->offsetY)) + ((this->x + image->offsetX) * 4); @@ -810,10 +810,10 @@ namespace lime { rect->Contract (x, y, width, height); - this->x = ceil (rect->x); - this->y = ceil (rect->y); - this->width = floor (rect->width); - this->height = floor (rect->height); + this->x = (int) ceil (rect->x); + this->y = (int) ceil (rect->y); + this->width = (int) floor (rect->width); + this->height = (int) floor (rect->height); offset = (stride * (this->y + image->offsetY)) + ((this->x + image->offsetX) * 4);