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

Replace the attribute_offset field #49

Closed
io7m opened this Issue Jun 18, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@io7m
Owner

io7m commented Jun 18, 2017

Right now, we have this:

[record SMFBv1_0Header
  ([field schema                   SMFBv1SchemaID]
   [field vertex_count             [integer unsigned 64]]
   [field triangle_count           [integer unsigned 64]]
   [field triangle_index_size_bits [integer unsigned 32]]
   [field attribute_count          [integer unsigned 32]]
   [field attribute_offset         [integer unsigned 32]]
   [field coordinate_system        SMFBv1CoordinateSystems]
   [padding-octets                 2])]

Ostensibly, the attribute_offset field is used to allow code to skip over any fields introduced in future versions of the spec in order to get to the attribute declarations. However, there may in the future need to be more fields like this, and serializers/parsers will end up having to juggle multiple offset fields. Instead, do this:

[record SMFBv1_0Header
  ([field fields_size              [integer unsigned 32]]
   [field schema                   SMFBv1SchemaID]
   [field vertex_count             [integer unsigned 64]]
   [field triangle_count           [integer unsigned 64]]
   [field triangle_index_size_bits [integer unsigned 32]]
   [field attribute_count          [integer unsigned 32]]
   [field coordinate_system        SMFBv1CoordinateSystems]
   [padding-octets                 2])]

The size of the fields are declared up front.

@io7m io7m added the specification label Jun 18, 2017

@io7m io7m self-assigned this Jun 18, 2017

@io7m io7m added this to the 0.13.0 milestone Jun 18, 2017

@io7m io7m closed this in a792f93 Jun 18, 2017

io7m added a commit that referenced this issue Jun 18, 2017

Merge branch 'release/0.13.0'
Release: com.io7m.smfj 0.13.0
Code change: Replace the attribute_offset field. (tickets: #49)

io7m added a commit that referenced this issue Jun 18, 2017

Merge tag 'com.io7m.smf-0.13.0' into develop
Release: com.io7m.smfj 0.13.0

Code change: Replace the attribute_offset field. (tickets: #49)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment