From d98779abef04088206cef7ccc291370ecc1a445e Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Aug 2021 01:07:37 +0200 Subject: [PATCH] Minor tweak to avoid false error logs --- src/core.c | 7 +++++-- src/raylib.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core.c b/src/core.c index b03216cc..27b6c31b 100644 --- a/src/core.c +++ b/src/core.c @@ -2281,8 +2281,11 @@ Shader LoadShader(const char *vsFileName, const char *fsFileName) { Shader shader = { 0 }; - char *vShaderStr = LoadFileText(vsFileName); - char *fShaderStr = LoadFileText(fsFileName); + char *vShaderStr = NULL; + char *fShaderStr = NULL; + + if (vsFileName != NULL) vShaderStr = LoadFileText(vsFileName); + if (fsFileName != NULL) fShaderStr = LoadFileText(fsFileName); shader = LoadShaderFromMemory(vShaderStr, fShaderStr); diff --git a/src/raylib.h b/src/raylib.h index 11ff587d..7613dd94 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -318,7 +318,7 @@ typedef struct Mesh { int vertexCount; // Number of vertices stored in arrays int triangleCount; // Number of triangles stored (indexed or not) - // Default vertex data + // Vertex attributes data float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)