From: Ryan C. Gordon Date: Wed, 19 Aug 2009 03:09:39 +0000 (-0400) Subject: Patched to compile on newer gcc. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=b5f9f90139d115ea7453ac298bb72a4c51724bd5;p=lugaru.git Patched to compile on newer gcc. --- diff --git a/Source/Objects.cpp b/Source/Objects.cpp index cc6008b..9bf8397 100644 --- a/Source/Objects.cpp +++ b/Source/Objects.cpp @@ -97,26 +97,26 @@ void Objects::Draw() if(type[i]==bushtype){ messedwith[i]-=multiplier; if(rotxvel[i]||rotx[i]){ - if(rotx[i]>0)rotxvel[i]-=multiplier*8*abs(rotx[i]); - if(rotx[i]<0)rotxvel[i]+=multiplier*8*abs(rotx[i]); + if(rotx[i]>0)rotxvel[i]-=multiplier*8*fabs(rotx[i]); + if(rotx[i]<0)rotxvel[i]+=multiplier*8*fabs(rotx[i]); if(rotx[i]>0)rotxvel[i]-=multiplier*4; if(rotx[i]<0)rotxvel[i]+=multiplier*4; if(rotxvel[i]>0)rotxvel[i]-=multiplier*4; if(rotxvel[i]<0)rotxvel[i]+=multiplier*4; - if(abs(rotx[i])0)rotyvel[i]-=multiplier*8*abs(roty[i]); - if(roty[i]<0)rotyvel[i]+=multiplier*8*abs(roty[i]); + if(roty[i]>0)rotyvel[i]-=multiplier*8*fabs(roty[i]); + if(roty[i]<0)rotyvel[i]+=multiplier*8*fabs(roty[i]); if(roty[i]>0)rotyvel[i]-=multiplier*4; if(roty[i]<0)rotyvel[i]+=multiplier*4; if(rotyvel[i]>0)rotyvel[i]-=multiplier*4; if(rotyvel[i]<0)rotyvel[i]+=multiplier*4; - if(abs(roty[i])0)rotxvel[i]-=multiplier*8*abs(rotx[i]); - if(rotx[i]<0)rotxvel[i]+=multiplier*8*abs(rotx[i]); + if(rotx[i]>0)rotxvel[i]-=multiplier*8*fabs(rotx[i]); + if(rotx[i]<0)rotxvel[i]+=multiplier*8*fabs(rotx[i]); if(rotx[i]>0)rotxvel[i]-=multiplier*4; if(rotx[i]<0)rotxvel[i]+=multiplier*4; if(rotxvel[i]>0)rotxvel[i]-=multiplier*4; if(rotxvel[i]<0)rotxvel[i]+=multiplier*4; - if(abs(rotx[i])0)rotyvel[i]-=multiplier*8*abs(roty[i]); - if(roty[i]<0)rotyvel[i]+=multiplier*8*abs(roty[i]); + if(roty[i]>0)rotyvel[i]-=multiplier*8*fabs(roty[i]); + if(roty[i]<0)rotyvel[i]+=multiplier*8*fabs(roty[i]); if(roty[i]>0)rotyvel[i]-=multiplier*4; if(roty[i]<0)rotyvel[i]+=multiplier*4; if(rotyvel[i]>0)rotyvel[i]-=multiplier*4; if(rotyvel[i]<0)rotyvel[i]+=multiplier*4; - if(abs(roty[i])0)rotxvel[i]-=multiplier*8*abs(rotx[i]); - if(rotx[i]<0)rotxvel[i]+=multiplier*8*abs(rotx[i]); + if(rotx[i]>0)rotxvel[i]-=multiplier*8*fabs(rotx[i]); + if(rotx[i]<0)rotxvel[i]+=multiplier*8*fabs(rotx[i]); if(rotx[i]>0)rotxvel[i]-=multiplier*4; if(rotx[i]<0)rotxvel[i]+=multiplier*4; if(rotxvel[i]>0)rotxvel[i]-=multiplier*4; if(rotxvel[i]<0)rotxvel[i]+=multiplier*4; - if(abs(rotx[i])0)rotyvel[i]-=multiplier*8*abs(roty[i]); - if(roty[i]<0)rotyvel[i]+=multiplier*8*abs(roty[i]); + if(roty[i]>0)rotyvel[i]-=multiplier*8*fabs(roty[i]); + if(roty[i]<0)rotyvel[i]+=multiplier*8*fabs(roty[i]); if(roty[i]>0)rotyvel[i]-=multiplier*4; if(roty[i]<0)rotyvel[i]+=multiplier*4; if(rotyvel[i]>0)rotyvel[i]-=multiplier*4; if(rotyvel[i]<0)rotyvel[i]+=multiplier*4; - if(abs(roty[i])0)rotxvel[i]-=multiplier*8*abs(rotx[i]); - if(rotx[i]<0)rotxvel[i]+=multiplier*8*abs(rotx[i]); + if(rotx[i]>0)rotxvel[i]-=multiplier*8*fabs(rotx[i]); + if(rotx[i]<0)rotxvel[i]+=multiplier*8*fabs(rotx[i]); if(rotx[i]>0)rotxvel[i]-=multiplier*4; if(rotx[i]<0)rotxvel[i]+=multiplier*4; if(rotxvel[i]>0)rotxvel[i]-=multiplier*4; if(rotxvel[i]<0)rotxvel[i]+=multiplier*4; - if(abs(rotx[i])0)rotyvel[i]-=multiplier*8*abs(roty[i]); - if(roty[i]<0)rotyvel[i]+=multiplier*8*abs(roty[i]); + if(roty[i]>0)rotyvel[i]-=multiplier*8*fabs(roty[i]); + if(roty[i]<0)rotyvel[i]+=multiplier*8*fabs(roty[i]); if(roty[i]>0)rotyvel[i]-=multiplier*4; if(roty[i]<0)rotyvel[i]+=multiplier*4; if(rotyvel[i]>0)rotyvel[i]-=multiplier*4; if(rotyvel[i]<0)rotyvel[i]+=multiplier*4; - if(abs(roty[i])0)rotxvel[i]-=multiplier*8*abs(rotx[i]); - if(rotx[i]<0)rotxvel[i]+=multiplier*8*abs(rotx[i]); + if(rotx[i]>0)rotxvel[i]-=multiplier*8*fabs(rotx[i]); + if(rotx[i]<0)rotxvel[i]+=multiplier*8*fabs(rotx[i]); if(rotx[i]>0)rotxvel[i]-=multiplier*4; if(rotx[i]<0)rotxvel[i]+=multiplier*4; if(rotxvel[i]>0)rotxvel[i]-=multiplier*4; if(rotxvel[i]<0)rotxvel[i]+=multiplier*4; - if(abs(rotx[i])0)rotyvel[i]-=multiplier*8*abs(roty[i]); - if(roty[i]<0)rotyvel[i]+=multiplier*8*abs(roty[i]); + if(roty[i]>0)rotyvel[i]-=multiplier*8*fabs(roty[i]); + if(roty[i]<0)rotyvel[i]+=multiplier*8*fabs(roty[i]); if(roty[i]>0)rotyvel[i]-=multiplier*4; if(roty[i]<0)rotyvel[i]+=multiplier*4; if(rotyvel[i]>0)rotyvel[i]-=multiplier*4; if(rotyvel[i]<0)rotyvel[i]+=multiplier*4; - if(abs(roty[i])5)friction[numobjects]=.5; + if(friction[numobjects]==1.5&&fabs(arotation2)>5)friction[numobjects]=.5; if(atype==platformtype){ model[numobjects].loaddecal((char *)":Data:Models:Platform.solid",0); diff --git a/Source/Quaternions.cpp b/Source/Quaternions.cpp index 1170414..43ab061 100644 --- a/Source/Quaternions.cpp +++ b/Source/Quaternions.cpp @@ -275,7 +275,7 @@ bool LineFacet(Vector p1,Vector p2,Vector pa,Vector pb,Vector pc,Vector *p) //Calculate the position on the line that intersects the plane denom = n.x * (p2.x - p1.x) + n.y * (p2.y - p1.y) + n.z * (p2.z - p1.z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n.x * p1.x + n.y * p1.y + n.z * p1.z) / denom; p->x = p1.x + mu * (p2.x - p1.x); @@ -382,7 +382,7 @@ bool LineFacet(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p) //Calculate the position on the line that intersects the plane denom = n.x * (p2.x - p1.x) + n.y * (p2.y - p1.y) + n.z * (p2.z - p1.z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n.x * p1.x + n.y * p1.y + n.z * p1.z) / denom; p->x = p1.x + mu * (p2.x - p1.x); @@ -412,7 +412,7 @@ float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p) //Calculate the position on the line that intersects the plane denom = n.x * (p2.x - p1.x) + n.y * (p2.y - p1.y) + n.z * (p2.z - p1.z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n.x * p1.x + n.y * p1.y + n.z * p1.z) / denom; p->x = p1.x + mu * (p2.x - p1.x); @@ -438,7 +438,7 @@ float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc, XYZ n, XYZ *p) //Calculate the position on the line that intersects the plane denom = n.x * (p2.x - p1.x) + n.y * (p2.y - p1.y) + n.z * (p2.z - p1.z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n.x * p1.x + n.y * p1.y + n.z * p1.z) / denom; p->x = p1.x + mu * (p2.x - p1.x); @@ -468,7 +468,7 @@ float LineFacetd(XYZ *p1,XYZ *p2,XYZ *pa,XYZ *pb,XYZ *pc, XYZ *p) //Calculate the position on the line that intersects the plane denom = n.x * (p2->x - p1->x) + n.y * (p2->y - p1->y) + n.z * (p2->z - p1->z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n.x * p1->x + n.y * p1->y + n.z * p1->z) / denom; p->x = p1->x + mu * (p2->x - p1->x); @@ -493,7 +493,7 @@ float LineFacetd(XYZ *p1,XYZ *p2,XYZ *pa,XYZ *pb,XYZ *pc, XYZ *n, XYZ *p) //Calculate the position on the line that intersects the plane denom = n->x * (p2->x - p1->x) + n->y * (p2->y - p1->y) + n->z * (p2->z - p1->z); - if (abs(denom) < 0.0000001) // Line and plane don't intersect + if (fabs(denom) < 0.0000001) // Line and plane don't intersect return 0; mu = - (d + n->x * p1->x + n->y * p1->y + n->z * p1->z) / denom; p->x = p1->x + mu * (p2->x - p1->x); diff --git a/makefile b/makefile index 5c0270b..2e74c4f 100644 --- a/makefile +++ b/makefile @@ -40,6 +40,7 @@ DEFINES := \ -DTRUE=1 \ -DFALSE=0 \ -Dstricmp=strcasecmp \ + -DBinIO_STDINT_HEADER="" \ INCLUDES := \ -I$(SRCDIR) \