From 63d69b2c222d8eba09bd68818f06715bb54d412b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 5 Jan 2012 00:10:08 +0100 Subject: [PATCH] =?UTF-8?q?Refactor=C2=A0:=20Quad::add{Triangle,Quad,Octo}?= =?UTF-8?q?=20=E2=86=92=20addGPU*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rules/batiment/batimentquad.cpp | 2 +- rules/batiment/batimentquadblock.cpp | 2 +- rules/batiment/batimentquadjardin.cpp | 4 +-- rules/batiment/batimentquadmaison.cpp | 16 ++++----- rules/batiment/batimentquadmaisonpont.cpp | 12 +++---- rules/batiment/batimentquadpont.cpp | 26 +++++++------- rules/batiment/batimentquadtoit.cpp | 8 ++--- rules/chose.cpp | 32 ++++++++--------- rules/chose.hh | 10 +++--- rules/quartier/quartierquad.cpp | 4 +-- rules/quartier/quartiertri.cpp | 2 +- rules/route/routequadcarrefour.cpp | 2 +- rules/route/routequadchaussee.cpp | 2 +- rules/route/routetrichaussee.cpp | 2 +- rules/route/trottoirquadnormal.cpp | 44 +++++++++++------------ rules/terrain/terrainquadherbe.cpp | 4 +-- 16 files changed, 86 insertions(+), 86 deletions(-) diff --git a/rules/batiment/batimentquad.cpp b/rules/batiment/batimentquad.cpp index 0183f67..c282b23 100644 --- a/rules/batiment/batimentquad.cpp +++ b/rules/batiment/batimentquad.cpp @@ -48,5 +48,5 @@ void BatimentQuad::triangulation() { int htoit = hashInRange(seed,0,minHeight/2,maxHeight/2); h += htoit; - addOcto(c, c + Vertex(0,0,h), 0xFF, 0xFF, 0x00); + addGPUOcto(c, c + Vertex(0,0,h), 0xFF, 0xFF, 0x00); } diff --git a/rules/batiment/batimentquadblock.cpp b/rules/batiment/batimentquadblock.cpp index 01b9dc1..e5dec12 100644 --- a/rules/batiment/batimentquadblock.cpp +++ b/rules/batiment/batimentquadblock.cpp @@ -10,5 +10,5 @@ void BatimentQuadBlock::getBoundingBoxPoints() { } void BatimentQuadBlock::triangulation() { - addOcto(c, c + Vertex(0,0,height), 0xF1, 0xE0, 0xE0); + addGPUOcto(c, c + Vertex(0,0,height), 0xF1, 0xE0, 0xE0); } diff --git a/rules/batiment/batimentquadjardin.cpp b/rules/batiment/batimentquadjardin.cpp index 58f0a04..1943c8f 100644 --- a/rules/batiment/batimentquadjardin.cpp +++ b/rules/batiment/batimentquadjardin.cpp @@ -12,6 +12,6 @@ void BatimentQuadJardin::getBoundingBoxPoints() { void BatimentQuadJardin::triangulation() { triangles.reserve(2); - addTriangle(new GPUTriangle(c[NE],c[NW],c[SW],0x12,0x64,0x12)); - addTriangle(new GPUTriangle(c[SW],c[SE],c[NE],0x12,0x64,0x12)); + addGPUTriangle(new GPUTriangle(c[NE],c[NW],c[SW],0x12,0x64,0x12)); + addGPUTriangle(new GPUTriangle(c[SW],c[SE],c[NE],0x12,0x64,0x12)); } diff --git a/rules/batiment/batimentquadmaison.cpp b/rules/batiment/batimentquadmaison.cpp index 82f2e5f..103d8e4 100644 --- a/rules/batiment/batimentquadmaison.cpp +++ b/rules/batiment/batimentquadmaison.cpp @@ -18,14 +18,14 @@ void BatimentQuadMaison::triangulation() { Vertex toit = (ch[NE] + ch[SE] + ch[SW] + ch[NW]) / 4 + Vertex(0,0,htoit); // 4 Murs - addQuad(ch[NE],ch[SE],c[SE],c[NE],0xf1,0xe3,0xad); - addQuad(ch[SE],ch[SW],c[SW],c[SE],0xf1,0xe3,0xad); - addQuad(ch[SW],ch[NW],c[NW],c[SW],0xf1,0xe3,0xad); - addQuad(ch[NW],ch[NE],c[NE],c[NW],0xf1,0xe3,0xad); + addGPUQuad(ch[NE],ch[SE],c[SE],c[NE],0xf1,0xe3,0xad); + addGPUQuad(ch[SE],ch[SW],c[SW],c[SE],0xf1,0xe3,0xad); + addGPUQuad(ch[SW],ch[NW],c[NW],c[SW],0xf1,0xe3,0xad); + addGPUQuad(ch[NW],ch[NE],c[NE],c[NW],0xf1,0xe3,0xad); // 1 Toit - addTriangle(new GPUTriangle(ch[NE],toit,ch[SE],0x96,0x16,0x18)); - addTriangle(new GPUTriangle(ch[SE],toit,ch[SW],0x96,0x16,0x18)); - addTriangle(new GPUTriangle(ch[SW],toit,ch[NW],0x96,0x16,0x18)); - addTriangle(new GPUTriangle(ch[NW],toit,ch[NE],0x96,0x16,0x18)); + addGPUTriangle(new GPUTriangle(ch[NE],toit,ch[SE],0x96,0x16,0x18)); + addGPUTriangle(new GPUTriangle(ch[SE],toit,ch[SW],0x96,0x16,0x18)); + addGPUTriangle(new GPUTriangle(ch[SW],toit,ch[NW],0x96,0x16,0x18)); + addGPUTriangle(new GPUTriangle(ch[NW],toit,ch[NE],0x96,0x16,0x18)); } diff --git a/rules/batiment/batimentquadmaisonpont.cpp b/rules/batiment/batimentquadmaisonpont.cpp index 672b61a..f0c840e 100644 --- a/rules/batiment/batimentquadmaisonpont.cpp +++ b/rules/batiment/batimentquadmaisonpont.cpp @@ -41,15 +41,15 @@ void BatimentQuadMaisonPont::triangulation() { Quad q = Quad(c[NE],c[SE],c[SW],c[NW]).makeParallelogram(); Quad qh = q + Vertex(0,0,h); - addQuad(c,0x80,0x80,0x80); - addOcto(q,qh,0xF1,0xE0,0xE0); + addGPUQuad(c,0x80,0x80,0x80); + addGPUOcto(q,qh,0xF1,0xE0,0xE0); Vertex ce = qh[SE] + (qh[NE] - qh[SE])/2 + Vertex(0,0,0.5*height/3.f); Vertex cw = qh[SW] + (qh[NW] - qh[SW])/2 + Vertex(0,0,0.5*height/3.f); - addTriangle(new GPUTriangle(qh[SW],qh[NW],cw,0xF1,0xE0,0xE0)); - addTriangle(new GPUTriangle(qh[NE],qh[SE],ce,0xF1,0xE0,0xE0)); + addGPUTriangle(new GPUTriangle(qh[SW],qh[NW],cw,0xF1,0xE0,0xE0)); + addGPUTriangle(new GPUTriangle(qh[NE],qh[SE],ce,0xF1,0xE0,0xE0)); - addQuad(qh[NE],qh[NW],cw,ce,0xE0,0x20,0x00); - addQuad(qh[SW],qh[SE],ce,cw,0xE0,0x20,0x00); + addGPUQuad(qh[NE],qh[NW],cw,ce,0xE0,0x20,0x00); + addGPUQuad(qh[SW],qh[SE],ce,cw,0xE0,0x20,0x00); } diff --git a/rules/batiment/batimentquadpont.cpp b/rules/batiment/batimentquadpont.cpp index 00e8cf2..bf00f2e 100644 --- a/rules/batiment/batimentquadpont.cpp +++ b/rules/batiment/batimentquadpont.cpp @@ -36,35 +36,35 @@ void BatimentQuadPont::triangulation() { int middle = steps/2; int n; - addTriangle(new GPUTriangle(c[SW],pb,ch[SW],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(pa,c[NW],ch[NW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(c[SW],pb,ch[SW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(pa,c[NW],ch[NW],0xD0,0xD0,0xD0)); for(var=-1.7,n=0; var <= 1.7; var+=pas,n++) { q.offset(W,-n2); a = q.c[3] + Vertex(0,0,nt(var,height)); b = q.c[2] + Vertex(0,0,nt(var,height)); - addQuad(a,b,pb,pa,0xD0,0xD0,0xD0); + addGPUQuad(a,b,pb,pa,0xD0,0xD0,0xD0); if( n < middle) { - addTriangle(new GPUTriangle(pa,a,ch[NW],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(b,pb,ch[SW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(pa,a,ch[NW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(b,pb,ch[SW],0xD0,0xD0,0xD0)); } else if(n == middle) { - addTriangle(new GPUTriangle(pa,a,ch[NW],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(b,pb,ch[SW],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(a,ch[NE],ch[NW],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(b,ch[SW],ch[SE],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(pa,a,ch[NW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(b,pb,ch[SW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(a,ch[NE],ch[NW],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(b,ch[SW],ch[SE],0xD0,0xD0,0xD0)); } else { - addTriangle(new GPUTriangle(pa,a,ch[NE],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(b,pb,ch[SE],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(pa,a,ch[NE],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(b,pb,ch[SE],0xD0,0xD0,0xD0)); } pa = a; pb = b; } - addTriangle(new GPUTriangle(c[SE],pb,ch[SE],0xD0,0xD0,0xD0)); - addTriangle(new GPUTriangle(c[NE],pa,ch[NE],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(c[SE],pb,ch[SE],0xD0,0xD0,0xD0)); + addGPUTriangle(new GPUTriangle(c[NE],pa,ch[NE],0xD0,0xD0,0xD0)); } diff --git a/rules/batiment/batimentquadtoit.cpp b/rules/batiment/batimentquadtoit.cpp index cecdda3..866cb8a 100644 --- a/rules/batiment/batimentquadtoit.cpp +++ b/rules/batiment/batimentquadtoit.cpp @@ -14,9 +14,9 @@ void BatimentQuadToit::triangulation() { Vertex ce = c[SE] + (c[NE] - c[SE])/2 + Vertex(0,0,height/3.); Vertex cw = c[SW] + (c[NW] - c[SW])/2 + Vertex(0,0,height/3.); - addTriangle(new GPUTriangle(c[SW],c[NW],cw,0xF1,0xE0,0xE0)); - addTriangle(new GPUTriangle(c[NE],c[SE],ce,0xF1,0xE0,0xE0)); + addGPUTriangle(new GPUTriangle(c[SW],c[NW],cw,0xF1,0xE0,0xE0)); + addGPUTriangle(new GPUTriangle(c[NE],c[SE],ce,0xF1,0xE0,0xE0)); - addQuad(c[NE],c[NW],cw,ce,0xE0,0x20,0x00); - addQuad(c[SW],c[SE],ce,cw,0xE0,0x20,0x00); + addGPUQuad(c[NE],c[NW],cw,ce,0xE0,0x20,0x00); + addGPUQuad(c[SW],c[SE],ce,cw,0xE0,0x20,0x00); } diff --git a/rules/chose.cpp b/rules/chose.cpp index 792bef8..e2591c8 100644 --- a/rules/chose.cpp +++ b/rules/chose.cpp @@ -13,7 +13,7 @@ void Chose::addChild(Chose* c) { children.push_back(c); } -void Chose::addTriangle(GPUTriangle* t) { +void Chose::addGPUTriangle(GPUTriangle* t) { triangles.push_back(t); } @@ -23,27 +23,27 @@ bool Chose::merge() { return true; } -void Chose::addQuad(Vertex u, Vertex v, Vertex w, Vertex x, char r, char g, char b) { - this->addTriangle(new GPUTriangle(u,x,w,r,g,b)); - this->addTriangle(new GPUTriangle(w,v,u,r,g,b)); +void Chose::addGPUQuad(Vertex u, Vertex v, Vertex w, Vertex x, char r, char g, char b) { + this->addGPUTriangle(new GPUTriangle(u,x,w,r,g,b)); + this->addGPUTriangle(new GPUTriangle(w,v,u,r,g,b)); } -void Chose::addQuad(Quad q, char r, char g, char b) { - addQuad(q[NE], q[SE], q[SW], q[NW], r, g, b); +void Chose::addGPUQuad(Quad q, char r, char g, char b) { + addGPUQuad(q[NE], q[SE], q[SW], q[NW], r, g, b); } -void Chose::addOcto(Vertex a, Vertex b, Vertex c, Vertex d, +void Chose::addGPUOcto(Vertex a, Vertex b, Vertex c, Vertex d, Vertex e, Vertex f, Vertex g, Vertex h, char red, char green, char blue) { - this->addQuad(a,b,c,d,red,green,blue); - this->addQuad(e,f,g,h,red,green,blue); - this->addQuad(b,a,e,f,red,green,blue); - this->addQuad(c,b,f,g,red,green,blue); - this->addQuad(d,c,g,h,red,green,blue); - this->addQuad(a,d,h,e,red,green,blue); + this->addGPUQuad(a,b,c,d,red,green,blue); + this->addGPUQuad(e,f,g,h,red,green,blue); + this->addGPUQuad(b,a,e,f,red,green,blue); + this->addGPUQuad(c,b,f,g,red,green,blue); + this->addGPUQuad(d,c,g,h,red,green,blue); + this->addGPUQuad(a,d,h,e,red,green,blue); } -void Chose::addOcto(Quad q1, Quad q2, char red, char green, char blue) { - addOcto(q1[NE], q1[SE], q1[SW], q1[NW], q2[NE], q2[SE], q2[SW], q2[NW], red, green, blue); +void Chose::addGPUOcto(Quad q1, Quad q2, char red, char green, char blue) { + addGPUOcto(q1[NE], q1[SE], q1[SW], q1[NW], q2[NE], q2[SE], q2[SW], q2[NW], red, green, blue); } void Chose::display() { @@ -113,7 +113,7 @@ void Chose::updateAABB() { // DEBUG void Chose::drawAABB() { - addOcto( + addGPUOcto( Vertex(lod.splitBox[0], lod.splitBox[2], lod.splitBox[4]), Vertex(lod.splitBox[1], lod.splitBox[2], lod.splitBox[4]), Vertex(lod.splitBox[1], lod.splitBox[3], lod.splitBox[4]), diff --git a/rules/chose.hh b/rules/chose.hh index caa5e41..c8445b8 100644 --- a/rules/chose.hh +++ b/rules/chose.hh @@ -58,11 +58,11 @@ class Chose { addEntropy(t[LEFT], t[TOP], t[RIGHT]); } void addChild(Chose* c); - void addTriangle(GPUTriangle* t); - void addQuad(Vertex u, Vertex v, Vertex w, Vertex x, char r, char g, char b); - void addQuad(Quad q, char r, char g, char b); - void addOcto(Vertex a,Vertex b,Vertex c,Vertex d,Vertex e,Vertex f,Vertex g,Vertex h,char red,char green,char blue); - void addOcto(Quad q1, Quad q2, char red, char green, char blue); + void addGPUTriangle(GPUTriangle* t); + void addGPUQuad(Vertex u, Vertex v, Vertex w, Vertex x, char r, char g, char b); + void addGPUQuad(Quad q, char r, char g, char b); + void addGPUOcto(Vertex a,Vertex b,Vertex c,Vertex d,Vertex e,Vertex f,Vertex g,Vertex h,char red,char green,char blue); + void addGPUOcto(Quad q1, Quad q2, char red, char green, char blue); }; #endif diff --git a/rules/quartier/quartierquad.cpp b/rules/quartier/quartierquad.cpp index f39e4b7..a3cfcfb 100644 --- a/rules/quartier/quartierquad.cpp +++ b/rules/quartier/quartierquad.cpp @@ -40,6 +40,6 @@ bool QuartierQuad::split() { void QuartierQuad::triangulation() { triangles.reserve(2); - addTriangle(new GPUTriangle(c[NE], c[NW], c[SW], 0xc0, 0xc0, 0xc0)); - addTriangle(new GPUTriangle(c[SW], c[SE], c[NE], 0xc0, 0xc0, 0xc0)); + addGPUTriangle(new GPUTriangle(c[NE], c[NW], c[SW], 0xc0, 0xc0, 0xc0)); + addGPUTriangle(new GPUTriangle(c[SW], c[SE], c[NE], 0xc0, 0xc0, 0xc0)); } diff --git a/rules/quartier/quartiertri.cpp b/rules/quartier/quartiertri.cpp index 65b2d7f..097b743 100644 --- a/rules/quartier/quartiertri.cpp +++ b/rules/quartier/quartiertri.cpp @@ -22,5 +22,5 @@ bool QuartierTri::split() { void QuartierTri::triangulation() { triangles.reserve(1); - addTriangle(new GPUTriangle(c[LEFT], c[TOP], c[RIGHT], 0xf0, 0xc0, 0xc0)); + addGPUTriangle(new GPUTriangle(c[LEFT], c[TOP], c[RIGHT], 0xf0, 0xc0, 0xc0)); } diff --git a/rules/route/routequadcarrefour.cpp b/rules/route/routequadcarrefour.cpp index 0fc8663..4596bd8 100644 --- a/rules/route/routequadcarrefour.cpp +++ b/rules/route/routequadcarrefour.cpp @@ -10,5 +10,5 @@ void RouteQuadCarrefour::getBoundingBoxPoints() { } void RouteQuadCarrefour::triangulation() { - addQuad(c, 0x36, 0x36, 0x36); + addGPUQuad(c, 0x36, 0x36, 0x36); } diff --git a/rules/route/routequadchaussee.cpp b/rules/route/routequadchaussee.cpp index c9667a9..9f176dd 100644 --- a/rules/route/routequadchaussee.cpp +++ b/rules/route/routequadchaussee.cpp @@ -10,5 +10,5 @@ void RouteQuadChaussee::getBoundingBoxPoints() { } void RouteQuadChaussee::triangulation() { - addQuad(c, 0x36, 0x36, 0x36); + addGPUQuad(c, 0x36, 0x36, 0x36); } diff --git a/rules/route/routetrichaussee.cpp b/rules/route/routetrichaussee.cpp index 2648641..f2bf36c 100644 --- a/rules/route/routetrichaussee.cpp +++ b/rules/route/routetrichaussee.cpp @@ -10,5 +10,5 @@ void RouteTriChaussee::getBoundingBoxPoints() { } void RouteTriChaussee::triangulation() { - addTriangle(new GPUTriangle(c[LEFT], c[TOP], c[RIGHT], 0x36, 0x36, 0x36)); + addGPUTriangle(new GPUTriangle(c[LEFT], c[TOP], c[RIGHT], 0x36, 0x36, 0x36)); } diff --git a/rules/route/trottoirquadnormal.cpp b/rules/route/trottoirquadnormal.cpp index bd941f1..37b13da 100644 --- a/rules/route/trottoirquadnormal.cpp +++ b/rules/route/trottoirquadnormal.cpp @@ -14,32 +14,32 @@ void TrottoirQuadNormal::triangulation() { if(border == E) { q.offset(E,-15); - addTriangle(new GPUTriangle(q.c[0] + h, q.c[3] + h, q.c[2] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(q.c[2] + h, q.c[1] + h, q.c[0] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NE] + h, q.c[0] + h, q.c[1] + h, 0xAA, 0xAA, 0xAA)); - addTriangle(new GPUTriangle(q.c[1] + h, c[SE] + h, c[NE] + h, 0xAA, 0xAA, 0xAA)); + addGPUTriangle(new GPUTriangle(q.c[0] + h, q.c[3] + h, q.c[2] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(q.c[2] + h, q.c[1] + h, q.c[0] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NE] + h, q.c[0] + h, q.c[1] + h, 0xAA, 0xAA, 0xAA)); + addGPUTriangle(new GPUTriangle(q.c[1] + h, c[SE] + h, c[NE] + h, 0xAA, 0xAA, 0xAA)); - addTriangle(new GPUTriangle(c[NW] + h, c[NW], c[SW], 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SW], c[SW] + h, c[NW] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NE], c[NE] + h, c[SE] + h, 0xAA, 0xAA, 0xAA)); - addTriangle(new GPUTriangle(c[SE] + h, c[SE], c[NE], 0xAA, 0xAA, 0xAA)); + addGPUTriangle(new GPUTriangle(c[NW] + h, c[NW], c[SW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SW], c[SW] + h, c[NW] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NE], c[NE] + h, c[SE] + h, 0xAA, 0xAA, 0xAA)); + addGPUTriangle(new GPUTriangle(c[SE] + h, c[SE], c[NE], 0xAA, 0xAA, 0xAA)); - addTriangle(new GPUTriangle(c[NE] + h, c[NE], c[NW], 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NW], c[NW] + h, c[NE] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SW], c[SW] + h, c[SE] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SE] + h, c[SE], c[SW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NE] + h, c[NE], c[NW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NW], c[NW] + h, c[NE] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SW], c[SW] + h, c[SE] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SE] + h, c[SE], c[SW], 0x66, 0x66, 0x66)); } else { - addTriangle(new GPUTriangle(q.c[0] + h, q.c[3] + h, q.c[2] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(q.c[2] + h, q.c[1] + h, q.c[0] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(q.c[0] + h, q.c[3] + h, q.c[2] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(q.c[2] + h, q.c[1] + h, q.c[0] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NW] + h, c[NW], c[SW], 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SW], c[SW] + h, c[NW] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NE], c[NE] + h, c[SE] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SE] + h, c[SE], c[NE], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NW] + h, c[NW], c[SW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SW], c[SW] + h, c[NW] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NE], c[NE] + h, c[SE] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SE] + h, c[SE], c[NE], 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NE] + h, c[NE], c[NW], 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[NW], c[NW] + h, c[NE] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SW], c[SW] + h, c[SE] + h, 0x66, 0x66, 0x66)); - addTriangle(new GPUTriangle(c[SE] + h, c[SE], c[SW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NE] + h, c[NE], c[NW], 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[NW], c[NW] + h, c[NE] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SW], c[SW] + h, c[SE] + h, 0x66, 0x66, 0x66)); + addGPUTriangle(new GPUTriangle(c[SE] + h, c[SE], c[SW], 0x66, 0x66, 0x66)); } } diff --git a/rules/terrain/terrainquadherbe.cpp b/rules/terrain/terrainquadherbe.cpp index 2bd987e..46d858e 100644 --- a/rules/terrain/terrainquadherbe.cpp +++ b/rules/terrain/terrainquadherbe.cpp @@ -11,6 +11,6 @@ void TerrainQuadHerbe::getBoundingBoxPoints() { void TerrainQuadHerbe::triangulation() { triangles.reserve(2); - addTriangle(new GPUTriangle(c[NE], c[NW], c[SW], 0x11, 0xaa, 0x22)); - addTriangle(new GPUTriangle(c[SW], c[SE], c[NE], 0x11, 0xaa, 0x22)); + addGPUTriangle(new GPUTriangle(c[NE], c[NW], c[SW], 0x11, 0xaa, 0x22)); + addGPUTriangle(new GPUTriangle(c[SW], c[SE], c[NE], 0x11, 0xaa, 0x22)); }