mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-16 11:25:35 +00:00
Update rexm.c
This commit is contained in:
@@ -1008,6 +1008,7 @@ int main(int argc, char *argv[])
|
|||||||
LOG("INFO: Scanning available example (.c) files to be added to collection...\n");
|
LOG("INFO: Scanning available example (.c) files to be added to collection...\n");
|
||||||
FilePathList clist = LoadDirectoryFilesEx(exBasePath, ".c", true);
|
FilePathList clist = LoadDirectoryFilesEx(exBasePath, ".c", true);
|
||||||
|
|
||||||
|
// Load examples collection list file (raylib/examples/examples_list.txt)
|
||||||
char *exList = LoadFileText(exCollectionFilePath);
|
char *exList = LoadFileText(exCollectionFilePath);
|
||||||
char *exListUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1);
|
char *exListUpdated = (char *)RL_CALLOC(REXM_MAX_BUFFER_SIZE, 1);
|
||||||
bool listUpdated = false;
|
bool listUpdated = false;
|
||||||
@@ -2328,7 +2329,7 @@ static rlExampleInfo *LoadExampleInfo(const char *exFileName)
|
|||||||
// Example found in collection
|
// Example found in collection
|
||||||
exInfo = (rlExampleInfo *)RL_CALLOC(1, sizeof(rlExampleInfo));
|
exInfo = (rlExampleInfo *)RL_CALLOC(1, sizeof(rlExampleInfo));
|
||||||
|
|
||||||
strcpy(exInfo->name, GetFileNameWithoutExt(exFileName));
|
strncpy(exInfo->name, GetFileNameWithoutExt(exFileName), 128 - 1);
|
||||||
strncpy(exInfo->category, exInfo->name, TextFindIndex(exInfo->name, "_"));
|
strncpy(exInfo->category, exInfo->name, TextFindIndex(exInfo->name, "_"));
|
||||||
|
|
||||||
char *exText = LoadFileText(exFileName);
|
char *exText = LoadFileText(exFileName);
|
||||||
@@ -2511,7 +2512,7 @@ static char **LoadExampleResourcePaths(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 and the index "distance"
|
// TODO: 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()
|
||||||
@@ -2869,8 +2870,8 @@ static void UpdateWebMetadata(const char *exHtmlPath, const char *exFilePath)
|
|||||||
char exTitle[64] = { 0 }; // Example title: fileName without extension, replacing underscores by spaces
|
char exTitle[64] = { 0 }; // Example title: fileName without extension, replacing underscores by spaces
|
||||||
|
|
||||||
// Get example name: replace underscore by spaces
|
// Get example name: replace underscore by spaces
|
||||||
strcpy(exName, GetFileNameWithoutExt(exHtmlPathCopy));
|
strncpy(exName, GetFileNameWithoutExt(exHtmlPathCopy), 64 - 1);
|
||||||
strcpy(exTitle, exName);
|
strncpy(exTitle, exName, 64 - 1);
|
||||||
for (int i = 0; (i < 256) && (exTitle[i] != '\0'); i++) { if (exTitle[i] == '_') exTitle[i] = ' '; }
|
for (int i = 0; (i < 256) && (exTitle[i] != '\0'); i++) { if (exTitle[i] == '_') exTitle[i] = ' '; }
|
||||||
|
|
||||||
// Get example category from exName: copy until first underscore
|
// Get example category from exName: copy until first underscore
|
||||||
|
|||||||
Reference in New Issue
Block a user