Ver código fonte

Update raylib_api.* by CI (#3692)

* wip: add parse.yml

* Temporarily force run

* Auto commit parse files

* Update raylib_api.* by CI

* Remove temporary setting

* format

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
seiren 1 ano atrás
pai
commit
0a25a3ed70

+ 37 - 0
.github/workflows/parse.yml

@@ -0,0 +1,37 @@
+name: Parse raylib_api
+
+on:
+  workflow_dispatch:
+  push:
+    paths:
+      - "src/raylib.h"
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v3
+
+      - name: Update parse files
+        working-directory: parser
+        run: |
+          make raylib_api
+          mv raylib_api.* output
+
+      - name: Diff parse files
+        id: diff
+        run: |
+          git add -N parser
+          git diff --name-only --exit-code
+        continue-on-error: true
+
+      - name: Commit parse files
+        if: steps.diff.outcome == 'failure'
+        run: |
+          set -x
+          git config user.email "github-actions[bot]@users.noreply.github.com"
+          git config user.name "github-actions[bot]"
+          git add parser
+          git commit -m "Update raylib_api.* by CI"
+          git push

+ 74 - 20
parser/output/raylib_api.json

@@ -1231,11 +1231,6 @@
           "name": "vScreenSize",
           "description": "Vertical size in meters"
         },
-        {
-          "type": "float",
-          "name": "vScreenCenter",
-          "description": "Screen center in meters"
-        },
         {
           "type": "float",
           "name": "eyeToScreenDistance",
@@ -4637,7 +4632,7 @@
       "returnType": "void",
       "params": [
         {
-          "type": "AutomationEventList *",
+          "type": "AutomationEventList",
           "name": "list"
         }
       ]
@@ -5172,6 +5167,16 @@
         }
       ]
     },
+    {
+      "name": "GetShapesTexture",
+      "description": "Get texture that is used for shapes drawing",
+      "returnType": "Texture2D"
+    },
+    {
+      "name": "GetShapesTextureRectangle",
+      "description": "Get texture source rectangle that is used for shapes drawing",
+      "returnType": "Rectangle"
+    },
     {
       "name": "DrawPixel",
       "description": "Draw a pixel",
@@ -6703,6 +6708,29 @@
         }
       ]
     },
+    {
+      "name": "LoadImageAnimFromMemory",
+      "description": "Load image sequence from memory buffer",
+      "returnType": "Image",
+      "params": [
+        {
+          "type": "const char *",
+          "name": "fileType"
+        },
+        {
+          "type": "const unsigned char *",
+          "name": "fileData"
+        },
+        {
+          "type": "int",
+          "name": "dataSize"
+        },
+        {
+          "type": "int *",
+          "name": "frames"
+        }
+      ]
+    },
     {
       "name": "LoadImageFromMemory",
       "description": "Load image from memory buffer, fileType refers to extension: i.e. '.png'",
@@ -9194,7 +9222,7 @@
       "returnType": "char *",
       "params": [
         {
-          "type": "char *",
+          "type": "const char *",
           "name": "text"
         },
         {
@@ -9342,6 +9370,17 @@
         }
       ]
     },
+    {
+      "name": "TextToFloat",
+      "description": "Get float value from text (negative values not supported)",
+      "returnType": "float",
+      "params": [
+        {
+          "type": "const char *",
+          "name": "text"
+        }
+      ]
+    },
     {
       "name": "DrawLine3D",
       "description": "Draw a line in 3D world space",
@@ -10220,39 +10259,54 @@
       ]
     },
     {
-      "name": "ExportMesh",
-      "description": "Export mesh data to file, returns true on success",
-      "returnType": "bool",
+      "name": "GetMeshBoundingBox",
+      "description": "Compute mesh bounding box limits",
+      "returnType": "BoundingBox",
       "params": [
         {
           "type": "Mesh",
           "name": "mesh"
-        },
+        }
+      ]
+    },
+    {
+      "name": "GenMeshTangents",
+      "description": "Compute mesh tangents",
+      "returnType": "void",
+      "params": [
         {
-          "type": "const char *",
-          "name": "fileName"
+          "type": "Mesh *",
+          "name": "mesh"
         }
       ]
     },
     {
-      "name": "GetMeshBoundingBox",
-      "description": "Compute mesh bounding box limits",
-      "returnType": "BoundingBox",
+      "name": "ExportMesh",
+      "description": "Export mesh data to file, returns true on success",
+      "returnType": "bool",
       "params": [
         {
           "type": "Mesh",
           "name": "mesh"
+        },
+        {
+          "type": "const char *",
+          "name": "fileName"
         }
       ]
     },
     {
-      "name": "GenMeshTangents",
-      "description": "Compute mesh tangents",
-      "returnType": "void",
+      "name": "ExportMeshAsCode",
+      "description": "Export mesh as code file (.h) defining multiple arrays of vertex attributes",
+      "returnType": "bool",
       "params": [
         {
-          "type": "Mesh *",
+          "type": "Mesh",
           "name": "mesh"
+        },
+        {
+          "type": "const char *",
+          "name": "fileName"
         }
       ]
     },

