mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-05 22:09:52 +01:00
Fix compilation warnings in testbed
This commit is contained in:
parent
83680d96bb
commit
cf5f95d4e9
@ -60,9 +60,9 @@ double Fun(double x);
|
|||||||
vector<Point*> CreateHeadHole();
|
vector<Point*> CreateHeadHole();
|
||||||
vector<Point*> CreateChestHole();
|
vector<Point*> CreateChestHole();
|
||||||
|
|
||||||
float rotate_y = 0,
|
double rotate_y = 0.0,
|
||||||
rotate_z = 0;
|
rotate_z = 0.0;
|
||||||
const float rotations_per_tick = .2;
|
const double rotations_per_tick = 0.2;
|
||||||
|
|
||||||
/// Screen center x
|
/// Screen center x
|
||||||
double cx = 0.0;
|
double cx = 0.0;
|
||||||
@ -94,7 +94,7 @@ template <class C> void FreeClear( C & cntr ) {
|
|||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
int num_points = 0;
|
size_t num_points = 0u;
|
||||||
double max, min;
|
double max, min;
|
||||||
double zoom;
|
double zoom;
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ void MainLoop(const double zoom)
|
|||||||
|
|
||||||
// calculate time elapsed, and the amount by which stuff rotates
|
// calculate time elapsed, and the amount by which stuff rotates
|
||||||
double current_time = glfwGetTime(),
|
double current_time = glfwGetTime(),
|
||||||
delta_rotate = (current_time - old_time) * rotations_per_tick * 360;
|
delta_rotate = (current_time - old_time) * rotations_per_tick * 360.0;
|
||||||
old_time = current_time;
|
old_time = current_time;
|
||||||
|
|
||||||
// escape to quit, arrow keys to rotate view
|
// escape to quit, arrow keys to rotate view
|
||||||
@ -306,8 +306,8 @@ void ResetZoom(double zoom, double cx, double cy, double width, double height)
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
// Reset ortho view
|
// Reset ortho view
|
||||||
glOrtho(left, right, bottom, top, 1, -1);
|
glOrtho(left, right, bottom, top, 1.0, -1.0);
|
||||||
glTranslatef(-cx, -cy, 0);
|
glTranslated(-cx, -cy, 0.0);
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -333,9 +333,9 @@ void Draw(const double zoom)
|
|||||||
glColor3f(1, 0, 0);
|
glColor3f(1, 0, 0);
|
||||||
|
|
||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
glVertex2f(a.x, a.y);
|
glVertex2d(a.x, a.y);
|
||||||
glVertex2f(b.x, b.y);
|
glVertex2d(b.x, b.y);
|
||||||
glVertex2f(c.x, c.y);
|
glVertex2d(c.x, c.y);
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ void Draw(const double zoom)
|
|||||||
vector<Point*> poly = polylines[i];
|
vector<Point*> poly = polylines[i];
|
||||||
glBegin(GL_LINE_LOOP);
|
glBegin(GL_LINE_LOOP);
|
||||||
for(int j = 0; j < poly.size(); j++) {
|
for(int j = 0; j < poly.size(); j++) {
|
||||||
glVertex2f(poly[j]->x, poly[j]->y);
|
glVertex2d(poly[j]->x, poly[j]->y);
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
@ -368,20 +368,20 @@ void DrawMap(const double zoom)
|
|||||||
|
|
||||||
ConstrainedColor(t.constrained_edge[2]);
|
ConstrainedColor(t.constrained_edge[2]);
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
glVertex2f(a.x, a.y);
|
glVertex2d(a.x, a.y);
|
||||||
glVertex2f(b.x, b.y);
|
glVertex2d(b.x, b.y);
|
||||||
glEnd( );
|
glEnd( );
|
||||||
|
|
||||||
ConstrainedColor(t.constrained_edge[0]);
|
ConstrainedColor(t.constrained_edge[0]);
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
glVertex2f(b.x, b.y);
|
glVertex2d(b.x, b.y);
|
||||||
glVertex2f(c.x, c.y);
|
glVertex2d(c.x, c.y);
|
||||||
glEnd( );
|
glEnd( );
|
||||||
|
|
||||||
ConstrainedColor(t.constrained_edge[1]);
|
ConstrainedColor(t.constrained_edge[1]);
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
glVertex2f(c.x, c.y);
|
glVertex2d(c.x, c.y);
|
||||||
glVertex2f(a.x, a.y);
|
glVertex2d(a.x, a.y);
|
||||||
glEnd( );
|
glEnd( );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user