diff options
| author | raysan5 <raysan5@gmail.com> | 2019-08-12 12:35:23 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2019-08-12 12:35:23 +0200 |
| commit | c629b16ebce5c8e7b2d8e2a3e842b069965bd6be (patch) | |
| tree | 245c5477bf2325734d04612bd60060d3a422b829 /src | |
| parent | cef1e6e2e2a015d56b3018465f9094887ff94bdd (diff) | |
| download | raylib-c629b16ebce5c8e7b2d8e2a3e842b069965bd6be.tar.gz raylib-c629b16ebce5c8e7b2d8e2a3e842b069965bd6be.zip | |
Corrected issue on compressed textures data size
Diffstat (limited to 'src')
| -rw-r--r-- | src/rlgl.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -4623,6 +4623,14 @@ int GetPixelDataSize(int width, int height, int format) } dataSize = width*height*bpp/8; // Total data size in bytes + + // Most compressed formats works on 4x4 blocks, + // if texture is smaller, minimum dataSize is 8 or 16 + if ((width < 4) && (height < 4)) + { + if ((format >= COMPRESSED_DXT1_RGB) && (format < COMPRESSED_DXT3_RGBA)) dataSize = 8; + else if ((format >= COMPRESSED_DXT3_RGBA) && (format < COMPRESSED_ASTC_8x8_RGBA)) dataSize = 16; + } return dataSize; } |
