You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently iterating over palettes is very error prone considering that uint16_t are used as indices, and that its possible that a palette has a material on the last uint16_t value. Thus, VoxelPalette::size() returns the number of materials excluding the empty material (0). We end up having multiple places implementing a weird looking iteration.
Solution
Implement a VoxelPalette::Iterator and use it everywhere which iterates over it, in order to write the cursed logic only once.
The text was updated successfully, but these errors were encountered:
Problem
Currently iterating over palettes is very error prone considering that
uint16_t
are used as indices, and that its possible that a palette has a material on the lastuint16_t
value. Thus,VoxelPalette::size()
returns the number of materials excluding the empty material (0). We end up having multiple places implementing a weird looking iteration.Solution
Implement a
VoxelPalette::Iterator
and use it everywhere which iterates over it, in order to write the cursed logic only once.The text was updated successfully, but these errors were encountered: