5 Commits

Author SHA1 Message Date
Ray
d3cc78d9d7 Update rexm.c 2026-03-29 01:44:33 +01:00
Ray
e3dcb144bc Update rexm.c 2026-03-29 01:33:27 +01:00
Ray
da93ec4a21 Remove trailing spaces 2026-03-29 01:17:25 +01:00
Ray
fb0f83bc91 Remove trailing spaces on shaders 2026-03-29 01:10:29 +01:00
Ray
29ded51ea4 Update rlgl.h 2026-03-29 00:43:50 +01:00
52 changed files with 237 additions and 232 deletions

View File

@ -1614,8 +1614,11 @@ void rlNormal3f(float x, float y, float z)
normalz = RLGL.State.transform.m2*x + RLGL.State.transform.m6*y + RLGL.State.transform.m10*z; normalz = RLGL.State.transform.m2*x + RLGL.State.transform.m6*y + RLGL.State.transform.m10*z;
} }
/* Normalize the vector if required. Default behavior assumes the normal vector is in the correct space for what the shader expects. // NOTE: Default behavior assumes the normal vector is in the correct space for what the shader expects,
float length = sqrtf(normalx * normalx + normaly * normaly + normalz * normalz); // it could be not normalized to 0.0f..1.0f, magnitud can be useed for some effects
/*
// WARNING: Vector normalization if required
float length = sqrtf(normalx*normalx + normaly*normaly + normalz*normalz);
if (length != 0.0f) if (length != 0.0f)
{ {
float ilength = 1.0f/length; float ilength = 1.0f/length;
@ -1623,7 +1626,7 @@ void rlNormal3f(float x, float y, float z)
normaly *= ilength; normaly *= ilength;
normalz *= ilength; normalz *= ilength;
} }
*/ */
RLGL.State.normalx = normalx; RLGL.State.normalx = normalx;
RLGL.State.normaly = normaly; RLGL.State.normaly = normaly;
RLGL.State.normalz = normalz; RLGL.State.normalz = normalz;

View File

@ -1572,13 +1572,13 @@ int main(int argc, char *argv[])
" SaveFileText(\"outputLogFileName\", logText);\n" " SaveFileText(\"outputLogFileName\", logText);\n"
" emscripten_run_script(\"saveFileFromMEMFSToDisk('outputLogFileName','outputLogFileName')\");\n\n" " emscripten_run_script(\"saveFileFromMEMFSToDisk('outputLogFileName','outputLogFileName')\");\n\n"
" return 0"; " return 0";
char *returnReplaceTextUpdated = TextReplacEx(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName)); char *returnReplaceTextUpdated = TextReplaceAlloc(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName));
char *srcTextUpdated[4] = { 0 }; char *srcTextUpdated[4] = { 0 };
srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText); srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText);
srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
srcTextUpdated[3] = TextReplacEx(srcTextUpdated[2], " return 0", returnReplaceTextUpdated); srcTextUpdated[3] = TextReplaceAlloc(srcTextUpdated[2], " return 0", returnReplaceTextUpdated);
MemFree(returnReplaceTextUpdated); MemFree(returnReplaceTextUpdated);
UnloadFileText(srcText); UnloadFileText(srcText);
@ -1628,9 +1628,9 @@ int main(int argc, char *argv[])
" if ((argc > 1) && (argc == 3) && (strcmp(argv[1], \"--frames\") != 0)) requestedTestFrames = atoi(argv[2]);\n"; " if ((argc > 1) && (argc == 3) && (strcmp(argv[1], \"--frames\") != 0)) requestedTestFrames = atoi(argv[2]);\n";
char *srcTextUpdated[3] = { 0 }; char *srcTextUpdated[3] = { 0 };
srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText); srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText);
srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)"); srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;"); srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
UnloadFileText(srcText); UnloadFileText(srcText);
SaveFileText(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName), srcTextUpdated[2]); SaveFileText(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName), srcTextUpdated[2]);
@ -2037,8 +2037,10 @@ static int UpdateRequiredFiles(void)
// In this case, we focus on web building for: glsl100 // In this case, we focus on web building for: glsl100
if (TextFindIndex(resPaths[r], "glsl%i") > -1) if (TextFindIndex(resPaths[r], "glsl%i") > -1)
{ {
char *resPathUpdated = TextReplaceAlloc(resPaths[r], "glsl%i", "glsl100");
memset(resPaths[r], 0, 256); memset(resPaths[r], 0, 256);
strcpy(resPaths[r], TextReplace(resPaths[r], "glsl%i", "glsl100")); strcpy(resPaths[r], resPathUpdated);
RL_FREE(resPathUpdated);
} }
if (r < (resPathCount - 1)) if (r < (resPathCount - 1))
@ -2140,7 +2142,7 @@ static int UpdateRequiredFiles(void)
{ {
mdIndex += sprintf(mdTextUpdated + mdListStartIndex + mdIndex, TextFormat("\n### category: shaders [%i]\n\n", exCollectionCount)); mdIndex += sprintf(mdTextUpdated + mdListStartIndex + mdIndex, TextFormat("\n### category: shaders [%i]\n\n", exCollectionCount));
mdIndex += sprintf(mdTextUpdated + mdListStartIndex + mdIndex, mdIndex += sprintf(mdTextUpdated + mdListStartIndex + mdIndex,
"Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.c) module.\n\n"); "Examples using raylib shaders functionality, including shaders loading, parameters configuration and drawing using them (model shaders and postprocessing shaders). This functionality is directly provided by raylib [rlgl](../src/rlgl.h) module.\n\n");
} }
else if (i == 6) // "audio" else if (i == 6) // "audio"
{ {
@ -2903,14 +2905,14 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
UnloadFileText(exText); UnloadFileText(exText);
// Update example.html required text // Update example.html required text
exHtmlTextUpdated[0] = TextReplace(exHtmlText, "raylib web game", exTitle); exHtmlTextUpdated[0] = TextReplaceAlloc(exHtmlText, "raylib web game", exTitle);
exHtmlTextUpdated[1] = TextReplace(exHtmlTextUpdated[0], "New raylib web videogame, developed using raylib videogames library", exDescription); exHtmlTextUpdated[1] = TextReplaceAlloc(exHtmlTextUpdated[0], "New raylib web videogame, developed using raylib videogames library", exDescription);
exHtmlTextUpdated[2] = TextReplace(exHtmlTextUpdated[1], "https://www.raylib.com/common/raylib_logo.png", exHtmlTextUpdated[2] = TextReplaceAlloc(exHtmlTextUpdated[1], "https://www.raylib.com/common/raylib_logo.png",
TextFormat("https://raw.githubusercontent.com/raysan5/raylib/master/examples/%s/%s.png", exCategory, exName)); TextFormat("https://raw.githubusercontent.com/raysan5/raylib/master/examples/%s/%s.png", exCategory, exName));
exHtmlTextUpdated[3] = TextReplace(exHtmlTextUpdated[2], "https://www.raylib.com/games.html", exHtmlTextUpdated[3] = TextReplaceAlloc(exHtmlTextUpdated[2], "https://www.raylib.com/games.html",
TextFormat("https://www.raylib.com/examples/%s/%s.html", exCategory, exName)); TextFormat("https://www.raylib.com/examples/%s/%s.html", exCategory, exName));
exHtmlTextUpdated[4] = TextReplace(exHtmlTextUpdated[3], "raylib - example", TextFormat("raylib - %s", exName)); // og:site_name exHtmlTextUpdated[4] = TextReplaceAlloc(exHtmlTextUpdated[3], "raylib - example", TextFormat("raylib - %s", exName)); // og:site_name
exHtmlTextUpdated[5] = TextReplace(exHtmlTextUpdated[4], "https://github.com/raysan5/raylib", exHtmlTextUpdated[5] = TextReplaceAlloc(exHtmlTextUpdated[4], "https://github.com/raysan5/raylib",
TextFormat("https://github.com/raysan5/raylib/blob/master/examples/%s/%s.c", exCategory, exName)); TextFormat("https://github.com/raysan5/raylib/blob/master/examples/%s/%s.c", exCategory, exName));
SaveFileText(exHtmlPathCopy, exHtmlTextUpdated[5]); SaveFileText(exHtmlPathCopy, exHtmlTextUpdated[5]);