Commit Graph

283 Commits

Author SHA1 Message Date
seanpringle cebcdea80f [wip] MeshNormalsSmooth() (#1317)
* MeshSmoothNormals() by average

* wrong comment

* spelling

* use correct function naming convention
2020-07-20 11:05:18 +02:00
raysan5 642f42bb4f Reviewed comment in LoadIQM() #1315 2020-07-17 18:22:09 +02:00
seanpringle bdd253a66a clamp ray hit y position to ground plane height (#1311) 2020-07-15 11:13:03 +02:00
Ray bd13d4a471 Add missing include 2020-06-23 00:33:51 +02:00
frithrah e07512e213 Fixed buffer overflow in GenMeshPoly (#1269)
Co-authored-by: frithrah <simon@frithrah.com>
2020-06-05 19:13:31 +02:00
raysan5 394bf00ba5 REDESIGNED: ExportMesh() to use memory buffer #1232
This change could introduce an issue on dataSize precalculation...
2020-05-23 19:48:40 +02:00
raysan5 0bcb892975 REDESIGNED: LoadIQM(), LoadModelAnimations() to use mem buffers 2020-05-23 19:24:15 +02:00
raysan5 b3eea3d322 Avoid loading texcoords and normasl from model if not existent 2020-05-18 18:35:47 +02:00
raysan5 4ec40e720c GenMeshCubicmap() added comments and simplification 2020-05-11 17:54:23 +02:00
GoldenThumbs 763aa5b8a2 Fixed Generated Normals for GenMeshCubicmap (#1244)
Just flipped the signs of `n5` and `n6` at lines `2021` and `2022`.
2020-05-11 11:41:21 +02:00
sikor666 db4a618c6f Fix materials loading for IQM models (#1227) 2020-05-08 20:27:10 +02:00
raysan5 f6ca045735 ADDED: DrawTriangle3D() and DrawTriangleStrip3D()
Those functions could be very useful for custom triangle data drawing, using internal batch system.
2020-05-07 12:46:45 +02:00
raysan5 fdad1f023b Avoid all MSVC compile warnings
Most warning were related to types conversion (casting required) and unsigned/signed types comparisons.

Added preprocessor directives (_CRT_SECURE_NO_DEPRECATE; _CRT_NONSTDC_NO_DEPRECATE) to avoid warnings about unsafe functions, those functions are safe while used properly and recommended alternatives are MS only.

Some external libraries still generate warnings.
2020-05-06 19:12:09 +02:00
raysan5 51c3bef497 Review exposed #defines and allow user re-defining
There are multiple #define values around raylib, usually not exposed for redefinition, just reviewed all of them to allow users redefining them on compile time if required.

Also, multiple #define have been renamed and commented.
2020-05-01 17:31:44 +02:00
raysan5 4ca4326bf9 Review LoadGLTF() to read from memory buffer 2020-04-30 19:51:57 +02:00
raysan5 cc816345bf WARNING: API BREAK: Removed LoadImagePro()
Actually this function is useless and potentially dangerous, internally, a shallow copy of data was done. Same could be accomplished accesing image.data directly.
2020-04-10 19:26:36 +02:00
Dani Martin 1a948849f3 [cppcheck] Fix minor warnings in models.c and raudio.c (#1162)
Errores fixes:
models.c,2843 Either the condition 'fileData!=NULL' is redundant or there is possible null pointer dereference: fileData.
raudio.c,805, 806, 807, 808, %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
2020-03-30 17:08:01 +02:00
raysan5 70ed975b99 [models] Review TRACELOG() messages, categorized 2020-03-27 17:43:51 +01:00
raysan5 d657537821 Support mtl loading by tinyobj_parse_obj() #1134
I don't like this solution but well... let's use it for the moment...
2020-03-24 18:42:57 +01:00
Ádám Dóda 584e2d664c GenMeshHeightmap flat shading normals (#1140) 2020-03-24 13:27:49 +01:00
raysan5 2344941974 Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
2020-03-17 13:40:07 +01:00
Ray 1ee6290fcf Replaced fabs() by fabsf() when required 2020-02-28 12:54:39 +01:00
Ray c5d5d19443 Remove trail spaces 2020-02-26 20:23:55 +01:00
Tyler Jessilynn Bezera e7fdf8a13d Expand GLTF Model support (#1108)
* Update GLTF support to include loading color for albdeo (saved in the color value of the materialmap), support occlussion and emmission maps.. as well as some quality of life updates.

* clean up to use single image
2020-02-22 10:17:30 +01:00
raysan5 131132f17d Minor tweaks 2020-02-10 10:56:48 +01:00
raysan5 becd3c3831 REVIEWED: GenMeshCylinder(), solved issue #1088 2020-02-09 21:04:03 +01:00
Ray ea40bda88c Added func used in comments 2020-02-04 17:52:40 +01:00
Ray b5fe41f41a Review libc dependencies and remove when possible
Just for clarification, no plans to remove libc dependency, just did some code analysis to see how much raylib depend on stardard C library. My conclusions:

 - stdlib.h: primary dependency is for malloc() and free()
 - stdio.h: primary dependency is for FILE access, maybe it could go through a custom ABI?
 - string.h: just around 8 functions required
 - math.h: just around 8 functions required
 - others: 1-2 functions required for some other headers
2020-02-04 16:55:24 +01:00
Ray c3f06b7470 Remove all trail spaces 2020-02-03 19:26:28 +01:00
Ray cde26c743c Replace TraceLog() function by TRACELOG macro
Added SUPPORT_TRACELOG_DEBUG config
2020-02-03 19:13:24 +01:00
Ray 4992edab24 ADDED: DrawPoint3D() 2020-01-29 12:21:22 +01:00
Ray c715cae18d Some tweaks 2020-01-28 16:40:12 +01:00
Ray b02c6127a0 Minor tweaks 2020-01-26 13:27:37 +01:00
Ray d41386d661 Minor tweaks to avoid warnings 2020-01-24 18:23:36 +01:00
Ray d10ff78822 WARNING: Renamed Vector3Multiply() to Vector3Scale()
Renamed for consistency with Vecto2Scale()
Also renamed Vector3MultiplyV() to Vector3Multiply()
2020-01-23 21:10:12 +01:00
Victor Gallet 6a46dcb374 Fix compilation when the SUPPORT_MESH_GENERATION feature is not supported (previously, the loadModel function was using the GenMeshCube texture, if no model founded, to generate a default cube mesh (#1075) 2020-01-17 23:06:46 +01:00
raysan5 21c30f43d4 Update year to 2020 2020-01-05 20:01:54 +01:00
las3rlars f8bd56b07f Normals was not correctly updated when using animated meshes (#1052)
* Normal vbo not correctly updated
2019-12-29 12:17:36 +01:00
Ray 1397242d88 Small code tweak to avoid warning 2019-12-11 23:14:32 +01:00
Ray 416a52b5bc Minor comments tweak 2019-12-01 12:55:33 +01:00
Ray 2783d0d63e DrawPoint3D(): PR review 2019-11-22 00:33:50 +01:00
Eric J 5d27c1e6c9 Add DrawPoint3D() function to models.c (#1019)
Uses fewer vertexes than using DrawCube() or DrawSphere() for points.  The small line is on analogy to the code for DrawPoint() in shapes.c.
2019-11-22 00:30:19 +01:00
João Coelho 75b0264f35 fix various problems, thanks CppCheck :) (#1005)
* explained a bit more the core_window_letterbox example

* fixed a few 'ups' moments that could lead to mild head pain and time loss
2019-10-29 15:57:19 +01:00
chriscamacho 3d8b1165a8 mem leak in gltf loader (#995) 2019-10-23 10:42:17 +02:00
Ray 9b6227688f Corrected issue #992 2019-10-22 23:31:04 +02:00
Ray ea70c47a1a Review latest PR 2019-10-21 17:55:37 +02:00
Tyler Jessilynn Bezera 3f7fa6d6e7 Add multi texture support for materials in GLTF format (#979)
* Initial commit of addition for GLTF materials.. should support loading more than just albedo map.

* Clean up

* fixed seg faults and leaks

* temp don't overwrite defuse colour when rendering

* undid something dumb!

* correctly mixed diffuse map color when rendering to preserve not overwrite it
2019-10-21 17:38:23 +02:00
Michael Vetter 596338b26a Check whether parsing mtl file was succesful (#982) 2019-10-03 21:05:21 +02:00
Michael Vetter eb772bc1e0 Check whether GLTF was loaded correctly (#981) 2019-10-03 17:07:32 +02:00
Ray bdcb16e7bb Review PR and comments 2019-09-22 21:47:19 +02:00