Update rexm.c

This commit is contained in:
Ray
2025-09-09 00:47:12 +02:00
parent 0da5bc1e17
commit f6ae596a1d

View File

@ -639,9 +639,15 @@ int main(int argc, char *argv[])
FileRename(TextFormat("%s/%s/%s.png", exBasePath, exCategory, exName), FileRename(TextFormat("%s/%s/%s.png", exBasePath, exCategory, exName),
TextFormat("%s/%s/%s.png", exBasePath, exCategory, exRename)); TextFormat("%s/%s/%s.png", exBasePath, exCategory, exRename));
// TODO: Edit: Update example source code metadata // Edit: Update example source code metadata
//rlExampleInfo *info = LoadExamplesData(exCollectionFilePath, exRename, false, NULL); // TODO: Load one example from collection int exListCount = 0;
//UpdateSourceMetadata(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename), info); rlExampleInfo *exList = LoadExamplesData(exCollectionFilePath, exCategory, false, &exListCount);
for (int i = 0; i < exListCount; i++)
{
if (strcmp(exList[i].name, exRename) == 0)
UpdateSourceMetadata(TextFormat("%s/%s/%s.c", exBasePath, exCategory, exRename), &exList[i]);
}
UnloadExamplesData(exList);
// NOTE: Example resource files do not need to be changed... // NOTE: Example resource files do not need to be changed...
// unless the example is moved from one caegory to another // unless the example is moved from one caegory to another
@ -860,7 +866,8 @@ int main(int argc, char *argv[])
for (unsigned int i = 0; i < list.count; i++) for (unsigned int i = 0; i < list.count; i++)
{ {
if ((strcmp("examples_template", GetFileNameWithoutExt(list.paths[i])) != 0) && // HACK: Skip "examples_template" // NOTE: Skipping "examples_template" from checks
if ((strcmp("examples_template", GetFileNameWithoutExt(list.paths[i])) != 0) &&
(TextFindIndex(exList, GetFileNameWithoutExt(list.paths[i])) == -1)) (TextFindIndex(exList, GetFileNameWithoutExt(list.paths[i])) == -1))
{ {
// Add example to the examples collection list // Add example to the examples collection list
@ -2043,7 +2050,7 @@ static char **ScanExampleResources(const char *filePath, int *resPathCount)
if (!end) break; if (!end) break;
// WARNING: Some paths could be for saving files, not loading, those "resource" files must be omitted // WARNING: Some paths could be for saving files, not loading, those "resource" files must be omitted
// HACK: Just check previous position from pointer for function name including the string... // HACK: Just check previous position from pointer for function name including the string and the index "distance"
// This is a quick solution, the good one would be getting the data loading function names... // This is a quick solution, the good one would be getting the data loading function names...
int functionIndex01 = TextFindIndex(ptr - 40, "ExportImage"); // Check ExportImage() int functionIndex01 = TextFindIndex(ptr - 40, "ExportImage"); // Check ExportImage()
int functionIndex02 = TextFindIndex(ptr - 10, "TraceLog"); // Check TraceLog() int functionIndex02 = TextFindIndex(ptr - 10, "TraceLog"); // Check TraceLog()