JSON parser: Use array for function params (#2255)

This commit is contained in:
gtrxAC 2022-01-04 12:36:58 +02:00
parent 2116a98745
commit 3f0ec2334f
5 changed files with 5609 additions and 2374 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2551,7 +2551,7 @@ return {
},
{
name = "SetWindowState",
description = "Set window configuration state using flags",
description = "Set window configuration state using flags (only PLATFORM_DESKTOP)",
returnType = "void",
params = {
{name = "flags", type = "unsigned int"}
@ -2636,6 +2636,14 @@ return {
{name = "height", type = "int"}
}
},
{
name = "SetWindowOpacity",
description = "Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)",
returnType = "void",
params = {
{name = "opacity", type = "float"}
}
},
{
name = "GetWindowHandle",
description = "Get native window handle",
@ -5264,7 +5272,7 @@ return {
},
{
name = "LoadFontEx",
description = "Load font from file with extended parameters",
description = "Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set",
returnType = "Font",
params = {
{name = "fileName", type = "const char *"},
@ -5333,12 +5341,21 @@ return {
},
{
name = "UnloadFont",
description = "Unload Font from GPU memory (VRAM)",
description = "Unload font from GPU memory (VRAM)",
returnType = "void",
params = {
{name = "font", type = "Font"}
}
},
{
name = "ExportFontAsCode",
description = "Export font as code file, returns true on success",
returnType = "bool",
params = {
{name = "font", type = "Font"},
{name = "fileName", type = "const char *"}
}
},
{
name = "DrawFPS",
description = "Draw current FPS",

File diff suppressed because it is too large Load Diff

View File

@ -542,7 +542,7 @@
<Value name="NPATCH_THREE_PATCH_HORIZONTAL" integer="2" desc="Npatch layout: 3x1 tiles" />
</Enum>
</Enums>
<Functions count="489">
<Functions count="491">
<Function name="InitWindow" retType="void" paramCount="3" desc="Initialize window and OpenGL context">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
@ -569,7 +569,7 @@
<Function name="IsWindowState" retType="bool" paramCount="1" desc="Check if one specific window flag is enabled">
<Param type="unsigned int" name="flag" desc="" />
</Function>
<Function name="SetWindowState" retType="void" paramCount="1" desc="Set window configuration state using flags">
<Function name="SetWindowState" retType="void" paramCount="1" desc="Set window configuration state using flags (only PLATFORM_DESKTOP)">
<Param type="unsigned int" name="flags" desc="" />
</Function>
<Function name="ClearWindowState" retType="void" paramCount="1" desc="Clear window configuration state flags">
@ -604,6 +604,9 @@
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
</Function>
<Function name="SetWindowOpacity" retType="void" paramCount="1" desc="Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)">
<Param type="float" name="opacity" desc="" />
</Function>
<Function name="GetWindowHandle" retType="void *" paramCount="0" desc="Get native window handle">
</Function>
<Function name="GetScreenWidth" retType="int" paramCount="0" desc="Get current screen width">
@ -1831,7 +1834,7 @@
<Function name="LoadFont" retType="Font" paramCount="1" desc="Load font from file into GPU memory (VRAM)">
<Param type="const char *" name="fileName" desc="" />
</Function>
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters">
<Function name="LoadFontEx" retType="Font" paramCount="4" desc="Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set">
<Param type="const char *" name="fileName" desc="" />
<Param type="int" name="fontSize" desc="" />
<Param type="int *" name="fontChars" desc="" />
@ -1870,9 +1873,13 @@
<Param type="GlyphInfo *" name="chars" desc="" />
<Param type="int" name="glyphCount" desc="" />
</Function>
<Function name="UnloadFont" retType="void" paramCount="1" desc="Unload Font from GPU memory (VRAM)">
<Function name="UnloadFont" retType="void" paramCount="1" desc="Unload font from GPU memory (VRAM)">
<Param type="Font" name="font" desc="" />
</Function>
<Function name="ExportFontAsCode" retType="bool" paramCount="2" desc="Export font as code file, returns true on success">
<Param type="Font" name="font" desc="" />
<Param type="const char *" name="fileName" desc="" />
</Function>
<Function name="DrawFPS" retType="void" paramCount="2" desc="Draw current FPS">
<Param type="int" name="posX" desc="" />
<Param type="int" name="posY" desc="" />

View File

@ -1001,14 +1001,17 @@ static void ExportParsedData(const char *fileName, int format)
if (funcs[i].paramCount == 0) fprintf(outFile, "\n");
else
{
fprintf(outFile, ",\n \"params\": {\n");
fprintf(outFile, ",\n \"params\": [\n");
for (int p = 0; p < funcs[i].paramCount; p++)
{
fprintf(outFile, " \"%s\": \"%s\"", funcs[i].paramName[p], funcs[i].paramType[p]);
fprintf(outFile, " {\n");
fprintf(outFile, " \"name\": \"%s\",\n", funcs[i].paramName[p]);
fprintf(outFile, " \"type\": \"%s\"\n", funcs[i].paramType[p]);
fprintf(outFile, " }");
if (p < funcs[i].paramCount - 1) fprintf(outFile, ",\n");
else fprintf(outFile, "\n");
}
fprintf(outFile, " }\n");
fprintf(outFile, " ]\n");
}
fprintf(outFile, " }");