Most of the calculations with this and uses of it are with doubles. So making it
a double as well avoids losing intermediate precision. Squashes 5
-Wfloat-conversion warnings.
//convert degrees into radians
float degInRad = (float) (i * DEG2RAD);
glVertex3f((GLfloat) (x + cos(degInRad) * xradius),
- (GLfloat) (y + sin(degInRad) * yradius), view->Topview->global_z);
+ (GLfloat) (y + sin(degInRad) * yradius), (GLfloat)view->Topview->global_z);
}
glEnd();
}
for (size_t i = 0; i < op->u.polyline.cnt; ++i) {
glVertex3f((GLfloat) op->u.polyline.pts[i].x - dx,
(GLfloat) op->u.polyline.pts[i].y - dy,
- (GLfloat) op->u.polyline.pts[i].z + view->Topview->global_z);
+ (GLfloat)(op->u.polyline.pts[i].z + view->Topview->global_z));
}
glEnd();
}
float degInRad = (float) (i * DEG2RAD);
glVertex3f((GLfloat) (x + cos(degInRad) * radius),
(GLfloat) (y + sin(degInRad) * radius),
- (GLfloat) zdepth + view->Topview->global_z);
+ (GLfloat)(zdepth + view->Topview->global_z));
}
glEnd();
float minedgelen;
float fitin_zoom;
xdot* xDot;
- float global_z;
+ double global_z;
attr_list* attributes;/*attribute list*/
topviewcache cache;
view->bdyBottom = bottom;
}
-static void draw_xdot(xdot* x,float base_z)
+static void draw_xdot(xdot* x, double base_z)
{
sdot_op *op;
if (!x)
x=parseXdotwithattrs(g);
if (x) {
- draw_xdot(x,-0.2f);
+ draw_xdot(x, -0.2);
freeXDot (x);
}
for (v = agfstnode(g); v; v = agnxtnode(g, v))
if(!object_color(v,&c))
continue;
x=parseXdotwithattrs(v);
- draw_xdot(x,-0.1f);
+ draw_xdot(x, -0.1);
if(x)
freeXDot (x);
}
/*texture base 3d text rendering*/
-void glCompDrawText3D(glCompFont * f,GLfloat x,GLfloat y,GLfloat z,GLfloat w,GLfloat h)
-{
+void glCompDrawText3D(glCompFont *f, GLfloat x, GLfloat y, double z, GLfloat w,
+ GLfloat h) {
glEnable(GL_BLEND); // Turn Blending On
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
void glDeleteFont(glCompFont * f);
void glCompDrawText(glCompFont * f,GLfloat x,GLfloat y);
void glCompRenderText(glCompFont * f, glCompObj * parentObj);
- void glCompDrawText3D(glCompFont * f,GLfloat x,GLfloat y,GLfloat z,GLfloat w,GLfloat h);
+ void glCompDrawText3D(glCompFont *f, GLfloat x, GLfloat y, double z,
+ GLfloat w, GLfloat h);
#ifdef __cplusplus
}