Fixed time.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "meshrenderer.h"
|
||||
#include "scene/node.h"
|
||||
#include "time/time.h"
|
||||
|
||||
meshrenderer_t MESH_RENDERER_DATA[ECS_ENTITY_COUNT_MAX] = { 0 };
|
||||
ecscomponent_t MESH_RENDERER_COMPONENT = ecsComponentInit(
|
||||
@@ -20,12 +20,7 @@ ecscomponent_t MESH_RENDERER_COMPONENT = ecsComponentInit(
|
||||
|
||||
void meshRendererDraw(const ecsid_t id) {
|
||||
if(!meshRendererHas(id)) return;
|
||||
|
||||
meshrenderer_t *renderer = &MESH_RENDERER_DATA[id];
|
||||
if(!renderer->mesh) return;
|
||||
|
||||
node_t *node = nodeGet(id);
|
||||
nodeMatrixUpdate(id);
|
||||
|
||||
meshDraw(renderer->mesh, 0, -1);
|
||||
}
|
@@ -8,6 +8,26 @@
|
||||
#include "quad.h"
|
||||
#include "assert/assert.h"
|
||||
|
||||
mesh_t QUAD_MESH_SIMPLE;
|
||||
meshvertex_t QUAD_MESH_SIMPLE_VERTICES[QUAD_VERTEX_COUNT] = {
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } },
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 0.0f }, { 1.0f, 0.0f, 0.0f } },
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f }, { 1.0f, 1.0f, 0.0f } },
|
||||
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } },
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 1.0f, 1.0f }, { 1.0f, 1.0f, 0.0f } },
|
||||
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 0.0f, 1.0f }, { 0.0f, 1.0f, 0.0f } }
|
||||
};
|
||||
|
||||
void quadInit() {
|
||||
meshInit(
|
||||
&QUAD_MESH_SIMPLE,
|
||||
QUAD_PRIMITIVE_TYPE,
|
||||
QUAD_VERTEX_COUNT,
|
||||
QUAD_MESH_SIMPLE_VERTICES
|
||||
);
|
||||
}
|
||||
|
||||
void quadBuffer(
|
||||
meshvertex_t *vertices,
|
||||
const float_t minX,
|
||||
|
@@ -11,6 +11,14 @@
|
||||
#define QUAD_VERTEX_COUNT 6
|
||||
#define QUAD_PRIMITIVE_TYPE MESH_PRIMITIVE_TRIANGLES
|
||||
|
||||
extern mesh_t QUAD_MESH_SIMPLE;
|
||||
extern meshvertex_t QUAD_MESH_SIMPLE_VERTICES[QUAD_VERTEX_COUNT];
|
||||
|
||||
/**
|
||||
* Initializes the quad mesh.
|
||||
*/
|
||||
void quadInit();
|
||||
|
||||
/**
|
||||
* Buffers a quad into the provided vertex array.
|
||||
*
|
||||
|
Reference in New Issue
Block a user