Merge pull request #92 from Foxar/feature/bmploader_bitchecking

Feature/bmploader bitchecking
This commit is contained in:
Sandro Sobczyński
2021-04-23 20:00:45 +02:00
committed by GitHub
+8 -1
View File
@@ -50,8 +50,15 @@ void BmpLoader::load(Texture &o_texture, char *t_subfolder, char *t_name, char *
u32 width = (u32)header[18];
u32 height = (u32)header[22];
u32 bits = (u32)header[28];
if (bits != 24)
{
PRINT_ERR("Invalid bits per pixel in .bmp file - expected 24!");
}
o_texture.setSize(width, height, TEX_TYPE_RGB);
printf("BMPLoader - width: %d | height: %d\n", width, height);
printf("BMPLoader - width: %d | height: %d | bits: %d\n", width, height, bits);
u64 rowPadded = (width * 3 + 3) & (~3);