Add annotations for length of a given array in mj* structs

This PR added necessary annotations, following what we did for mjData
and mjModel for length of the given array.

This is useful because my parser used to generate Swift interface:
https://github.com/liuliu/swift-mujoco/blob/main/Sources/codegen/main.swift#L297
such that the access to underlying array is bound-checked.

Please let me know if this makes sense. After this change, I can
successfully generate all mj* struct interfaces in Swift without problem
(with notable exception of mjui): https://github.com/liuliu/swift-mujoco/tree/main/Sources
This commit is contained in:
Liu Liu
2022-05-21 19:08:21 -04:00
parent 89d95ad3c7
commit f0bb7467a3
2 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -108,7 +108,7 @@ struct mjrContext_ { // custom OpenGL context
// texture objects and info
int ntexture; // number of allocated textures
int textureType[100]; // type of texture (mjtTexture)
int textureType[100]; // type of texture (mjtTexture) (ntexture)
unsigned int texture[100]; // texture names
// displaylist starting positions
@@ -129,10 +129,10 @@ struct mjrContext_ { // custom OpenGL context
// skin VBOs
int nskin; // number of skins
unsigned int* skinvertVBO; // skin vertex position VBOs
unsigned int* skinnormalVBO; // skin vertex normal VBOs
unsigned int* skintexcoordVBO; // skin vertex texture coordinate VBOs
unsigned int* skinfaceVBO; // skin face index VBOs
unsigned int* skinvertVBO; // skin vertex position VBOs (nskin)
unsigned int* skinnormalVBO; // skin vertex normal VBOs (nskin)
unsigned int* skintexcoordVBO; // skin vertex texture coordinate VBOs (nskin)
unsigned int* skinfaceVBO; // skin face index VBOs (nskin)
// character info
int charWidth[127]; // character widths: normal and shadow