diff --git a/Engine/lib/convexDecomp/NvSimpleTypes.h b/Engine/lib/convexDecomp/NvSimpleTypes.h index 7e0d568e1..3dddaa2fc 100644 --- a/Engine/lib/convexDecomp/NvSimpleTypes.h +++ b/Engine/lib/convexDecomp/NvSimpleTypes.h @@ -58,12 +58,12 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. */ -#ifdef __APPLE__ +#if defined(__APPLE__) #include #else #if defined( __FreeBSD__) #include -#else +#else #include #endif #endif @@ -78,7 +78,7 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. #endif -#ifdef WIN32 +#if defined(WIN32) typedef __int64 NxI64; typedef signed int NxI32; typedef signed short NxI16; @@ -91,8 +91,8 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. typedef float NxF32; typedef double NxF64; - -#elif LINUX + +#elif defined(LINUX) typedef long long NxI64; typedef signed int NxI32; typedef signed short NxI16; @@ -106,7 +106,7 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. typedef float NxF32; typedef double NxF64; -#elif __APPLE__ +#elif defined(__APPLE__) typedef long long NxI64; typedef signed int NxI32; typedef signed short NxI16; @@ -120,7 +120,7 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. typedef float NxF32; typedef double NxF64; -#elif __CELLOS_LV2__ +#elif defined(__FreeBSD__) typedef long long NxI64; typedef signed int NxI32; typedef signed short NxI16; @@ -134,7 +134,21 @@ NvSimpleTypes.h : Defines basic data types for integers and floats. typedef float NxF32; typedef double NxF64; -#elif _XBOX +#elif defined(__CELLOS_LV2__) + typedef long long NxI64; + typedef signed int NxI32; + typedef signed short NxI16; + typedef signed char NxI8; + + typedef unsigned long long NxU64; + typedef unsigned int NxU32; + typedef unsigned short NxU16; + typedef unsigned char NxU8; + + typedef float NxF32; + typedef double NxF64; + +#elif defined(_XBOX) typedef __int64 NxI64; typedef signed int NxI32; typedef signed short NxI16; diff --git a/Engine/lib/convexDecomp/NvStanHull.cpp b/Engine/lib/convexDecomp/NvStanHull.cpp index 5849dd8f8..09448aaca 100644 --- a/Engine/lib/convexDecomp/NvStanHull.cpp +++ b/Engine/lib/convexDecomp/NvStanHull.cpp @@ -302,13 +302,13 @@ template NxI32 Array::IndexOf(Type t) NxI32 argmin(NxF32 a[],NxI32 n); -NxF32 sqr(NxF32 a); +NxF32 sqr(NxF32 a); NxF32 clampf(NxF32 a) ; NxF32 Round(NxF32 a,NxF32 precision); NxF32 Interpolate(const NxF32 &f0,const NxF32 &f1,NxF32 alpha) ; template -void Swap(T &a,T &b) +void Swap(T &a,T &b) { T tmp = a; a=b; @@ -318,13 +318,13 @@ void Swap(T &a,T &b) template -T Max(const T &a,const T &b) +T Max(const T &a,const T &b) { return (a>b)?a:b; } template -T Min(const T &a,const T &b) +T Min(const T &a,const T &b) { return (a=0&&i<3);return (&x)[i];} NxF32& operator()(NxI32 r, NxI32 c) {assert(r>=0&&r<3&&c>=0&&c<3);return ((&x)[r])[c];} const NxF32& operator()(NxI32 r, NxI32 c) const {assert(r>=0&&r<3&&c>=0&&c<3);return ((&x)[r])[c];} -}; +}; float3x3 Transpose( const float3x3& m ); float3 operator*( const float3& v , const float3x3& m ); float3 operator*( const float3x3& m , const float3& v ); @@ -442,7 +442,7 @@ public: }; -struct D3DXMATRIX; +struct D3DXMATRIX; class float4x4 : public Memalloc { @@ -450,9 +450,9 @@ class float4x4 : public Memalloc float4 x,y,z,w; // the 4 rows float4x4(){} float4x4(const float4 &_x, const float4 &_y, const float4 &_z, const float4 &_w):x(_x),y(_y),z(_z),w(_w){} - float4x4(NxF32 m00, NxF32 m01, NxF32 m02, NxF32 m03, - NxF32 m10, NxF32 m11, NxF32 m12, NxF32 m13, - NxF32 m20, NxF32 m21, NxF32 m22, NxF32 m23, + float4x4(NxF32 m00, NxF32 m01, NxF32 m02, NxF32 m03, + NxF32 m10, NxF32 m11, NxF32 m12, NxF32 m13, + NxF32 m20, NxF32 m21, NxF32 m22, NxF32 m23, NxF32 m30, NxF32 m31, NxF32 m32, NxF32 m33 ) :x(m00,m01,m02,m03),y(m10,m11,m12,m13),z(m20,m21,m22,m23),w(m30,m31,m32,m33){} NxF32& operator()(NxI32 r, NxI32 c) {assert(r>=0&&r<4&&c>=0&&c<4);return ((&x)[r])[c];} @@ -510,7 +510,7 @@ NxF32 dot( const Quaternion &a, const Quaternion &b ); float3 operator*( const Quaternion& q, const float3& v ); float3 operator*( const float3& v, const Quaternion& q ); Quaternion slerp( Quaternion a, const Quaternion& b, NxF32 interp ); -Quaternion Interpolate(const Quaternion &q0,const Quaternion &q1,NxF32 alpha); +Quaternion Interpolate(const Quaternion &q0,const Quaternion &q1,NxF32 alpha); Quaternion RotationArc(float3 v0, float3 v1 ); // returns quat q where q*v0=v1 Quaternion Inverse(const Quaternion &q); float4x4 MatrixFromQuatVec(const Quaternion &q, const float3 &v); @@ -528,7 +528,7 @@ NxF32 Pitch( const float3& v ); //------- Plane ---------- -class Plane +class Plane { public: float3 normal; @@ -576,7 +576,7 @@ NxF32 Round(NxF32 a,NxF32 precision) } -NxF32 Interpolate(const NxF32 &f0,const NxF32 &f1,NxF32 alpha) +NxF32 Interpolate(const NxF32 &f0,const NxF32 &f1,NxF32 alpha) { return f0*(1-alpha) + f1*alpha; } @@ -585,11 +585,11 @@ NxF32 Interpolate(const NxF32 &f0,const NxF32 &f1,NxF32 alpha) NxI32 argmin(NxF32 a[],NxI32 n) { NxI32 r=0; - for(NxI32 i=1;i= bmin.x && p.x <=bmax.x && - p.y >= bmin.y && p.y <=bmax.y && + return (p.x >= bmin.x && p.x <=bmax.x && + p.y >= bmin.y && p.y <=bmax.y && p.z >= bmin.z && p.z <=bmax.z ); } @@ -1366,13 +1366,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const *impact=v0; return 1; } - if(v0.x<=bmin.x && v1.x>=bmin.x) + if(v0.x<=bmin.x && v1.x>=bmin.x) { NxF32 a = (bmin.x-v0.x)/(v1.x-v0.x); //v.x = bmin.x; NxF32 vy = (1-a) *v0.y + a*v1.y; NxF32 vz = (1-a) *v0.z + a*v1.z; - if(vy>=bmin.y && vy<=bmax.y && vz>=bmin.z && vz<=bmax.z) + if(vy>=bmin.y && vy<=bmax.y && vz>=bmin.z && vz<=bmax.z) { impact->x = bmin.x; impact->y = vy; @@ -1380,13 +1380,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const return 1; } } - else if(v0.x >= bmax.x && v1.x <= bmax.x) + else if(v0.x >= bmax.x && v1.x <= bmax.x) { NxF32 a = (bmax.x-v0.x)/(v1.x-v0.x); //v.x = bmax.x; NxF32 vy = (1-a) *v0.y + a*v1.y; NxF32 vz = (1-a) *v0.z + a*v1.z; - if(vy>=bmin.y && vy<=bmax.y && vz>=bmin.z && vz<=bmax.z) + if(vy>=bmin.y && vy<=bmax.y && vz>=bmin.z && vz<=bmax.z) { impact->x = bmax.x; impact->y = vy; @@ -1394,13 +1394,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const return 1; } } - if(v0.y<=bmin.y && v1.y>=bmin.y) + if(v0.y<=bmin.y && v1.y>=bmin.y) { NxF32 a = (bmin.y-v0.y)/(v1.y-v0.y); NxF32 vx = (1-a) *v0.x + a*v1.x; //v.y = bmin.y; NxF32 vz = (1-a) *v0.z + a*v1.z; - if(vx>=bmin.x && vx<=bmax.x && vz>=bmin.z && vz<=bmax.z) + if(vx>=bmin.x && vx<=bmax.x && vz>=bmin.z && vz<=bmax.z) { impact->x = vx; impact->y = bmin.y; @@ -1408,13 +1408,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const return 1; } } - else if(v0.y >= bmax.y && v1.y <= bmax.y) + else if(v0.y >= bmax.y && v1.y <= bmax.y) { NxF32 a = (bmax.y-v0.y)/(v1.y-v0.y); NxF32 vx = (1-a) *v0.x + a*v1.x; // vy = bmax.y; NxF32 vz = (1-a) *v0.z + a*v1.z; - if(vx>=bmin.x && vx<=bmax.x && vz>=bmin.z && vz<=bmax.z) + if(vx>=bmin.x && vx<=bmax.x && vz>=bmin.z && vz<=bmax.z) { impact->x = vx; impact->y = bmax.y; @@ -1422,13 +1422,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const return 1; } } - if(v0.z<=bmin.z && v1.z>=bmin.z) + if(v0.z<=bmin.z && v1.z>=bmin.z) { NxF32 a = (bmin.z-v0.z)/(v1.z-v0.z); NxF32 vx = (1-a) *v0.x + a*v1.x; NxF32 vy = (1-a) *v0.y + a*v1.y; // v.z = bmin.z; - if(vy>=bmin.y && vy<=bmax.y && vx>=bmin.x && vx<=bmax.x) + if(vy>=bmin.y && vy<=bmax.y && vx>=bmin.x && vx<=bmax.x) { impact->x = vx; impact->y = vy; @@ -1436,13 +1436,13 @@ NxI32 BoxIntersect(const float3 &v0, const float3 &v1, const float3 &bmin, const return 1; } } - else if(v0.z >= bmax.z && v1.z <= bmax.z) + else if(v0.z >= bmax.z && v1.z <= bmax.z) { NxF32 a = (bmax.z-v0.z)/(v1.z-v0.z); NxF32 vx = (1-a) *v0.x + a*v1.x; NxF32 vy = (1-a) *v0.y + a*v1.y; // v.z = bmax.z; - if(vy>=bmin.y && vy<=bmax.y && vx>=bmin.x && vx<=bmax.x) + if(vy>=bmin.y && vy<=bmax.y && vx>=bmin.x && vx<=bmax.x) { impact->x = vx; impact->y = vy; @@ -1462,14 +1462,14 @@ NxF32 DistanceBetweenLines(const float3 &ustart, const float3 &udir, const float NxF32 distu = -dot(cp,ustart); NxF32 distv = -dot(cp,vstart); NxF32 dist = (NxF32)fabs(distu-distv); - if(upoint) + if(upoint) { Plane plane; plane.normal = normalize(cross(vdir,cp)); plane.dist = -dot(plane.normal,vstart); *upoint = PlaneLineIntersection(plane,ustart,ustart+udir); } - if(vpoint) + if(vpoint) { Plane plane; plane.normal = normalize(cross(udir,cp)); @@ -1480,19 +1480,19 @@ NxF32 DistanceBetweenLines(const float3 &ustart, const float3 &udir, const float } -Quaternion VirtualTrackBall(const float3 &cop, const float3 &cor, const float3 &dir1, const float3 &dir2) +Quaternion VirtualTrackBall(const float3 &cop, const float3 &cor, const float3 &dir1, const float3 &dir2) { // routine taken from game programming gems. // Implement track ball functionality to spin stuf on the screen // cop center of projection // cor center of rotation - // dir1 old mouse direction + // dir1 old mouse direction // dir2 new mouse direction // pretend there is a sphere around cor. Then find the points // where dir1 and dir2 intersect that sphere. Find the // rotation that takes the first point to the second. NxF32 m; - // compute plane + // compute plane float3 nrml = cor - cop; NxF32 fudgefactor = 1.0f/(magnitude(nrml) * 0.25f); // since trackball proportional to distance from cop nrml = normalize(nrml); @@ -1501,11 +1501,11 @@ Quaternion VirtualTrackBall(const float3 &cop, const float3 &cor, const float3 & u=u-cor; u=u*fudgefactor; m= magnitude(u); - if(m>1) + if(m>1) { u/=m; } - else + else { u=u - (nrml * sqrtf(1-m*m)); } @@ -1513,7 +1513,7 @@ Quaternion VirtualTrackBall(const float3 &cop, const float3 &cor, const float3 & v=v-cor; v=v*fudgefactor; m= magnitude(v); - if(m>1) + if(m>1) { v/=m; } @@ -1531,7 +1531,7 @@ NxI32 PolyHit(const float3 *vert, const NxI32 n, const float3 &v0, const float3 countpolyhit++; NxI32 i; float3 nrml(0,0,0); - for(i=0;i0) - { + if((d0=dot(v0,nrml)+dist) <0 || (d1=dot(v1,nrml)+dist) >0) + { return 0; } - static float3 the_point; + static float3 the_point; // By using the cached plane distances d0 and d1 // we can optimize the following: // the_point = planelineintersection(nrml,dist,v0,v1); @@ -1560,7 +1560,7 @@ NxI32 PolyHit(const float3 *vert, const NxI32 n, const float3 &v0, const float3 NxI32 inside=1; - for(NxI32 j=0;inside && j= 0.0); } - if(inside) + if(inside) { if(normal){*normal=nrml;} if(impact){*impact=the_point;} @@ -1675,7 +1675,7 @@ NxI32 SplitTest(ConvexH &convex,const Plane &plane) { return flag; } -class VertFlag +class VertFlag { public: NxU8 planetest; @@ -1683,7 +1683,7 @@ public: NxU8 undermap; NxU8 overmap; }; -class EdgeFlag +class EdgeFlag { public: NxU8 planetest; @@ -1691,7 +1691,7 @@ public: short undermap; short overmap; }; -class PlaneFlag +class PlaneFlag { public: NxU8 undermap; @@ -1821,7 +1821,7 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) } else if((vertflag[edge0.v].planetest | vertflag[edge1.v].planetest) == UNDER) { // at least one endpoint under, the other coplanar or under - + edgeflag[e0].undermap = (short)under_edge_count; tmpunderedges[under_edge_count].v = (NxU8)vertflag[edge0.v].undermap; tmpunderedges[under_edge_count].p = (NxU8)underplanescount; @@ -1834,16 +1834,16 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) under_edge_count++; } else if((vertflag[edge0.v].planetest | vertflag[edge1.v].planetest) == COPLANAR) { - // both endpoints coplanar + // both endpoints coplanar // must check a 3rd point to see if UNDER - NxI32 e2 = e1+1; + NxI32 e2 = e1+1; if(e2>=convex.edges.count || convex.edges[e2].p!=currentplane) { e2 = estart; } assert(convex.edges[e2].p==currentplane); HalfEdge &edge2 = convex.edges[e2]; if(vertflag[edge2.v].planetest==UNDER) { - + edgeflag[e0].undermap = (short)under_edge_count; tmpunderedges[under_edge_count].v = (NxU8)vertflag[edge0.v].undermap; tmpunderedges[under_edge_count].p = (NxU8)underplanescount; @@ -1859,8 +1859,8 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) } } else if(vertflag[edge0.v].planetest == UNDER && vertflag[edge1.v].planetest == OVER) { - // first is under 2nd is over - + // first is under 2nd is over + edgeflag[e0].undermap = (short) under_edge_count; tmpunderedges[under_edge_count].v = (NxU8)vertflag[edge0.v].undermap; tmpunderedges[under_edge_count].p = (NxU8)underplanescount; @@ -1880,7 +1880,7 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) vout = vertcountunder++; } under_edge_count++; - /// hmmm something to think about: i might be able to output this edge regarless of + /// hmmm something to think about: i might be able to output this edge regarless of // wheter or not we know v-in yet. ok i;ll try this now: tmpunderedges[under_edge_count].v = (NxU8)vout; tmpunderedges[under_edge_count].p = (NxU8)underplanescount; @@ -1897,8 +1897,8 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) } else if(vertflag[edge0.v].planetest == COPLANAR && vertflag[edge1.v].planetest == OVER) { - // first is coplanar 2nd is over - + // first is coplanar 2nd is over + edgeflag[e0].undermap = -1; vout = vertflag[edge0.v].undermap; // I hate this but i have to make sure part of this face is UNDER before ouputting this vert @@ -1914,11 +1914,11 @@ ConvexH *ConvexHCrop(ConvexH &convex,const Plane &slice) tmpunderedges[under_edge_count].ea = -1; coplanaredge = under_edge_count; // hmmm should make a note of the edge # for later on under_edge_count++; - + } } else if(vertflag[edge0.v].planetest == OVER && vertflag[edge1.v].planetest == UNDER) { - // first is over next is under + // first is over next is under // new vertex!!! if (vin!=-1) return NULL; if(e0facets.count;j++) { - if(planes[i]==convex->facets[j]) + if(planes[i]==convex->facets[j]) { d=0;continue; } @@ -2121,7 +2121,7 @@ NxI32 maxdirfiltered(const T *p,NxI32 count,const T &dir,Array &allow) } assert(m!=-1); return m; -} +} float3 orth(const float3 &v) { @@ -2175,21 +2175,21 @@ NxI32 maxdirsterid(const T *p,NxI32 count,const T &dir,Array &allow) } assert(0); return m; -} +} -NxI32 operator ==(const int3 &a,const int3 &b) +NxI32 operator ==(const int3 &a,const int3 &b) { - for(NxI32 i=0;i<3;i++) + for(NxI32 i=0;i<3;i++) { if(a[i]!=b[i]) return 0; } return 1; } -int3 roll3(int3 a) +int3 roll3(int3 a) { NxI32 tmp=a[0]; a[0]=a[1]; @@ -2197,15 +2197,15 @@ int3 roll3(int3 a) a[2]=tmp; return a; } -NxI32 isa(const int3 &a,const int3 &b) +NxI32 isa(const int3 &a,const int3 &b) { return ( a==b || roll3(a)==b || a==roll3(b) ); } -NxI32 b2b(const int3 &a,const int3 &b) +NxI32 b2b(const int3 &a,const int3 &b) { return isa(a,int3(b[2],b[1],b[0])); } -NxI32 above(float3* vertices,const int3& t, const float3 &p, NxF32 epsilon) +NxI32 above(float3* vertices,const int3& t, const float3 &p, NxF32 epsilon) { float3 n=TriNormal(vertices[t[0]],vertices[t[1]],vertices[t[2]]); return (dot(n,p-vertices[t[0]]) > epsilon); // EPSILON??? @@ -2265,7 +2265,7 @@ NxI32 &Tri::neib(NxI32 a,NxI32 b) { static NxI32 er=-1; NxI32 i; - for(i=0;i<3;i++) + for(i=0;i<3;i++) { NxI32 i1=(i+1)%3; NxI32 i2=(i+2)%3; @@ -2278,7 +2278,7 @@ NxI32 &Tri::neib(NxI32 a,NxI32 b) void b2bfix(Tri* s,Tri*t) { NxI32 i; - for(i=0;i<3;i++) + for(i=0;i<3;i++) { NxI32 i1=(i+1)%3; NxI32 i2=(i+2)%3; @@ -2356,11 +2356,11 @@ bool hasVolume(float3 *verts, NxI32 p0, NxI32 p1, NxI32 p2, NxI32 p3) int4 FindSimplex(float3 *verts,NxI32 verts_count,Array &allow) { float3 basis[3]; - basis[0] = float3( 0.01f, 0.02f, 1.0f ); + basis[0] = float3( 0.01f, 0.02f, 1.0f ); NxI32 p0 = maxdirsterid(verts,verts_count, basis[0],allow); NxI32 p1 = maxdirsterid(verts,verts_count,-basis[0],allow); basis[0] = verts[p0]-verts[p1]; - if(p0==p1 || basis[0]==float3(0,0,0)) + if(p0==p1 || basis[0]==float3(0,0,0)) return int4(-1,-1,-1,-1); basis[1] = cross(float3( 1, 0.02f, 0),basis[0]); basis[2] = cross(float3(-0.02f, 1, 0),basis[0]); @@ -2370,13 +2370,13 @@ int4 FindSimplex(float3 *verts,NxI32 verts_count,Array &allow) { p2 = maxdirsterid(verts,verts_count,-basis[1],allow); } - if(p2 == p0 || p2 == p1) + if(p2 == p0 || p2 == p1) return int4(-1,-1,-1,-1); basis[1] = verts[p2] - verts[p0]; basis[2] = normalize(cross(basis[1],basis[0])); NxI32 p3 = maxdirsterid(verts,verts_count,basis[2],allow); if(p3==p0||p3==p1||p3==p2||!hasVolume(verts, p0, p1, p2, p3)) p3 = maxdirsterid(verts,verts_count,-basis[2],allow); - if(p3==p0||p3==p1||p3==p2) + if(p3==p0||p3==p1||p3==p2) return int4(-1,-1,-1,-1); assert(!(p0==p1||p0==p2||p0==p3||p1==p2||p1==p3||p2==p3)); if(dot(verts[p3]-verts[p0],cross(verts[p1]-verts[p0],verts[p2]-verts[p0])) <0) {Swap(p2,p3);} @@ -2384,7 +2384,7 @@ int4 FindSimplex(float3 *verts,NxI32 verts_count,Array &allow) } #pragma warning(push) #pragma warning(disable:4706) -NxI32 calchullgen(float3 *verts,NxI32 verts_count, NxI32 vlimit) +NxI32 calchullgen(float3 *verts,NxI32 verts_count, NxI32 vlimit) { if(verts_count <4) return 0; if(vlimit==0) vlimit=1000000000; @@ -2392,7 +2392,7 @@ NxI32 calchullgen(float3 *verts,NxI32 verts_count, NxI32 vlimit) float3 bmin(*verts),bmax(*verts); Array isextreme(verts_count); Array allow(verts_count); - for(j=0;jvmax>=0) break; float3 n=TriNormal(verts[(*t)[0]],verts[(*t)[1]],verts[(*t)[2]]); t->vmax = maxdirsterid(verts,verts_count,n,allow); - if(isextreme[t->vmax]) + if(isextreme[t->vmax]) { t->vmax=-1; // already done that vertex - algorithm needs to be able to terminate. } @@ -2479,7 +2479,7 @@ NxI32 calchullgen(float3 *verts,NxI32 verts_count, NxI32 vlimit) } #pragma warning(pop) -NxI32 calchull(float3 *verts,NxI32 verts_count, NxI32 *&tris_out, NxI32 &tris_count,NxI32 vlimit) +NxI32 calchull(float3 *verts,NxI32 verts_count, NxI32 *&tris_out, NxI32 &tris_count,NxI32 vlimit) { NxI32 rc=calchullgen(verts,verts_count, vlimit) ; if(!rc) return 0; @@ -2502,7 +2502,7 @@ static NxF32 area2(const float3 &v0,const float3 &v1,const float3 &v2) float3 cp = cross(v0-v1,v2-v0); return dot(cp,cp); } -NxI32 calchullpbev(float3 *verts,NxI32 verts_count,NxI32 vlimit, Array &planes,NxF32 bevangle) +NxI32 calchullpbev(float3 *verts,NxI32 verts_count,NxI32 vlimit, Array &planes,NxF32 bevangle) { NxI32 i,j; Array bplanes; @@ -2526,7 +2526,7 @@ NxI32 calchullpbev(float3 *verts,NxI32 verts_count,NxI32 vlimit, Array &p REAL3 e = verts[(*t)[(j+2)%3]] - verts[(*t)[(j+1)%3]]; REAL3 n = (e!=REAL3(0,0,0))? cross(snormal,e)+cross(e,p.normal) : snormal+p.normal; assert(n!=REAL3(0,0,0)); - if(n==REAL3(0,0,0)) return 0; + if(n==REAL3(0,0,0)) return 0; n=normalize(n); bplanes.Add(Plane(n,-dot(n,verts[maxdir(verts,verts_count,n)]))); } @@ -2656,7 +2656,7 @@ static NxI32 overhull(Plane *planes,NxI32 planes_count,float3 *verts, NxI32 vert float3 *&verts_out, NxI32 &verts_count_out, NxI32 *&faces_out, NxI32 &faces_count_out ,NxF32 inflate) { NxI32 i,j; - if (verts_count < 4) return 0; //XXTH NULL; + if (verts_count < 4) return 0; maxplanes = Min(maxplanes,planes_count); float3 bmin(verts[0]),bmax(verts[0]); for(i=0;i #include diff --git a/Engine/source/platformPOSIX/POSIXProcessControl.cpp b/Engine/source/platformPOSIX/POSIXProcessControl.cpp index b8aa34504..dd2630f50 100644 --- a/Engine/source/platformPOSIX/POSIXProcessControl.cpp +++ b/Engine/source/platformPOSIX/POSIXProcessControl.cpp @@ -49,7 +49,7 @@ static void CheckExitCode(S64 exitCode) { if (exitCode != 0) { - Con::errorf(ConsoleLogEntry::General, + Con::errorf(ConsoleLogEntry::General, "Nonzero exit code: %d, triggering SIGSEGV for core dump", exitCode); kill(getpid(), SIGSEGV); @@ -63,7 +63,7 @@ static void SignalHandler(int sigtype) { signal(SIGSEGV, SIG_DFL); signal(SIGTRAP, SIG_DFL); - // restore the signal handling to default so that we don't get into + // restore the signal handling to default so that we don't get into // a crash loop with ImmediateShutdown ImmediateShutdown(-sigtype, sigtype); } @@ -86,7 +86,7 @@ void Cleanup(bool minimal) StdConsole::destroy(); -#ifndef TORQUE_DEDICATED +#ifndef TORQUE_DEDICATED SDL_Quit(); #endif } @@ -106,7 +106,7 @@ void ImmediateShutdown(S32 exitCode, S32 signalNum) } else { -// there is a problem in kernel 2.4.17 which causes a hang when a segfault +// there is a problem in kernel 2.4.17 which causes a hang when a segfault // occurs. also subsequent runs of "ps" will hang and the machine has to be // hard reset to clear up the problem // JMQ: this bug appears to be fixed in 2.4.18 @@ -131,7 +131,7 @@ void ProcessControlInit() signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); - // we're not interested in the exit status of child processes, so this + // we're not interested in the exit status of child processes, so this // prevents zombies from accumulating. #if defined(__FreeBSD__) || defined(__APPLE__) signal(SIGCHLD, SIG_IGN); @@ -149,10 +149,6 @@ void ProcessControlInit() void Platform::postQuitMessage(const S32 in_quitVal) { - Process::requestShutdown(); - return; - - // if we have a window send a quit event, otherwise just force shutdown #if 0 if (x86UNIXState->windowCreated()) @@ -161,18 +157,19 @@ void Platform::postQuitMessage(const S32 in_quitVal) SendQuitEvent(); } else -#endif { forceShutdown(in_quitVal); } +#endif + Process::requestShutdown(); } //----------------------------------------------------------------------------- void Platform::debugBreak() { - // in windows, "Calling DebugBreak causes the program to display + // in windows, "Calling DebugBreak causes the program to display // a dialog box as if it had crashed." So we segfault. - Con::errorf(ConsoleLogEntry::General, + Con::errorf(ConsoleLogEntry::General, "Platform::debugBreak: triggering SIGSEGV for core dump"); //kill(getpid(), SIGSEGV); @@ -203,20 +200,20 @@ void Platform::forceShutdown(S32 returnValue) void Platform::outputDebugString(const char *string, ...) { char buffer[2048]; - + va_list args; va_start( args, string ); - + dVsprintf( buffer, sizeof(buffer), string, args ); va_end( args ); - + U32 length = dStrlen(buffer); if( length == (sizeof(buffer) - 1 ) ) length--; - + buffer[length++] = '\n'; buffer[length] = '\0'; - + fwrite(buffer, sizeof(char), length, stderr); } diff --git a/Engine/source/ts/tsShapeInstance.h b/Engine/source/ts/tsShapeInstance.h index 7a6f468fc..60177c349 100644 --- a/Engine/source/ts/tsShapeInstance.h +++ b/Engine/source/ts/tsShapeInstance.h @@ -788,7 +788,7 @@ class TSThread keyPos = 0; mSeqPos = 0; mShapeInstance = NULL; - makePath = false; //XXTH NULL; + makePath = false; priority = 0; sequence = 0; timeScale = 1.0f;