mirror of https://github.com/bjornbytes/lovr.git
Handle mipMapCount = 0 in DDS textures;
This commit is contained in:
parent
afc8000fc7
commit
8af82d3bc1
|
@ -5,6 +5,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "platform.h"
|
||||
|
||||
#define FOUR_CC(a, b, c, d) ((uint32_t) (((d)<<24) | ((c)<<16) | ((b)<<8) | (a)))
|
||||
|
||||
|
@ -99,7 +100,7 @@ static int parseDDS(uint8_t* data, size_t size, TextureData* textureData) {
|
|||
|
||||
int width = textureData->width = header->width;
|
||||
int height = textureData->height = header->height;
|
||||
int mipmapCount = header->mipMapCount;
|
||||
int mipmapCount = MAX(header->mipMapCount, 1);
|
||||
int blockBytes = 0;
|
||||
|
||||
switch (textureData->format) {
|
||||
|
|
Loading…
Reference in New Issue