mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-09 16:59:09 -04:00
Compare commits
5 Commits
bb78e98a71
...
d3cc78d9d7
| Author | SHA1 | Date | |
|---|---|---|---|
| d3cc78d9d7 | |||
| e3dcb144bc | |||
| da93ec4a21 | |||
| fb0f83bc91 | |||
| 29ded51ea4 |
@ -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;
|
||||
}
|
||||
|
||||
/* Normalize the vector if required. 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);
|
||||
// NOTE: Default behavior assumes the normal vector is in the correct space for what the shader expects,
|
||||
// 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)
|
||||
{
|
||||
float ilength = 1.0f/length;
|
||||
@ -1623,7 +1626,7 @@ void rlNormal3f(float x, float y, float z)
|
||||
normaly *= ilength;
|
||||
normalz *= ilength;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
RLGL.State.normalx = normalx;
|
||||
RLGL.State.normaly = normaly;
|
||||
RLGL.State.normalz = normalz;
|
||||
|
||||
@ -1572,13 +1572,13 @@ int main(int argc, char *argv[])
|
||||
" SaveFileText(\"outputLogFileName\", logText);\n"
|
||||
" emscripten_run_script(\"saveFileFromMEMFSToDisk('outputLogFileName','outputLogFileName')\");\n\n"
|
||||
" return 0";
|
||||
char *returnReplaceTextUpdated = TextReplacEx(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName));
|
||||
char *returnReplaceTextUpdated = TextReplaceAlloc(returnReplaceText, "outputLogFileName", TextFormat("%s.log", exName));
|
||||
|
||||
char *srcTextUpdated[4] = { 0 };
|
||||
srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText);
|
||||
srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
|
||||
srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
|
||||
srcTextUpdated[3] = TextReplacEx(srcTextUpdated[2], " return 0", returnReplaceTextUpdated);
|
||||
srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText);
|
||||
srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
|
||||
srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
|
||||
srcTextUpdated[3] = TextReplaceAlloc(srcTextUpdated[2], " return 0", returnReplaceTextUpdated);
|
||||
MemFree(returnReplaceTextUpdated);
|
||||
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";
|
||||
|
||||
char *srcTextUpdated[3] = { 0 };
|
||||
srcTextUpdated[0] = TextReplacEx(srcText, "int main(void)\n{", mainReplaceText);
|
||||
srcTextUpdated[1] = TextReplacEx(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
|
||||
srcTextUpdated[2] = TextReplacEx(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
|
||||
srcTextUpdated[0] = TextReplaceAlloc(srcText, "int main(void)\n{", mainReplaceText);
|
||||
srcTextUpdated[1] = TextReplaceAlloc(srcTextUpdated[0], "WindowShouldClose()", "WindowShouldClose() && (testFramesCount < requestedTestFrames)");
|
||||
srcTextUpdated[2] = TextReplaceAlloc(srcTextUpdated[1], "EndDrawing();", "EndDrawing(); testFramesCount++;");
|
||||
UnloadFileText(srcText);
|
||||
|
||||
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
|
||||
if (TextFindIndex(resPaths[r], "glsl%i") > -1)
|
||||
{
|
||||
char *resPathUpdated = TextReplaceAlloc(resPaths[r], "glsl%i", "glsl100");
|
||||
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))
|
||||
@ -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,
|
||||
"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"
|
||||
{
|
||||
@ -2903,14 +2905,14 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
||||
UnloadFileText(exText);
|
||||
|
||||
// Update example.html required text
|
||||
exHtmlTextUpdated[0] = TextReplace(exHtmlText, "raylib web game", exTitle);
|
||||
exHtmlTextUpdated[1] = TextReplace(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[0] = TextReplaceAlloc(exHtmlText, "raylib web game", exTitle);
|
||||
exHtmlTextUpdated[1] = TextReplaceAlloc(exHtmlTextUpdated[0], "New raylib web videogame, developed using raylib videogames library", exDescription);
|
||||
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));
|
||||
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));
|
||||
exHtmlTextUpdated[4] = TextReplace(exHtmlTextUpdated[3], "raylib - example", TextFormat("raylib - %s", exName)); // og:site_name
|
||||
exHtmlTextUpdated[5] = TextReplace(exHtmlTextUpdated[4], "https://github.com/raysan5/raylib",
|
||||
exHtmlTextUpdated[4] = TextReplaceAlloc(exHtmlTextUpdated[3], "raylib - example", TextFormat("raylib - %s", exName)); // og:site_name
|
||||
exHtmlTextUpdated[5] = TextReplaceAlloc(exHtmlTextUpdated[4], "https://github.com/raysan5/raylib",
|
||||
TextFormat("https://github.com/raysan5/raylib/blob/master/examples/%s/%s.c", exCategory, exName));
|
||||
|
||||
SaveFileText(exHtmlPathCopy, exHtmlTextUpdated[5]);
|
||||
|
||||
Reference in New Issue
Block a user