+ 49 - 16
parser/output/raylib_api.lua

@@ -1231,11 +1231,6 @@ return {
           name = "vScreenSize",
           description = "Vertical size in meters"
         },
-        {
-          type = "float",
-          name = "vScreenCenter",
-          description = "Screen center in meters"
-        },
         {
           type = "float",
           name = "eyeToScreenDistance",
@@ -4150,7 +4145,7 @@ return {
       description = "Unload automation events list from file",
       returnType = "void",
       params = {
-        {type = "AutomationEventList *", name = "list"}
+        {type = "AutomationEventList", name = "list"}
       }
     },
     {
@@ -4539,6 +4534,16 @@ return {
         {type = "Rectangle", name = "source"}
       }
     },
+    {
+      name = "GetShapesTexture",
+      description = "Get texture that is used for shapes drawing",
+      returnType = "Texture2D"
+    },
+    {
+      name = "GetShapesTextureRectangle",
+      description = "Get texture source rectangle that is used for shapes drawing",
+      returnType = "Rectangle"
+    },
     {
       name = "DrawPixel",
       description = "Draw a pixel",
@@ -5263,6 +5268,17 @@ return {
         {type = "int *", name = "frames"}
       }
     },
+    {
+      name = "LoadImageAnimFromMemory",
+      description = "Load image sequence from memory buffer",
+      returnType = "Image",
+      params = {
+        {type = "const char *", name = "fileType"},
+        {type = "const unsigned char *", name = "fileData"},
+        {type = "int", name = "dataSize"},
+        {type = "int *", name = "frames"}
+      }
+    },
     {
       name = "LoadImageFromMemory",
       description = "Load image from memory buffer, fileType refers to extension: i.e. '.png'",
@@ -6616,7 +6632,7 @@ return {
       description = "Replace text string (WARNING: memory must be freed!)",
       returnType = "char *",
       params = {
-        {type = "char *", name = "text"},
+        {type = "const char *", name = "text"},
         {type = "const char *", name = "replace"},
         {type = "const char *", name = "by"}
       }
@@ -6702,6 +6718,14 @@ return {
         {type = "const char *", name = "text"}
       }
     },
+    {
+      name = "TextToFloat",
+      description = "Get float value from text (negative values not supported)",
+      returnType = "float",
+      params = {
+        {type = "const char *", name = "text"}
+      }
+    },
     {
       name = "DrawLine3D",
       description = "Draw a line in 3D world space",
@@ -7126,15 +7150,6 @@ return {
         {type = "int", name = "instances"}
       }
     },
-    {
-      name = "ExportMesh",
-      description = "Export mesh data to file, returns true on success",
-      returnType = "bool",
-      params = {
-        {type = "Mesh", name = "mesh"},
-        {type = "const char *", name = "fileName"}
-      }
-    },
     {
       name = "GetMeshBoundingBox",
       description = "Compute mesh bounding box limits",
@@ -7151,6 +7166,24 @@ return {
         {type = "Mesh *", name = "mesh"}
       }
     },
+    {
+      name = "ExportMesh",
+      description = "Export mesh data to file, returns true on success",
+      returnType = "bool",
+      params = {
+        {type = "Mesh", name = "mesh"},
+        {type = "const char *", name = "fileName"}
+      }
+    },
+    {
+      name = "ExportMeshAsCode",
+      description = "Export mesh as code file (.h) defining multiple arrays of vertex attributes",
+      returnType = "bool",
+      params = {
+        {type = "Mesh", name = "mesh"},
+        {type = "const char *", name = "fileName"}
+      }
+    },
     {
       name = "GenMeshPoly",
       description = "Generate polygonal mesh",

Diferenças do arquivo suprimidas por serem muito extensas
+ 145 - 128
parser/output/raylib_api.txt


+ 25 - 9
parser/output/raylib_api.xml

@@ -256,12 +256,11 @@
             <Field type="int" name="ctxType" desc="Type of music context (audio filetype)" />
             <Field type="void *" name="ctxData" desc="Audio context data, depends on type" />
         </Struct>
-        <Struct name="VrDeviceInfo" fieldCount="10" desc="VrDeviceInfo, Head-Mounted-Display device parameters">
+        <Struct name="VrDeviceInfo" fieldCount="9" desc="VrDeviceInfo, Head-Mounted-Display device parameters">
             <Field type="int" name="hResolution" desc="Horizontal resolution in pixels" />
             <Field type="int" name="vResolution" desc="Vertical resolution in pixels" />
             <Field type="float" name="hScreenSize" desc="Horizontal size in meters" />
             <Field type="float" name="vScreenSize" desc="Vertical size in meters" />
-            <Field type="float" name="vScreenCenter" desc="Screen center in meters" />
             <Field type="float" name="eyeToScreenDistance" desc="Distance between eye and display in meters" />
             <Field type="float" name="lensSeparationDistance" desc="Lens separation distance in meters" />
             <Field type="float" name="interpupillaryDistance" desc="IPD (distance between pupils) in meters" />
@@ -670,7 +669,7 @@
             <Param type="unsigned int" name="frames" desc="" />
         </Callback>
     </Callbacks>
-    <Functions count="553">
+    <Functions count="558">
         <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="" />
@@ -1113,7 +1112,7 @@
             <Param type="const char *" name="fileName" desc="" />
         </Function>
         <Function name="UnloadAutomationEventList" retType="void" paramCount="1" desc="Unload automation events list from file">
-            <Param type="AutomationEventList *" name="list" desc="" />
+            <Param type="AutomationEventList" name="list" desc="" />
         </Function>
         <Function name="ExportAutomationEventList" retType="bool" paramCount="2" desc="Export automation events list as text file">
             <Param type="AutomationEventList" name="list" desc="" />
@@ -1271,6 +1270,10 @@
             <Param type="Texture2D" name="texture" desc="" />
             <Param type="Rectangle" name="source" desc="" />
         </Function>
+        <Function name="GetShapesTexture" retType="Texture2D" paramCount="0" desc="Get texture that is used for shapes drawing">
+        </Function>
+        <Function name="GetShapesTextureRectangle" retType="Rectangle" paramCount="0" desc="Get texture source rectangle that is used for shapes drawing">
+        </Function>
         <Function name="DrawPixel" retType="void" paramCount="3" desc="Draw a pixel">
             <Param type="int" name="posX" desc="" />
             <Param type="int" name="posY" desc="" />
@@ -1670,6 +1673,12 @@
             <Param type="const char *" name="fileName" desc="" />
             <Param type="int *" name="frames" desc="" />
         </Function>
+        <Function name="LoadImageAnimFromMemory" retType="Image" paramCount="4" desc="Load image sequence from memory buffer">
+            <Param type="const char *" name="fileType" desc="" />
+            <Param type="const unsigned char *" name="fileData" desc="" />
+            <Param type="int" name="dataSize" desc="" />
+            <Param type="int *" name="frames" desc="" />
+        </Function>
         <Function name="LoadImageFromMemory" retType="Image" paramCount="3" desc="Load image from memory buffer, fileType refers to extension: i.e. '.png'">
             <Param type="const char *" name="fileType" desc="" />
             <Param type="const unsigned char *" name="fileData" desc="" />
@@ -2328,7 +2337,7 @@
             <Param type="int" name="length" desc="" />
         </Function>
         <Function name="TextReplace" retType="char *" paramCount="3" desc="Replace text string (WARNING: memory must be freed!)">
-            <Param type="char *" name="text" desc="" />
+            <Param type="const char *" name="text" desc="" />
             <Param type="const char *" name="replace" desc="" />
             <Param type="const char *" name="by" desc="" />
         </Function>
@@ -2368,6 +2377,9 @@
         <Function name="TextToInteger" retType="int" paramCount="1" desc="Get integer value from text (negative values not supported)">
             <Param type="const char *" name="text" desc="" />
         </Function>
+        <Function name="TextToFloat" retType="float" paramCount="1" desc="Get float value from text (negative values not supported)">
+            <Param type="const char *" name="text" desc="" />
+        </Function>
         <Function name="DrawLine3D" retType="void" paramCount="3" desc="Draw a line in 3D world space">
             <Param type="Vector3" name="startPos" desc="" />
             <Param type="Vector3" name="endPos" desc="" />
@@ -2597,16 +2609,20 @@
             <Param type="const Matrix *" name="transforms" desc="" />
             <Param type="int" name="instances" desc="" />
         </Function>
-        <Function name="ExportMesh" retType="bool" paramCount="2" desc="Export mesh data to file, returns true on success">
-            <Param type="Mesh" name="mesh" desc="" />
-            <Param type="const char *" name="fileName" desc="" />
-        </Function>
         <Function name="GetMeshBoundingBox" retType="BoundingBox" paramCount="1" desc="Compute mesh bounding box limits">
             <Param type="Mesh" name="mesh" desc="" />
         </Function>
         <Function name="GenMeshTangents" retType="void" paramCount="1" desc="Compute mesh tangents">
             <Param type="Mesh *" name="mesh" desc="" />
         </Function>
+        <Function name="ExportMesh" retType="bool" paramCount="2" desc="Export mesh data to file, returns true on success">
+            <Param type="Mesh" name="mesh" desc="" />
+            <Param type="const char *" name="fileName" desc="" />
+        </Function>
+        <Function name="ExportMeshAsCode" retType="bool" paramCount="2" desc="Export mesh as code file (.h) defining multiple arrays of vertex attributes">
+            <Param type="Mesh" name="mesh" desc="" />
+            <Param type="const char *" name="fileName" desc="" />
+        </Function>
         <Function name="GenMeshPoly" retType="Mesh" paramCount="2" desc="Generate polygonal mesh">
             <Param type="int" name="sides" desc="" />
             <Param type="float" name="radius" desc="" />

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff