-fixed emscripten compilation

This commit is contained in:
Mergul 2021-01-03 13:08:29 +01:00
parent 3c1c67efd0
commit 84ba5f9eb5
6 changed files with 36 additions and 71 deletions

View file

@ -187,6 +187,20 @@ struct Renderer
}
}
struct DrawData
{
Texture texture;
vec2 position;
vec2 size;
vec4 coords;
short depth = 0;
uint color = uint.max;
float angle = 0;
uint material_id = 0;
uint mesh_id = 0;
uint thread_id = 0;
}
struct Thread
{
//Vector!VertexBlock block;
@ -430,20 +444,6 @@ struct Renderer
}
struct DrawData
{
Texture texture;
vec2 position;
vec2 size;
vec4 coords;
short depth = 0;
uint color = uint.max;
float angle = 0;
uint material_id = 0;
uint mesh_id = 0;
uint thread_id = 0;
}
//void draw(Texture tex, vec2 pos, vec2 size, vec4 coords, short depth = 0, uint color = uint.max, float angle = 0, uint material_id = 0, uint mesh_id = 0, uint thread_id = 0)
void draw(scope ref const(DrawData) data)
{
@ -570,7 +570,7 @@ struct Renderer
memcpy(ptr+16,pos.data.ptr,8);
memcpy(ptr+32,coords.data.ptr,16);*/
short[] verts = cast(short[])block.batch_vertices;
short[] verts = (cast(short*)block.batch_vertices.ptr)[0..block.batch_vertices.length>>1];
uint item_id = block.items;
uint mesh_id = data.mesh_id;