@@ -3879,10 +3879,10 @@ void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector
3879
3879
}
3880
3880
3881
3881
Vector2 texcoords [4 ];
3882
- texcoords [0 ] = (Vector2 ) { (float )source .x /texture .width , (float )(source .y + source .height )/texture .height };
3883
- texcoords [1 ] = (Vector2 ) { (float )(source .x + source .width )/texture .width , (float )(source .y + source .height )/texture .height };
3884
- texcoords [2 ] = (Vector2 ) { (float )(source .x + source .width )/texture .width , (float )source .y /texture .height };
3885
- texcoords [3 ] = (Vector2 ) { (float )source .x /texture .width , (float )source .y /texture .height };
3882
+ texcoords [0 ] = (Vector2 ){ (float )source .x /texture .width , (float )(source .y + source .height )/texture .height };
3883
+ texcoords [1 ] = (Vector2 ){ (float )(source .x + source .width )/texture .width , (float )(source .y + source .height )/texture .height };
3884
+ texcoords [2 ] = (Vector2 ){ (float )(source .x + source .width )/texture .width , (float )source .y /texture .height };
3885
+ texcoords [3 ] = (Vector2 ){ (float )source .x /texture .width , (float )source .y /texture .height };
3886
3886
3887
3887
rlSetTexture (texture .id );
3888
3888
rlBegin (RL_QUADS );
@@ -5141,7 +5141,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
5141
5141
image = LoadImage (TextFormat ("%s/%s" , texPath , cgltfImage -> uri ));
5142
5142
}
5143
5143
}
5144
- else if (cgltfImage -> buffer_view != NULL && cgltfImage -> buffer_view -> buffer -> data != NULL ) // Check if image is provided as data buffer
5144
+ else if (( cgltfImage -> buffer_view != NULL ) && ( cgltfImage -> buffer_view -> buffer -> data != NULL ) ) // Check if image is provided as data buffer
5145
5145
{
5146
5146
unsigned char * data = RL_MALLOC (cgltfImage -> buffer_view -> size );
5147
5147
int offset = (int )cgltfImage -> buffer_view -> offset ;
@@ -5156,10 +5156,14 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
5156
5156
5157
5157
// Check mime_type for image: (cgltfImage->mime_type == "image/png")
5158
5158
// NOTE: Detected that some models define mime_type as "image\\/png"
5159
- if ((strcmp (cgltfImage -> mime_type , "image\\/png" ) == 0 ) ||
5160
- (strcmp (cgltfImage -> mime_type , "image/png" ) == 0 )) image = LoadImageFromMemory (".png" , data , (int )cgltfImage -> buffer_view -> size );
5161
- else if ((strcmp (cgltfImage -> mime_type , "image\\/jpeg" ) == 0 ) ||
5162
- (strcmp (cgltfImage -> mime_type , "image/jpeg" ) == 0 )) image = LoadImageFromMemory (".jpg" , data , (int )cgltfImage -> buffer_view -> size );
5159
+ if ((strcmp (cgltfImage -> mime_type , "image\\/png" ) == 0 ) || (strcmp (cgltfImage -> mime_type , "image/png" ) == 0 ))
5160
+ {
5161
+ image = LoadImageFromMemory (".png" , data , (int )cgltfImage -> buffer_view -> size );
5162
+ }
5163
+ else if ((strcmp (cgltfImage -> mime_type , "image\\/jpeg" ) == 0 ) || (strcmp (cgltfImage -> mime_type , "image/jpeg" ) == 0 ))
5164
+ {
5165
+ image = LoadImageFromMemory (".jpg" , data , (int )cgltfImage -> buffer_view -> size );
5166
+ }
5163
5167
else TRACELOG (LOG_WARNING , "MODEL: glTF image data MIME type not recognized" , TextFormat ("%s/%s" , texPath , cgltfImage -> uri ));
5164
5168
5165
5169
RL_FREE (data );
0 commit comments