diff options
Diffstat (limited to 'src/graphics')
-rw-r--r-- | src/graphics/image.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/graphics/image.c b/src/graphics/image.c index 0a6a88a..eeee2ad 100644 --- a/src/graphics/image.c +++ b/src/graphics/image.c @@ -44,14 +44,12 @@ int mgl_image_load_from_file(mgl_image *self, const char *filepath) { self->height = 0; int format; - /* TODO: format is forced to rgba right now because rgb images cause the image to be skewed (bug) */ - self->data = stbi_load(filepath, &self->width, &self->height, &format, 4); + self->data = stbi_load(filepath, &self->width, &self->height, &format, 0); if(!self->data) { fprintf(stderr, "Error: failed to load image %s, error: %s\n", filepath, stbi_failure_reason()); mgl_image_unload(self); return -1; } - format = 4; self->format = stbi_format_to_mgl_image_format(format); return 0; @@ -65,14 +63,12 @@ int mgl_image_load_from_memory(mgl_image *self, const unsigned char *data, size_ self->height = 0; int format; - /* TODO: format is forced to rgba right now because rgb images cause the image to be skewed (bug) */ - self->data = stbi_load_from_memory(data, size, &self->width, &self->height, &format, 4); + self->data = stbi_load_from_memory(data, size, &self->width, &self->height, &format, 0); if(!self->data) { fprintf(stderr, "Error: failed to load image from memory, error: %s\n", stbi_failure_reason()); mgl_image_unload(self); return -1; } - format = 4; self->format = stbi_format_to_mgl_image_format(format); return 0; |