summaryrefslogtreecommitdiffhomepage
path: root/src/rmodels.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-12-04 19:56:02 +0100
committerRay <[email protected]>2021-12-04 19:56:02 +0100
commite637ad9d2a62fdcc2d4917de63defef5f8fb0591 (patch)
tree3299b60b57742a668a11cbb11b88264a22e4da6c /src/rmodels.c
parent48d4806e531e721d73995d61bfceaaeb955fd526 (diff)
downloadraylib-e637ad9d2a62fdcc2d4917de63defef5f8fb0591.tar.gz
raylib-e637ad9d2a62fdcc2d4917de63defef5f8fb0591.zip
Support custom modules inclusion
Allow to choose which modules are compiled with raylib, if some modules are excluded from compilation, required functionality is not available but smaller builds are possible.
Diffstat (limited to 'src/rmodels.c')
-rw-r--r--src/rmodels.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rmodels.c b/src/rmodels.c
index c159350c..bbb46e4b 100644
--- a/src/rmodels.c
+++ b/src/rmodels.c
@@ -4,12 +4,14 @@
*
* CONFIGURATION:
*
+* #define SUPPORT_MODULE_RMODELS
+* rmodels module is included in the build
+*
* #define SUPPORT_FILEFORMAT_OBJ
* #define SUPPORT_FILEFORMAT_MTL
* #define SUPPORT_FILEFORMAT_IQM
* #define SUPPORT_FILEFORMAT_GLTF
* #define SUPPORT_FILEFORMAT_VOX
-*
* Selected desired fileformats to be supported for model data loading.
*
* #define SUPPORT_MESH_GENERATION
@@ -45,6 +47,8 @@
#include "config.h" // Defines module configuration flags
#endif
+#if defined(SUPPORT_MODULE_RMODELS)
+
#include "utils.h" // Required for: TRACELOG(), LoadFileData(), LoadFileText(), SaveFileText()
#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2
#include "raymath.h" // Required for: Vector3, Quaternion and Matrix functionality
@@ -918,7 +922,7 @@ Model LoadModel(const char *fileName)
if (IsFileExtension(fileName, ".iqm")) model = LoadIQM(fileName);
#endif
#if defined(SUPPORT_FILEFORMAT_GLTF)
- if (IsFileExtension(fileName, ".gltf;.glb")) model = LoadGLTF(fileName);
+ if (IsFileExtension(fileName, ".gltf") || IsFileExtension(fileName, ".glb")) model = LoadGLTF(fileName);
#endif
#if defined(SUPPORT_FILEFORMAT_VOX)
if (IsFileExtension(fileName, ".vox")) model = LoadVOX(fileName);
@@ -1704,7 +1708,6 @@ bool ExportMesh(Mesh mesh, const char *fileName)
return success;
}
-
// Load materials from model file
Material *LoadMaterials(const char *fileName, int *materialCount)
{
@@ -5089,3 +5092,5 @@ static Model LoadVOX(const char *fileName)
return model;
}
#endif
+
+#endif // SUPPORT_MODULE_RMODELS