mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-02 12:33:52 +00:00
Handle mipMapCount = 0 in DDS textures;
This commit is contained in:
parent
afc8000fc7
commit
8af82d3bc1
|
@ -5,6 +5,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
#define FOUR_CC(a, b, c, d) ((uint32_t) (((d)<<24) | ((c)<<16) | ((b)<<8) | (a)))
|
#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 width = textureData->width = header->width;
|
||||||
int height = textureData->height = header->height;
|
int height = textureData->height = header->height;
|
||||||
int mipmapCount = header->mipMapCount;
|
int mipmapCount = MAX(header->mipMapCount, 1);
|
||||||
int blockBytes = 0;
|
int blockBytes = 0;
|
||||||
|
|
||||||
switch (textureData->format) {
|
switch (textureData->format) {
|
||||||
|
|
Loading…
Reference in a new issue