mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-08 07:09:18 -05:00
Compare commits
8 Commits
f83c5cb6e1
...
f60333d9b2
| Author | SHA1 | Date | |
|---|---|---|---|
| f60333d9b2 | |||
| 785965fcef | |||
| d0e6f60ef3 | |||
| 6c4f220e89 | |||
| c95630b7d0 | |||
| e9f655d002 | |||
| 41211b0c8c | |||
| d320a029c8 |
22
.github/workflows/update_examples.yml
vendored
22
.github/workflows/update_examples.yml
vendored
@ -39,16 +39,18 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd tools/rexm/VS2022
|
cd tools/rexm/VS2022
|
||||||
msbuild.exe rexm.sln /target:rexm /property:Configuration=Release /property:Platform=x64
|
msbuild.exe rexm.sln /target:rexm /property:Configuration=Release /property:Platform=x64
|
||||||
cd ../../..
|
cd ${{ github.workspace }}\tools\rexm\VS2022\build\rexm\bin\x64\Release
|
||||||
set REXM_EXAMPLES_BASE_PATH="examples"
|
set REXM_EXAMPLES_BASE_PATH=${{ github.workspace }}\examples
|
||||||
set REXM_EXAMPLES_WEB_PATH="../raylib.com/examples"
|
set REXM_EXAMPLES_WEB_PATH=${{ github.workspace }}\..\raylib.com\examples
|
||||||
set REXM_EXAMPLES_TEMPLATE_FILE_PATH="examples/examples_template.c"
|
set REXM_EXAMPLES_TEMPLATE_FILE_PATH=${{ github.workspace }}\examples\examples_template.c
|
||||||
set REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH="examples/examples_template.png"
|
set REXM_EXAMPLES_TEMPLATE_SCREENSHOT_PATH=${{ github.workspace }}\examples\examples_template.png
|
||||||
set REXM_EXAMPLES_COLLECTION_FILE_PATH="examples/examples_list.txt"
|
set REXM_EXAMPLES_COLLECTION_FILE_PATH=${{ github.workspace }}\examples\examples_list.txt
|
||||||
set REXM_EXAMPLES_VS2022_SLN_FILE="projects/VS2022/raylib.sln"
|
set REXM_EXAMPLES_VS2022_SLN_FILE=${{ github.workspace }}\projects\VS2022\raylib.sln
|
||||||
set EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main"
|
set EMSDK_PATH=${{ github.workspace }}/emsdk-cache/emsdk-main
|
||||||
.\tools\rexm\VS2022\build\rexm\bin\x64\Release\rexm.exe update
|
dir
|
||||||
cd ../..
|
rexm.exe build core_basic_window
|
||||||
|
cd ${{ github.workspace }}\..
|
||||||
|
dir
|
||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Commit changes to raylib repo
|
- name: Commit changes to raylib repo
|
||||||
|
|||||||
@ -575,8 +575,9 @@ int main(int argc, char *argv[])
|
|||||||
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exCategory, exName));
|
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
char exHtmlPath[512] = { 0 };
|
||||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
|
||||||
|
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Copy results to web side
|
// Copy results to web side
|
||||||
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
||||||
@ -657,8 +658,9 @@ int main(int argc, char *argv[])
|
|||||||
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exRecategory, exRename));
|
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exRecategory, exRename));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
char exHtmlPath[512] = { 0 };
|
||||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
|
||||||
|
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Copy results to web side
|
// Copy results to web side
|
||||||
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exRecategory, exRename),
|
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exRecategory, exRename),
|
||||||
@ -1021,8 +1023,9 @@ int main(int argc, char *argv[])
|
|||||||
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
|
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
char exHtmlPath[512] = { 0 };
|
||||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
|
||||||
|
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Copy results to web side
|
// Copy results to web side
|
||||||
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exInfo->category, exInfo->name),
|
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exInfo->category, exInfo->name),
|
||||||
@ -1192,20 +1195,20 @@ int main(int argc, char *argv[])
|
|||||||
if (strcmp(exCategory, "others") != 0) // Skipping "others" category
|
if (strcmp(exCategory, "others") != 0) // Skipping "others" category
|
||||||
{
|
{
|
||||||
// Build example for PLATFORM_DESKTOP
|
// Build example for PLATFORM_DESKTOP
|
||||||
putenv("RAYLIB_DIR=C:\\GitHub\\raylib");
|
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
|
||||||
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
//putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
|
||||||
putenv("MAKE=mingw32-make");
|
//putenv("MAKE=mingw32-make");
|
||||||
|
|
||||||
ChangeDirectory(exBasePath);
|
ChangeDirectory(exBasePath);
|
||||||
system(TextFormat("%s %s/%s PLATFORM=PLATFORM_DESKTOP -B", getenv("MAKE"), exCategory, exName));
|
system(TextFormat("make %s/%s PLATFORM=PLATFORM_DESKTOP -B", exCategory, exName));
|
||||||
|
|
||||||
// Build example for PLATFORM_WEB
|
// Build example for PLATFORM_WEB
|
||||||
system(TextFormat("%s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", getenv("MAKE"), exCategory, exName));
|
system(TextFormat("make -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exCategory, exName));
|
||||||
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
|
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
|
||||||
|
|
||||||
// Update generated .html metadata
|
// Update generated .html metadata
|
||||||
UpdateWebMetadata(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
char exHtmlPath[512] = { 0 };
|
||||||
TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
|
||||||
|
UpdateWebMetadata(exHtmlPath, TextFormat("%s/%s/%s.c", exBasePath, exCategory, exName));
|
||||||
|
|
||||||
// Copy results to web side
|
// Copy results to web side
|
||||||
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
FileCopy(TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName),
|
||||||
@ -2171,7 +2174,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
|||||||
char *exText = NULL; // Example code file, required to get description
|
char *exText = NULL; // Example code file, required to get description
|
||||||
char **lines = NULL; // Pointers to example code lines
|
char **lines = NULL; // Pointers to example code lines
|
||||||
int lineCount = 0; // Example code line count
|
int lineCount = 0; // Example code line count
|
||||||
int lineLength = 0; // Description line length
|
|
||||||
|
|
||||||
char exName[64] = { 0 }; // Example name: fileName without extension
|
char exName[64] = { 0 }; // Example name: fileName without extension
|
||||||
char exCategory[16] = { 0 }; // Example category: core, shapes, text, textures, models, audio, shaders
|
char exCategory[16] = { 0 }; // Example category: core, shapes, text, textures, models, audio, shaders
|
||||||
@ -2182,7 +2184,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
|||||||
memset(exTitle, 0, 64);
|
memset(exTitle, 0, 64);
|
||||||
memset(exDescription, 0, 256);
|
memset(exDescription, 0, 256);
|
||||||
memset(exCategory, 0, 16);
|
memset(exCategory, 0, 16);
|
||||||
lineLength = 0;
|
|
||||||
|
|
||||||
// Get example name: replace underscore by spaces
|
// Get example name: replace underscore by spaces
|
||||||
strcpy(exName, GetFileNameWithoutExt(exHtmlPath));
|
strcpy(exName, GetFileNameWithoutExt(exHtmlPath));
|
||||||
@ -2195,8 +2196,9 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
|||||||
// Get example description: copy line #3 from example file
|
// Get example description: copy line #3 from example file
|
||||||
exText = LoadFileText(exFilePath);
|
exText = LoadFileText(exFilePath);
|
||||||
lines = LoadTextLines(exText, &lineCount);
|
lines = LoadTextLines(exText, &lineCount);
|
||||||
for (int i = 0; (lines[2][i] != '\n') && (lines[2][i] != '\r'); i++) lineLength++;
|
int lineLength = (int)strlen(lines[2]);
|
||||||
strncpy(exDescription, lines[2] + 4, lineLength - 4);
|
strncpy(exDescription, lines[2] + 4, lineLength - 4);
|
||||||
|
UnloadTextLines(lines);
|
||||||
UnloadFileText(exText);
|
UnloadFileText(exText);
|
||||||
|
|
||||||
// Update example.html required text
|
// Update example.html required text
|
||||||
@ -2220,7 +2222,6 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
|||||||
|
|
||||||
for (int i = 0; i < 6; i++) { MemFree(fileTextUpdated[i]); fileTextUpdated[i] = NULL; }
|
for (int i = 0; i < 6; i++) { MemFree(fileTextUpdated[i]); fileTextUpdated[i] = NULL; }
|
||||||
|
|
||||||
UnloadTextLines(lines);
|
|
||||||
UnloadFileText(fileText);
|
UnloadFileText(fileText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user