summaryrefslogtreecommitdiff
path: root/gfx/image.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-11-26 20:21:12 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-26 20:21:12 +0000
commit239b3ab10b460da34c490a7e06a21c984e21ffb6 (patch)
tree4ce09f5d091ffbcf063a9d0fc076659dfe9e3142 /gfx/image.cpp
parentDon't run the app by default (diff)
downloadilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.bz2
ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.tar.xz
ilt-239b3ab10b460da34c490a7e06a21c984e21ffb6.zip
Enable all Jason Turner recommended warnings
Diffstat (limited to 'gfx/image.cpp')
-rw-r--r--gfx/image.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/image.cpp b/gfx/image.cpp
index 41c59a2..e3e3b01 100644
--- a/gfx/image.cpp
+++ b/gfx/image.cpp
@@ -6,7 +6,11 @@
Image::Image(const char * fileName, int flags) : width {}, height {}, numComponents {}
{
stbi_set_flip_vertically_on_load(1);
- unsigned char * bytes = stbi_load(fileName, &width, &height, &numComponents, flags);
+ int w, h, nc;
+ unsigned char * bytes = stbi_load(fileName, &w, &h, &nc, flags);
+ width = static_cast<unsigned int>(w);
+ height = static_cast<unsigned int>(h);
+ numComponents = static_cast<unsigned int>(nc);
if (!bytes) {
throw std::runtime_error {std::string {"Unable to load image: "} + fileName};