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

Refactor toplevel section parsing and remove duplicate code #427

Open
wants to merge 3 commits into
base: release
Choose a base branch
from

Commits on Jun 9, 2023

  1. refactor toplevel section parsing

    Introduce a new function ParseSection(…), which handles populating the toplevel GLTF arrays. This removes a bunch of duplicated code. Use a variadic template to facilitate passing additional arguments, that don’t fit the common signature. See Buffer or Mesh.
    
    Refactor object parsing functions (ParseBuffer(), &c.) into a set of overloaded functions ParseObject(…). That way we can invoke them without knowning the actual type.
    
    Pass the TinyGLTF context to the parser functions, so we can actually use it.
    
    To keep the changeset size in check, this deals with all toplevel objects but Image, which is more involved and requires a closer look.
    
    Also, add some getters and fix minor const-correctness issues.
    agnat committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    ea79305 View commit details
    Browse the repository at this point in the history
  2. clean up

    agnat committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    7e313f8 View commit details
    Browse the repository at this point in the history
  3. fix: add missing const

    agnat committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    ff2686f View commit details
    Browse the repository at this point in the history