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
I would be great if the internal offsets would also be exposed in the generated code as named constants and that these are also actually used by the generated code. This makes things a lot more readable and gives devs the option to also reuse these consts instead of magic numbers:
current
public float3? Vertices(int j) { int o = __p.__offset(4); return o != 0 ? (float3?) (new float3()).__assign(__p.__vector(o) + j * 12, __p.bb) : null; }
public int VerticesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
public int Tris(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int) 0; }
public int TrisLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
proposed
public class TrimeshTable
{
public const int VerticesOffset = 4;
public const int VerticesLen = 12;
public const int TrisOffset = 6;
public const int TrisLen = 4;
}
public float3? Vertices(int j) { int o = __p.__offset(TrimeshTable.VerticesOffset); return o != 0 ? (float3?) (new float3()).__assign(__p.__vector(o) + j * TrimeshTable.VerticesLen, __p.bb) : null; }
public int VerticesLength { get { int o = __p.__offset(TrimeshTable.VerticesOffset); return o != 0 ? __p.__vector_len(o) : 0; } }
public int Tris(int j) { int o = __p.__offset(TrimeshTable.TrisOffset); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * TrimeshTable.TrisLen) : (int) 0; }
public int TrisLength { get { int o = __p.__offset(TrimeshTable.TrisOffset); return o != 0 ? __p.__vector_len(o) : 0; } }
The text was updated successfully, but these errors were encountered:
I would be great if the internal offsets would also be exposed in the generated code as named constants and that these are also actually used by the generated code. This makes things a lot more readable and gives devs the option to also reuse these consts instead of magic numbers:
current
proposed
The text was updated successfully, but these errors were encountered: