aboutsummaryrefslogtreecommitdiff
path: root/drivers/convex_decomp
diff options
context:
space:
mode:
authorRémi Verschelde2017-01-14 12:26:56 +0100
committerRémi Verschelde2017-01-14 14:52:23 +0100
commit93ab45b6b5c4f8e0619e963156c983009d399a9d (patch)
tree80e55993f29ad7bf502ef7388eef78114b2dc4ab /drivers/convex_decomp
parent78e90ac60b81f17fdf8c319357f16962e92e6106 (diff)
downloadgodot-93ab45b6b5c4f8e0619e963156c983009d399a9d.tar.gz
godot-93ab45b6b5c4f8e0619e963156c983009d399a9d.tar.zst
godot-93ab45b6b5c4f8e0619e963156c983009d399a9d.zip
Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part with the rest of the code block, thus producing badly indented commented code.
Diffstat (limited to 'drivers/convex_decomp')
-rw-r--r--drivers/convex_decomp/b2Glue.h12
-rw-r--r--drivers/convex_decomp/b2Polygon.cpp18
-rw-r--r--drivers/convex_decomp/b2Polygon.h8
-rw-r--r--drivers/convex_decomp/b2d_decompose.cpp2
4 files changed, 22 insertions, 18 deletions
diff --git a/drivers/convex_decomp/b2Glue.h b/drivers/convex_decomp/b2Glue.h
index 7ec6d7f18..425486356 100644
--- a/drivers/convex_decomp/b2Glue.h
+++ b/drivers/convex_decomp/b2Glue.h
@@ -134,11 +134,13 @@ struct b2Vec2
return length;
}
- ///// Does this vector contain finite coordinates?
- //bool IsValid() const
- //{
- // return b2IsValid(x) && b2IsValid(y);
- //}
+ /*
+ /// Does this vector contain finite coordinates?
+ bool IsValid() const
+ {
+ return b2IsValid(x) && b2IsValid(y);
+ }
+ */
float32 x, y;
};
diff --git a/drivers/convex_decomp/b2Polygon.cpp b/drivers/convex_decomp/b2Polygon.cpp
index 73955d357..f45d98250 100644
--- a/drivers/convex_decomp/b2Polygon.cpp
+++ b/drivers/convex_decomp/b2Polygon.cpp
@@ -189,7 +189,7 @@ void b2Polygon::MergeParallelEdges(float32 tolerance) {
x = newx;
y = newy;
nVertices = newNVertices;
-// printf("%d \n", newNVertices);
+ //printf("%d \n", newNVertices);
}
/*
@@ -436,7 +436,6 @@ bool b2Polygon::IsSimple() {
* For internal use.
*/
b2Polygon* b2Polygon::Add(b2Triangle& t) {
-// float32 equalTol = .001f;
// First, find vertices that connect
int32 firstP = -1;
int32 firstT = -1;
@@ -963,7 +962,7 @@ int32 DecomposeConvex(b2Polygon* p, b2Polygon* results, int32 maxPolys) {
tempP.Set(*p);
ReversePolygon(tempP.x, tempP.y, tempP.nVertices);
nTri = TriangulatePolygon(tempP.x, tempP.y, tempP.nVertices, triangulated);
-// ReversePolygon(p->x, p->y, p->nVertices); //reset orientation
+ //ReversePolygon(p->x, p->y, p->nVertices); //reset orientation
} else {
//printf("It is not ccw \n");
nTri = TriangulatePolygon(p->x, p->y, p->nVertices, triangulated);
@@ -997,7 +996,7 @@ void DecomposeConvexAndAddTo(b2Polygon* p, b2Body* bd, b2FixtureDef* prototype)
if (p->nVertices < 3) return;
b2Polygon* decomposed = new b2Polygon[p->nVertices - 2]; //maximum number of polys
int32 nPolys = DecomposeConvex(p, decomposed, p->nVertices - 2);
-// printf("npolys: %d",nPolys);
+ //printf("npolys: %d",nPolys);
b2FixtureDef* pdarray = new b2FixtureDef[2*p->nVertices];//extra space in case of splits
int32 extra = 0;
for (int32 i = 0; i < nPolys; ++i) {
@@ -1362,14 +1361,15 @@ b2Polygon TraceEdge(b2Polygon* p){
//printf("knode %d on node %d now has %d connections\n",k,j,knode->nConnected);
//printf("Found duplicate point.\n");
}
- //printf("Orphaning node at address %d\n",(int)jnode);
- //for (int32 k=0; k<njConn; ++k) {
- // if (jnode->connected[k]->IsConnectedTo(*jnode)) printf("Problem!!!\n");
- //}
/*
+ printf("Orphaning node at address %d\n",(int)jnode);
+ for (int32 k=0; k<njConn; ++k) {
+ if (jnode->connected[k]->IsConnectedTo(*jnode)) printf("Problem!!!\n");
+ }
for (int32 k=0; k < njConn; ++k){
jnode->RemoveConnectionByIndex(k);
- }*/
+ }
+ */
jnode->nConnected = 0;
}
}
diff --git a/drivers/convex_decomp/b2Polygon.h b/drivers/convex_decomp/b2Polygon.h
index 36af2fd9d..c466e28f7 100644
--- a/drivers/convex_decomp/b2Polygon.h
+++ b/drivers/convex_decomp/b2Polygon.h
@@ -74,9 +74,11 @@ public:
void print(){
printFormatted();
-// for (int32 i=0; i<nVertices; ++i){
-// printf("i: %d, x:%f, y:%f\n",i,x[i],y[i]);
-// }
+ /*
+ for (int32 i=0; i<nVertices; ++i){
+ printf("i: %d, x:%f, y:%f\n",i,x[i],y[i]);
+ }
+ */
}
void printFormatted(){
diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp
index 82eade5b6..f84faaf58 100644
--- a/drivers/convex_decomp/b2d_decompose.cpp
+++ b/drivers/convex_decomp/b2d_decompose.cpp
@@ -144,7 +144,7 @@ static Vector< Vector<Vector2> > _b2d_decompose(const Vector<Vector2>& p_polygon
Skip:
;
}
-// delete[] pdarray;
+ //delete[] pdarray;
delete[] decomposed;
delete p;
return res;// pdarray; //needs to be deleted after body is created