Improve mesh struct after switching to mesh indices.
This commit is contained in:
parent
74b6f58794
commit
ebc6ededf3
@ -380,8 +380,9 @@ _create_vertices.argtypes = (
|
|||||||
ctypes.c_void_p) # meshes
|
ctypes.c_void_p) # meshes
|
||||||
|
|
||||||
def create_vertices(format, nvertices, vertices, indices, meshes):
|
def create_vertices(format, nvertices, vertices, indices, meshes):
|
||||||
|
assert len(meshes) % 2 == 0
|
||||||
return _create_vertices(format,
|
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 = _engine.rk_create_batch
|
||||||
create_batch.restype = _handle
|
create_batch.restype = _handle
|
||||||
|
@ -72,12 +72,9 @@ enum : rk_ubyte { RK_INSTANCE_FLAGS_SPAWNED_VISIBLE = RK_INSTANCE_FLAG_SPAWNED |
|
|||||||
|
|
||||||
enum : rk_uint { RK_BATCH_MAX_SIZE = 65536 };
|
enum : rk_uint { RK_BATCH_MAX_SIZE = 65536 };
|
||||||
|
|
||||||
union rk_mesh {
|
struct rk_mesh {
|
||||||
rk_uint packed;
|
rk_uint base_index;
|
||||||
struct {
|
rk_uint ntriangles;
|
||||||
rk_ushort base_index;
|
|
||||||
rk_ushort ntriangles;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RK_EXPORT void rk_render_initialize(
|
RK_EXPORT void rk_render_initialize(
|
||||||
|
Loading…
Reference in New Issue
Block a user