Update C sources
This commit is contained in:
parent
443f35cfac
commit
15fba7e9ac
29 changed files with 31985 additions and 22038 deletions
11
raylib/external/rl_gputex.h
vendored
11
raylib/external/rl_gputex.h
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* Note that some file formats (DDS, PVR, KTX) also support uncompressed data storage.
|
||||
* In those cases data is loaded uncompressed and format is returned.
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
* - Implement raylib function: rlGetGlTextureFormats(), required by rl_save_ktx_to_memory()
|
||||
* - Review rl_load_ktx_from_memory() to support KTX v2.2 specs
|
||||
|
@ -261,11 +261,9 @@ void *rl_load_dds_from_memory(const unsigned char *file_data, unsigned int file_
|
|||
}
|
||||
else if (((header->ddspf.flags == 0x04) || (header->ddspf.flags == 0x05)) && (header->ddspf.fourcc > 0)) // Compressed
|
||||
{
|
||||
int data_size = 0;
|
||||
|
||||
// Calculate data size, including all mipmaps
|
||||
if (header->mipmap_count > 1) data_size = header->pitch_or_linear_size*2;
|
||||
else data_size = header->pitch_or_linear_size;
|
||||
// NOTE: This forces only 1 mipmap to be loaded which is not really correct but it works
|
||||
int data_size = (header->pitch_or_linear_size < file_size - 0x80) ? header->pitch_or_linear_size : file_size - 0x80;
|
||||
*mips = 1;
|
||||
|
||||
image_data = RL_MALLOC(data_size*sizeof(unsigned char));
|
||||
|
||||
|
@ -814,5 +812,4 @@ static int get_pixel_data_size(int width, int height, int format)
|
|||
|
||||
return data_size;
|
||||
}
|
||||
|
||||
#endif // RL_GPUTEX_IMPLEMENTATION
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue