Improve mesh struct after switching to mesh indices.

This commit is contained in:
Roz K 2023-01-04 09:06:13 +01:00
parent 74b6f58794
commit ebc6ededf3
Signed by: roz
GPG Key ID: 51FBF4E483E1C822
2 changed files with 5 additions and 7 deletions

View File

@ -380,8 +380,9 @@ _create_vertices.argtypes = (
ctypes.c_void_p) # meshes
def create_vertices(format, nvertices, vertices, indices, meshes):
assert len(meshes) % 2 == 0
return _create_vertices(format,
nvertices, _ubyte_addr(vertices), len(indices), _ushort_addr(indices), len(meshes), _uint_addr(meshes))
nvertices, _ubyte_addr(vertices), len(indices), _ushort_addr(indices), len(meshes) // 2, _uint_addr(meshes))
create_batch = _engine.rk_create_batch
create_batch.restype = _handle

View File

@ -72,12 +72,9 @@ enum : rk_ubyte { RK_INSTANCE_FLAGS_SPAWNED_VISIBLE = RK_INSTANCE_FLAG_SPAWNED |
enum : rk_uint { RK_BATCH_MAX_SIZE = 65536 };
union rk_mesh {
rk_uint packed;
struct {
rk_ushort base_index;
rk_ushort ntriangles;
};
struct rk_mesh {
rk_uint base_index;
rk_uint ntriangles;
};
RK_EXPORT void rk_render_initialize(