mirror of https://github.com/axmolengine/axmol.git
More renderer optimizations
This commit is contained in:
parent
f6ad3a9971
commit
3b20ad5ab7
|
@ -50,9 +50,10 @@ public:
|
|||
virtual int64_t generateID() = 0;
|
||||
|
||||
/** Get Render Command Id */
|
||||
virtual inline int64_t getID() { return _id; }
|
||||
|
||||
virtual inline Type getType() { return _type; }
|
||||
inline int64_t getID() { return _id; }
|
||||
|
||||
/** Returns the Command type */
|
||||
inline Type getType() { return _type; }
|
||||
|
||||
protected:
|
||||
RenderCommand();
|
||||
|
|
|
@ -333,41 +333,17 @@ void Renderer::convertToWorldCoordiantes(V3F_C4B_T2F_Quad* quads, ssize_t quanti
|
|||
for(ssize_t i=0; i<quantity; ++i) {
|
||||
V3F_C4B_T2F_Quad *q = &quads[i];
|
||||
|
||||
kmVec3 vec1, out1;
|
||||
vec1.x = q->bl.vertices.x;
|
||||
vec1.y = q->bl.vertices.y;
|
||||
vec1.z = q->bl.vertices.z;
|
||||
kmVec3Transform(&out1, &vec1, &modelView);
|
||||
q->bl.vertices.x = out1.x;
|
||||
q->bl.vertices.y = out1.y;
|
||||
q->bl.vertices.z = out1.z;
|
||||
kmVec3 *vec1 = (kmVec3*)&q->bl.vertices;
|
||||
kmVec3Transform(vec1, vec1, &modelView);
|
||||
|
||||
kmVec3 vec2, out2;
|
||||
vec2.x = q->br.vertices.x;
|
||||
vec2.y = q->br.vertices.y;
|
||||
vec2.z = q->br.vertices.z;
|
||||
kmVec3Transform(&out2, &vec2, &modelView);
|
||||
q->br.vertices.x = out2.x;
|
||||
q->br.vertices.y = out2.y;
|
||||
q->br.vertices.z = out2.z;
|
||||
kmVec3 *vec2 = (kmVec3*)&q->br.vertices;
|
||||
kmVec3Transform(vec2, vec2, &modelView);
|
||||
|
||||
kmVec3 vec3, out3;
|
||||
vec3.x = q->tr.vertices.x;
|
||||
vec3.y = q->tr.vertices.y;
|
||||
vec3.z = q->tr.vertices.z;
|
||||
kmVec3Transform(&out3, &vec3, &modelView);
|
||||
q->tr.vertices.x = out3.x;
|
||||
q->tr.vertices.y = out3.y;
|
||||
q->tr.vertices.z = out3.z;
|
||||
kmVec3 *vec3 = (kmVec3*)&q->tr.vertices;
|
||||
kmVec3Transform(vec3, vec3, &modelView);
|
||||
|
||||
kmVec3 vec4, out4;
|
||||
vec4.x = q->tl.vertices.x;
|
||||
vec4.y = q->tl.vertices.y;
|
||||
vec4.z = q->tl.vertices.z;
|
||||
kmVec3Transform(&out4, &vec4, &modelView);
|
||||
q->tl.vertices.x = out4.x;
|
||||
q->tl.vertices.y = out4.y;
|
||||
q->tl.vertices.z = out4.z;
|
||||
kmVec3 *vec4 = (kmVec3*)&q->tl.vertices;
|
||||
kmVec3Transform(vec4, vec4, &modelView);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue