Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aliases to parser #2444

Merged
merged 7 commits into from
May 1, 2022
Merged

Add aliases to parser #2444

merged 7 commits into from
May 1, 2022

Conversation

lazaray
Copy link
Contributor

@lazaray lazaray commented Apr 26, 2022

This PR fixes some small inconsistencies in the parser and adds support for aliases.

JSON example output:

  "aliases": [
    {
      "type": "Vector4",
      "name": "Quaternion",
      "description": "Quaternion, 4 components (Vector4 alias)"
    },
    {
      "type": "Texture",
      "name": "Texture2D",
      "description": "Texture2D, same as Texture"
    },
    {
      "type": "Texture",
      "name": "TextureCubemap",
      "description": "TextureCubemap, same as Texture"
    },
    {
      "type": "RenderTexture",
      "name": "RenderTexture2D",
      "description": "RenderTexture2D, same as RenderTexture"
    },
    {
      "type": "Camera3D",
      "name": "Camera",
      "description": "Camera type fallback, defaults to Camera3D"
    }
  ],

@RobLoach
Copy link
Contributor

Thanks a lot for adding this 👍

@lazaray
Copy link
Contributor Author

lazaray commented Apr 29, 2022

I've added a fix for fields that share a line, like Matrix.

Matrix now looks like this:

    {
      "name": "Matrix",
      "description": "Matrix, 4x4 components, column major, OpenGL style, right handed",
      "fields": [
        {
          "type": "float",
          "name": "m0",
          "description": "Matrix first row (4 components)"
        },
        {
          "type": "float",
          "name": "m4",
          "description": "Matrix first row (4 components)"
        },
        {
          "type": "float",
          "name": "m8",
          "description": "Matrix first row (4 components)"
        },
        {
          "type": "float",
          "name": "m12",
          "description": "Matrix first row (4 components)"
        },
        {
          "type": "float",
          "name": "m1",
          "description": "Matrix second row (4 components)"
        },
        {
          "type": "float",
          "name": "m5",
          "description": "Matrix second row (4 components)"
        },
        {
          "type": "float",
          "name": "m9",
          "description": "Matrix second row (4 components)"
        },
        {
          "type": "float",
          "name": "m13",
          "description": "Matrix second row (4 components)"
        },
        {
          "type": "float",
          "name": "m2",
          "description": "Matrix third row (4 components)"
        },
        {
          "type": "float",
          "name": "m6",
          "description": "Matrix third row (4 components)"
        },
        {
          "type": "float",
          "name": "m10",
          "description": "Matrix third row (4 components)"
        },
        {
          "type": "float",
          "name": "m14",
          "description": "Matrix third row (4 components)"
        },
        {
          "type": "float",
          "name": "m3",
          "description": "Matrix fourth row (4 components)"
        },
        {
          "type": "float",
          "name": "m7",
          "description": "Matrix fourth row (4 components)"
        },
        {
          "type": "float",
          "name": "m11",
          "description": "Matrix fourth row (4 components)"
        },
        {
          "type": "float",
          "name": "m15",
          "description": "Matrix fourth row (4 components)"
        }
      ]
    },

@lazaray
Copy link
Contributor Author

lazaray commented Apr 29, 2022

Sorry for the force push, I missed one line while manually linting.

@raysan5 raysan5 merged commit 6f044c5 into raysan5:master May 1, 2022
@raysan5
Copy link
Owner

raysan5 commented May 1, 2022

@lazaray Thank you very much for the improvement! :)

@lazaray lazaray deleted the parser-aliases branch May 1, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants