Merge branch 'raysan5:master' into master
This commit is contained in:
commit
d30bcf6606
|
|
@ -23,6 +23,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to
|
|||
| raylib-go | **4.2** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go |
|
||||
| raylib-guile | auto | [Guile](https://www.gnu.org/software/guile/) | Zlib | https://github.com/petelliott/raylib-guile |
|
||||
| gforth-raylib | 3.5 | [Gforth](https://gforth.org/) | MIT | https://github.com/ArnautDaniel/gforth-raylib |
|
||||
| h-raylib | 4.5-dev | [Haskell](https://haskell.org/) | Apache-2.0 | https://github.com/Anut-py/h-raylib |
|
||||
| raylib-hx | 4.0 | [Haxe](https://haxe.org/) | Zlib | https://github.com/foreignsasquatch/raylib-hx |
|
||||
| hb-raylib | 3.5 | [Harbour](https://harbour.github.io) | MIT | https://github.com/MarcosLeonardoMendezGerencir/hb-raylib |
|
||||
| jaylib | **4.2** | [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) | GPLv3+CE | https://github.com/electronstudio/jaylib/ |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
* Enjoy using raylib. :)
|
||||
*
|
||||
* Example originally created with raylib 1.0, last time updated with raylib 1.0
|
||||
|
||||
*
|
||||
* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
|
||||
* BSD-like license that allows static linking with closed source software
|
||||
*
|
||||
|
|
|
|||
17
src/external/vox_loader.h
vendored
17
src/external/vox_loader.h
vendored
|
|
@ -67,7 +67,7 @@ revision history:
|
|||
#define VOX_SUCCESS (0)
|
||||
#define VOX_ERROR_FILE_NOT_FOUND (-1)
|
||||
#define VOX_ERROR_INVALID_FORMAT (-2)
|
||||
#define VOX_ERROR_FILE_VERSION_TOO_OLD (-3)
|
||||
#define VOX_ERROR_FILE_VERSION_NOT_MATCH (-3)
|
||||
|
||||
// VoxColor, 4 components, R8G8B8A8 (32bit)
|
||||
typedef struct {
|
||||
|
|
@ -538,31 +538,26 @@ int Vox_LoadFromMemory(unsigned char* pvoxData, unsigned int voxDataSize, VoxArr
|
|||
// @raysan5: Reviewed (unsigned long) -> (unsigned int), possible issue with Ubuntu 18.04 64bit
|
||||
|
||||
// @raysan5: reviewed signature loading
|
||||
unsigned char signature[4] = { 0 };
|
||||
|
||||
unsigned char* fileData = pvoxData;
|
||||
unsigned char* fileDataPtr = fileData;
|
||||
unsigned char* endfileDataPtr = fileData + voxDataSize;
|
||||
|
||||
signature[0] = fileDataPtr[0];
|
||||
signature[1] = fileDataPtr[1];
|
||||
signature[2] = fileDataPtr[2];
|
||||
signature[3] = fileDataPtr[3];
|
||||
fileDataPtr += 4;
|
||||
|
||||
if ((signature[0] != 'V') && (signature[0] != 'O') && (signature[0] != 'X') && (signature[0] != ' '))
|
||||
if (strncmp((char*)fileDataPtr, "VOX ", 4) != 0)
|
||||
{
|
||||
return VOX_ERROR_INVALID_FORMAT; //"Not an MagicaVoxel File format"
|
||||
}
|
||||
|
||||
fileDataPtr += 4;
|
||||
|
||||
// @raysan5: reviewed version loading
|
||||
unsigned int version = 0;
|
||||
version = ((unsigned int*)fileDataPtr)[0];
|
||||
fileDataPtr += 4;
|
||||
|
||||
if (version < 150)
|
||||
if (version != 150)
|
||||
{
|
||||
return VOX_ERROR_FILE_VERSION_TOO_OLD; //"MagicaVoxel version too old"
|
||||
return VOX_ERROR_FILE_VERSION_NOT_MATCH; //"MagicaVoxel version doesn't match"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user