diff options
Diffstat (limited to 'dep/include')
50 files changed, 30 insertions, 257 deletions
diff --git a/dep/include/g3dlite/G3D/AABox.h b/dep/include/g3dlite/G3D/AABox.h index 699a3d94674..b1b1477fe9f 100644 --- a/dep/include/g3dlite/G3D/AABox.h +++ b/dep/include/g3dlite/G3D/AABox.h @@ -65,7 +65,6 @@ public: hi = high; } - inline const Vector3& low() const { return lo; } @@ -251,6 +250,5 @@ inline unsigned int hashCode(const G3D::AABox& b) { return b.hashCode(); } - #endif diff --git a/dep/include/g3dlite/G3D/Array.h b/dep/include/g3dlite/G3D/Array.h index f58ee5eeedb..34401af40c4 100644 --- a/dep/include/g3dlite/G3D/Array.h +++ b/dep/include/g3dlite/G3D/Array.h @@ -33,7 +33,6 @@ # pragma warning( disable : 4786) #endif - namespace G3D { /** @@ -60,7 +59,6 @@ const int SORT_DECREASING = -1; If SSE is defined Arrays allocate the first element aligned to 16 bytes. - Array is highly optimized compared to std::vector. Array operations are less expensive than on std::vector and for large amounts of data, Array consumes only 1.5x the total size of the @@ -120,13 +118,11 @@ private: return (address >= data) && (address < data + num); } - /** Only compiled if you use the sort procedure. */ static bool __cdecl compareGT(const T& a, const T& b) { return a > b; } - /** Allocates a new array of size numAllocated (not a parameter to the method) and then copies at most oldNum elements from the old array to it. Destructors are @@ -163,7 +159,6 @@ private: ptr->~T(); }} - System::alignedFree(oldData); } @@ -255,7 +250,6 @@ public: numAllocated = 0; } - /** Removes all elements. Use resize(0, false) or fastClear if you want to remove all elements without deallocating the underlying array @@ -329,7 +323,6 @@ public: resize(n, false); } - /** Inserts at the specified index and shifts all other elements up by one. */ @@ -444,7 +437,6 @@ public: } } - inline void append(const T& v1, const T& v2) { if (inArray(&v1) || inArray(&v2)) { T t1 = v1; @@ -463,7 +455,6 @@ public: } } - inline void append(const T& v1, const T& v2, const T& v3) { if (inArray(&v1) || inArray(&v2) || inArray(&v3)) { T t1 = v1; @@ -485,7 +476,6 @@ public: } } - inline void append(const T& v1, const T& v2, const T& v3, const T& v4) { if (inArray(&v1) || inArray(&v2) || inArray(&v3) || inArray(&v4)) { T t1 = v1; @@ -614,7 +604,6 @@ public: resize(num - 1, shrinkUnderlyingArrayIfNecessary); } - /** "The member function swaps the controlled sequences between *this and str." Note that this is slower than the optimal std implementation. @@ -627,7 +616,6 @@ public: *this = temp; } - /** Performs bounds checks in debug mode */ @@ -832,7 +820,6 @@ public: std::sort(data, data + num, lessThan); } - /** Sorts the array in increasing order using the > or < operator. To invoke this method on Array<T>, T must override those operator. @@ -1118,7 +1105,6 @@ public: medianPartition(ltMedian, eqMedian, gtMedian, temp, DefaultComparator()); } - /** Redistributes the elements so that the new order is statistically independent of the original order. O(n) time.*/ void randomize() { @@ -1133,10 +1119,8 @@ public: } } - }; - /** Array::contains for C-arrays */ template<class T> bool contains(const T* array, int len, const T& e) { for (int i = len - 1; i >= 0; --i) { diff --git a/dep/include/g3dlite/G3D/Box.h b/dep/include/g3dlite/G3D/Box.h index 8ec7ea3408d..3ac3c61d0f6 100644 --- a/dep/include/g3dlite/G3D/Box.h +++ b/dep/include/g3dlite/G3D/Box.h @@ -28,7 +28,6 @@ class CoordinateFrame; /** An arbitrary 3D box, useful as a bounding box. - To construct a box from a coordinate frame, center and extent, use the idiom: <CODE>Box box = cframe.toObjectSpace(Box(center - extent/2, center + extent/2));</CODE> @@ -86,7 +85,6 @@ public: Box(const class AABox& b); - /** Returns the object to world transformation for this box. localFrame().worldToObject(...) takes diff --git a/dep/include/g3dlite/G3D/CollisionDetection.h b/dep/include/g3dlite/G3D/CollisionDetection.h index 4add967ed8b..5e95498ffed 100644 --- a/dep/include/g3dlite/G3D/CollisionDetection.h +++ b/dep/include/g3dlite/G3D/CollisionDetection.h @@ -1,7 +1,6 @@ /** @file CollisionDetection.h - Moving collision detection for simple primitives. @author Morgan McGuire, matrix@graphics3d.com @@ -32,7 +31,6 @@ namespace G3D { - /** Collision detection primitives and tools for building higher order collision detection schemes. @@ -108,7 +106,6 @@ private: */ static Array<Vector3> ignoreArray; - // Static class! CollisionDetection() {} virtual ~CollisionDetection() {} @@ -183,7 +180,6 @@ public: const double* ad, const double* bd); - /** Creates a set of standard information about two boxes in order to solve for their collision. This information includes a vector to diff --git a/dep/include/g3dlite/G3D/Crypto.h b/dep/include/g3dlite/G3D/Crypto.h index 2805e8590c2..0bd5b75efca 100644 --- a/dep/include/g3dlite/G3D/Crypto.h +++ b/dep/include/g3dlite/G3D/Crypto.h @@ -3,7 +3,6 @@ @maintainer Morgan McGuire, matrix@graphics3d.com - @created 2006-03-29 @edited 2006-04-06 */ diff --git a/dep/include/g3dlite/G3D/GCamera.h b/dep/include/g3dlite/G3D/GCamera.h index 50d5ca2244e..7bf8e26e562 100644 --- a/dep/include/g3dlite/G3D/GCamera.h +++ b/dep/include/g3dlite/G3D/GCamera.h @@ -81,7 +81,6 @@ public: virtual ~GCamera(); - CoordinateFrame getCoordinateFrame() const; void getCoordinateFrame(CoordinateFrame& c) const; void setCoordinateFrame(const CoordinateFrame& c); @@ -152,14 +151,12 @@ public: float getImagePlaneDepth( const class Rect2D& viewport) const; - /** Returns the world space ray passing through the center of pixel (x, y) on the image plane. The pixel x and y axes are opposite the 3D object space axes: (0,0) is the upper left corner of the screen. They are in viewport coordinates, not screen coordinates. - Integer (x, y) values correspond to the upper left corners of pixels. If you want to cast rays through pixel centers, add 0.5 to x and y. @@ -169,7 +166,6 @@ public: float y, const class Rect2D& viewport) const; - /** Returns a negative z-value. */ diff --git a/dep/include/g3dlite/G3D/Line.h b/dep/include/g3dlite/G3D/Line.h index 724d5ef88cb..fedcb4d8cf0 100644 --- a/dep/include/g3dlite/G3D/Line.h +++ b/dep/include/g3dlite/G3D/Line.h @@ -81,6 +81,5 @@ public: };// namespace - #endif diff --git a/dep/include/g3dlite/G3D/Matrix3.h b/dep/include/g3dlite/G3D/Matrix3.h index 0fd85b306c9..99e049654ee 100644 --- a/dep/include/g3dlite/G3D/Matrix3.h +++ b/dep/include/g3dlite/G3D/Matrix3.h @@ -54,7 +54,6 @@ public: @cite Implementation from Watt and Watt, pg 362*/ Matrix3(const class Quat& q); - /** Sets all elements. */ @@ -126,7 +125,6 @@ public: return kProd; } - /** * vector * matrix [1x3 * 3x3 = 1x3] */ @@ -288,7 +286,6 @@ protected: }; - //---------------------------------------------------------------------------- /** <code>v * M == M.transpose() * v</code> */ inline Vector3 operator* (const Vector3& rkPoint, const Matrix3& rkMatrix) { @@ -304,7 +301,6 @@ inline Vector3 operator* (const Vector3& rkPoint, const Matrix3& rkMatrix) { return kProd; } - } // namespace #endif diff --git a/dep/include/g3dlite/G3D/Quat.h b/dep/include/g3dlite/G3D/Quat.h index f53d70be909..5fc30e8ec49 100644 --- a/dep/include/g3dlite/G3D/Quat.h +++ b/dep/include/g3dlite/G3D/Quat.h @@ -209,13 +209,11 @@ public: return (*this) * other.inverse(); } - /** Is the magnitude nearly 1.0? */ inline bool isUnit(float tolerance = 1e-5) const { return abs(dot(*this) - 1.0f) < tolerance; } - inline float magnitude() const { return sqrtf(dot(*this)); } @@ -268,7 +266,6 @@ public: return Quat(sinf(A) * v, cosf(A)); } - /** Raise this quaternion to a power. For a rotation, this is the effect of rotating x times as much as the original @@ -281,7 +278,6 @@ public: return (log() * x).exp(); } - /** @deprecated Use toUnit() @@ -695,8 +691,6 @@ inline G3D::Quat pow(const G3D::Quat& q, double x) { return q.pow((float)x); } - - #include "Quat.inl" #endif diff --git a/dep/include/g3dlite/G3D/Quat.inl b/dep/include/g3dlite/G3D/Quat.inl index 705cb0455d4..9e4c861d93b 100644 --- a/dep/include/g3dlite/G3D/Quat.inl +++ b/dep/include/g3dlite/G3D/Quat.inl @@ -1,11 +1,11 @@ /** Quat.inl - - @cite Quaternion implementation based on Watt & Watt page 363. + + @cite Quaternion implementation based on Watt & Watt page 363. Thanks to Max McGuire for slerp optimizations. - + @maintainer Morgan McGuire, matrix@graphics3d.com - + @created 2002-01-23 @edited 2004-03-04 */ @@ -24,8 +24,6 @@ inline const float& Quat::operator[] (int i) const { return ((float*)this)[i]; } - - inline Quat Quat::operator-(const Quat& other) const { return Quat(x - other.x, y - other.y, z - other.z, w - other.w); } diff --git a/dep/include/g3dlite/G3D/Ray.h b/dep/include/g3dlite/G3D/Ray.h index 3929cf1e6ac..740f307d88c 100644 --- a/dep/include/g3dlite/G3D/Ray.h +++ b/dep/include/g3dlite/G3D/Ray.h @@ -121,7 +121,6 @@ public: const Vector3& edge01, const Vector3& edge02) const; - inline float intersectionTime( const Vector3& vert0, const Vector3& vert1, @@ -130,7 +129,6 @@ public: return intersectionTime(vert0, vert1, vert2, vert1 - vert0, vert2 - vert0); } - inline float intersectionTime( const Vector3& vert0, const Vector3& vert1, @@ -177,7 +175,6 @@ public: const Vector3& normal) const; }; - #define EPSILON 0.000001 #define CROSS(dest,v1,v2) \ dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \ @@ -236,7 +233,6 @@ inline float Ray::intersectionTime( return (float)inf(); } - // Case where we don't need correct (u, v): const float t = DOT(edge2, qvec); @@ -249,7 +245,6 @@ inline float Ray::intersectionTime( } } - inline float Ray::intersectionTime( const Vector3& vert0, const Vector3& vert1, diff --git a/dep/include/g3dlite/G3D/System.h b/dep/include/g3dlite/G3D/System.h index ab5a8d60a76..81abff3fb50 100644 --- a/dep/include/g3dlite/G3D/System.h +++ b/dep/include/g3dlite/G3D/System.h @@ -22,7 +22,6 @@ # include <CoreServices/CoreServices.h> #endif - namespace G3D { typedef double RealTime; @@ -116,7 +115,6 @@ public: }; - } // namespace #endif diff --git a/dep/include/g3dlite/G3D/Table.h b/dep/include/g3dlite/G3D/Table.h index 1d021daae2b..aded5c38555 100644 --- a/dep/include/g3dlite/G3D/Table.h +++ b/dep/include/g3dlite/G3D/Table.h @@ -28,7 +28,6 @@ # pragma warning (disable : 4786) #endif - template<typename Key> struct GHashCode{}; @@ -76,7 +75,6 @@ struct GHashCode<std::string> namespace G3D { - /** An unordered data structure mapping keys to values. @@ -103,7 +101,6 @@ namespace G3D { And rely on the default enum operator==. - Periodically check that debugGetLoad() is low (> 0.1). When it gets near 1.0 your hash function is badly designed and maps too many inputs to the same output. @@ -131,7 +128,6 @@ private: Entry entry; Node* next; - /** Provide pooled allocation for speed. */ inline void* operator new (size_t size) { return System::malloc(size); @@ -141,7 +137,6 @@ private: System::free(p); } - Node(Key key, Value value, size_t hashCode, Node* next) { this->entry.key = key; this->entry.value = value; @@ -419,7 +414,6 @@ public: } }; - /** C++ STL style iterator method. Returns the first Entry, which contains a key and value. Use preincrement (++entry) to get to @@ -448,7 +442,6 @@ public: System::memset(bucket, 0, sizeof(Node*) * numBuckets); } - /** Returns the number of keys. */ @@ -456,7 +449,6 @@ public: return _size; } - /** If you insert a pointer into the key or value of a table, you are responsible for deallocating the object eventually. Inserting @@ -546,7 +538,6 @@ public: n = n->next; } while (n != NULL); - alwaysAssertM(false, "Tried to remove a key that was not in the table."); } @@ -616,7 +607,6 @@ public: return false; } - /** Short syntax for get. */ @@ -624,7 +614,6 @@ public: return get(key); } - /** Returns an array of all of the keys in the table. You can iterate over the keys to get the values. diff --git a/dep/include/g3dlite/G3D/Vector2.h b/dep/include/g3dlite/G3D/Vector2.h index 3d66e654f93..273ab6b4d07 100644 --- a/dep/include/g3dlite/G3D/Vector2.h +++ b/dep/include/g3dlite/G3D/Vector2.h @@ -144,8 +144,6 @@ public: /** Largest representable vector */ static const Vector2& maxFinite(); - - // Deprecated. See Matrix3::identity() for details. /** @deprecated Use Vector2::zero() */ static const Vector2 ZERO; @@ -207,53 +205,42 @@ inline Vector2 operator*(int s, const Vector2& v) { return v * (float)s; } - inline unsigned int hashCode(const G3D::Vector2& v) { return v.hashCode(); } - inline Vector2::Vector2 () : x(0.0f), y(0.0f) { } - inline Vector2::Vector2(float _x, float _y) : x(_x), y(_y) { } - inline Vector2::Vector2 (float afCoordinate[2]) { x = afCoordinate[0]; y = afCoordinate[1]; } - - inline Vector2::Vector2 (double afCoordinate[2]) { x = (float)afCoordinate[0]; y = (float)afCoordinate[1]; } - inline Vector2::Vector2 (const Vector2& rkVector) { x = rkVector.x; y = rkVector.y; } - inline Vector2::Vector2 (const Vector2int16& v) : x(v.x), y(v.y) { } - inline float& Vector2::operator[] (int i) { return ((float*)this)[i]; } - inline const float& Vector2::operator[] (int i) const { return ((float*)this)[i]; } - inline Vector2::operator float* () { return (float*)this; } @@ -262,62 +249,48 @@ inline Vector2::operator const float* () const { return (float*)this; } - inline Vector2& Vector2::operator= (const Vector2& rkVector) { x = rkVector.x; y = rkVector.y; return *this; } - inline bool Vector2::operator== (const Vector2& rkVector) const { return ( x == rkVector.x && y == rkVector.y); } - inline bool Vector2::operator!= (const Vector2& rkVector) const { return ( x != rkVector.x || y != rkVector.y); } - inline Vector2 Vector2::operator+ (const Vector2& rkVector) const { return Vector2(x + rkVector.x, y + rkVector.y); } - inline Vector2 Vector2::operator- (const Vector2& rkVector) const { return Vector2(x - rkVector.x, y - rkVector.y); } - inline Vector2 Vector2::operator* (float fScalar) const { return Vector2(fScalar*x, fScalar*y); } - - inline Vector2 Vector2::operator- () const { return Vector2( -x, -y); } - - inline Vector2& Vector2::operator+= (const Vector2& rkVector) { x += rkVector.x; y += rkVector.y; return *this; } - - inline Vector2& Vector2::operator-= (const Vector2& rkVector) { x -= rkVector.x; y -= rkVector.y; return *this; } - - inline Vector2& Vector2::operator*= (float fScalar) { x *= fScalar; y *= fScalar; @@ -325,44 +298,34 @@ inline Vector2& Vector2::operator*= (float fScalar) { } - - inline Vector2& Vector2::operator*= (const Vector2& rkVector) { x *= rkVector.x; y *= rkVector.y; return *this; } - - inline Vector2& Vector2::operator/= (const Vector2& rkVector) { x /= rkVector.x; y /= rkVector.y; return *this; } - inline Vector2 Vector2::operator* (const Vector2& rkVector) const { return Vector2(x * rkVector.x, y * rkVector.y); } - - inline Vector2 Vector2::operator/ (const Vector2& rkVector) const { return Vector2(x / rkVector.x, y / rkVector.y); } - inline float Vector2::squaredLength () const { return x*x + y*y; } - inline float Vector2::length () const { return sqrtf(x*x + y*y); } - inline Vector2 Vector2::direction () const { float lenSquared = x * x + y * y; @@ -373,50 +336,34 @@ inline Vector2 Vector2::direction () const { } } - - inline float Vector2::dot (const Vector2& rkVector) const { return x*rkVector.x + y*rkVector.y; } - - inline Vector2 Vector2::min(const Vector2 &v) const { return Vector2(G3D::min(v.x, x), G3D::min(v.y, y)); } - - inline Vector2 Vector2::max(const Vector2 &v) const { return Vector2(G3D::max(v.x, x), G3D::max(v.y, y)); } - - inline bool Vector2::fuzzyEq(const Vector2& other) const { return G3D::fuzzyEq((*this - other).squaredLength(), 0); } - - inline bool Vector2::fuzzyNe(const Vector2& other) const { return G3D::fuzzyNe((*this - other).squaredLength(), 0); } - - inline bool Vector2::isFinite() const { return G3D::isFinite(x) && G3D::isFinite(y); } - - inline bool Vector2::isZero() const { return (x == 0.0f) && (y == 0.0f); } - - inline bool Vector2::isUnit() const { return squaredLength() == 1.0f; } @@ -431,9 +378,7 @@ inline G3D::Vector2 operator*(int s, const G3D::Vector2& v) { return v * (float)s; } - inline unsigned int hashCode(const G3D::Vector2& v); - #endif diff --git a/dep/include/g3dlite/G3D/Vector2.inl b/dep/include/g3dlite/G3D/Vector2.inl index 27abecf02ce..4f7c55a39cf 100644 --- a/dep/include/g3dlite/G3D/Vector2.inl +++ b/dep/include/g3dlite/G3D/Vector2.inl @@ -1,13 +1,12 @@ /** @file Vector2.inl - + @maintainer Morgan McGuire, matrix@graphics3d.com @cite Portions by Laura Wollstadt, graphics3d.com - + @cite Portions based on Dave Eberly'x Magic Software Library at http://www.magic-software.com - - + @created 2001-06-02 @edited 2006-01-14 @@ -15,6 +14,5 @@ All rights reserved. */ - } diff --git a/dep/include/g3dlite/G3D/Vector2int16.h b/dep/include/g3dlite/G3D/Vector2int16.h index 40f39bae43d..c4211b0aaab 100644 --- a/dep/include/g3dlite/G3D/Vector2int16.h +++ b/dep/include/g3dlite/G3D/Vector2int16.h @@ -52,7 +52,6 @@ public: return ((G3D::int16*)this)[i]; } - inline bool operator== (const Vector2int16& rkVector) const { return ((int32*)this)[0] == ((int32*)&rkVector)[0]; } diff --git a/dep/include/g3dlite/G3D/Vector3.h b/dep/include/g3dlite/G3D/Vector3.h index 9f46bf87233..140eb284e12 100644 --- a/dep/include/g3dlite/G3D/Vector3.h +++ b/dep/include/g3dlite/G3D/Vector3.h @@ -41,7 +41,6 @@ b = v.xz(); j = b.xx(); </PRE> - <B>Warning</B> Do not subclass-- this implementation makes assumptions about the @@ -160,7 +159,6 @@ public: */ Vector3 fastDirection() const; - /** See also G3D::Ray::reflect. The length is 1. @@ -174,7 +172,6 @@ public: */ Vector3 reflectionDirection(const Vector3& normal) const; - /** Returns Vector3::zero() if the length is nearly zero, otherwise returns a unit vector. @@ -302,7 +299,6 @@ public: */ static Vector3 cosRandom(const Vector3& normal); - /** Random vector distributed over the hemisphere about normal. */ diff --git a/dep/include/g3dlite/G3D/Vector3.inl b/dep/include/g3dlite/G3D/Vector3.inl index e2f328165bb..9211c2a70fd 100644 --- a/dep/include/g3dlite/G3D/Vector3.inl +++ b/dep/include/g3dlite/G3D/Vector3.inl @@ -1,4 +1,4 @@ -/** +/** @file Vector3.inl @maintainer Morgan McGuire, matrix@graphics3d.com @@ -66,7 +66,6 @@ inline float& Vector3::operator[] (int i) { return ((float*)this)[i]; } - //---------------------------------------------------------------------------- inline Vector3& Vector3::operator= (const Vector3& rkVector) { x = rkVector.x; diff --git a/dep/include/g3dlite/G3D/Vector4.inl b/dep/include/g3dlite/G3D/Vector4.inl index 48ebf542723..576cca83b56 100644 --- a/dep/include/g3dlite/G3D/Vector4.inl +++ b/dep/include/g3dlite/G3D/Vector4.inl @@ -1,4 +1,4 @@ -/** +/** @file Vector4.inl @maintainer Morgan McGuire, matrix@graphics3d.com @@ -131,10 +131,9 @@ inline Vector4& Vector4::operator-= (const Vector4& rkVector) { //---------------------------------------------------------------------------- inline Vector4 Vector4::lerp(const Vector4& v, float alpha) const { - return (*this) + (v - *this) * alpha; + return (*this) + (v - *this) * alpha; } - //---------------------------------------------------------------------------- inline Vector4& Vector4::operator*= (float fScalar) { x *= fScalar; @@ -144,7 +143,6 @@ inline Vector4& Vector4::operator*= (float fScalar) { return *this; } - //---------------------------------------------------------------------------- inline float Vector4::dot(const Vector4& rkVector) const { return x*rkVector.x + y*rkVector.y + z*rkVector.z + w*rkVector.w; diff --git a/dep/include/g3dlite/G3D/format.h b/dep/include/g3dlite/G3D/format.h index fd129381791..b2948bfcd25 100644 --- a/dep/include/g3dlite/G3D/format.h +++ b/dep/include/g3dlite/G3D/format.h @@ -51,7 +51,6 @@ std::string vformat( const char* fmt, va_list argPtr) G3D_CHECK_VPRINTF_ARGS; - }; // namespace #endif diff --git a/dep/include/g3dlite/G3D/g3dmath.h b/dep/include/g3dlite/G3D/g3dmath.h index 38ee23fc3c1..ecf355157c1 100644 --- a/dep/include/g3dlite/G3D/g3dmath.h +++ b/dep/include/g3dlite/G3D/g3dmath.h @@ -100,12 +100,10 @@ __inline long int lrintf(float flt) { return (long int)floorf(flt+0.5f); } - #endif #endif - const double fuzzyEpsilon = 0.00001; /** Returns a reference to a static double. @@ -225,7 +223,6 @@ inline int iSign(float f) { return iSign((double)f); } - /** Fast round to integer using the lrint routine. Typically 6x faster than casting to integer. @@ -459,7 +456,6 @@ inline float dot(float a, float b) { return a * b; } - /** a * b (for DirectX/Cg support) */ @@ -478,7 +474,6 @@ inline double rsqrt(double x) { return 1.0 / sqrt(x); } - /** sin(x)/x */ @@ -512,7 +507,6 @@ inline double wrap(double t, double hi) { return wrap(t, 0, hi); } - } // namespace #ifdef _MSC_VER diff --git a/dep/include/g3dlite/G3D/g3dmath.inl b/dep/include/g3dlite/G3D/g3dmath.inl index ad685bc5ce4..9bf661a7ebc 100644 --- a/dep/include/g3dlite/G3D/g3dmath.inl +++ b/dep/include/g3dlite/G3D/g3dmath.inl @@ -1,8 +1,8 @@ /** @file g3dmath.inl - + @maintainer Morgan McGuire, matrix@graphics3d.com - + @created 2001-06-02 @edited 2006-01-14 */ @@ -159,7 +159,6 @@ inline float uniformRandom(float low, float hi) { return (hi - low) * float(::rand()) / float(RAND_MAX) + low; } - //---------------------------------------------------------------------------- inline double G3D_DEPRECATED symmetricRandom () { return 2.0 * double(::rand()) / double(RAND_MAX) - 1.0; diff --git a/dep/include/g3dlite/G3D/platform.h b/dep/include/g3dlite/G3D/platform.h index 16f9b208d18..136413d1d9d 100644 --- a/dep/include/g3dlite/G3D/platform.h +++ b/dep/include/g3dlite/G3D/platform.h @@ -49,7 +49,6 @@ #error Unknown platform #endif - // Default to compiling with SSE, but if you want to compile // without installing SP5.0 and the Processor Pack on Windows, compile with NO_SSE // defined (can be passed to the compiler command line with /D "NO_SSE") @@ -73,7 +72,6 @@ # endif #endif - // Verify that the supported compilers are being used and that this is a known // processor. @@ -102,7 +100,6 @@ # define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0))) #endif - #ifdef G3D_OSX #ifndef __GNUC__ #error G3D only supports the gcc compiler on OS X. @@ -132,7 +129,6 @@ # define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0))) #endif - #ifdef G3D_WIN32 // Microsoft Visual C++ 7.1 _MSC_VER = 1310 // Microsoft Visual C++ 7.0 _MSC_VER = 1300 @@ -234,7 +230,6 @@ # define WIN32_LEAN_AND_MEAN 1 # endif - # define NOMINMAX 1 # include <windows.h> # undef WIN32_LEAN_AND_MEAN diff --git a/dep/include/mersennetwister/MersenneTwister.h b/dep/include/mersennetwister/MersenneTwister.h index 0fbd9242e45..a4a3bbdd415 100644 --- a/dep/include/mersennetwister/MersenneTwister.h +++ b/dep/include/mersennetwister/MersenneTwister.h @@ -80,7 +80,6 @@ protected: uint32 *pNext; // next value to get from state int left; // number of values left before reload needed - //Methods public: MTRand( const uint32& oneSeed ); // initialize with a simple uint32 @@ -218,7 +217,6 @@ inline MTRand::uint32 MTRand::randInt( const uint32& n ) return i; } - inline void MTRand::seed( const uint32 oneSeed ) { // Seed the generator with a simple uint32 @@ -226,7 +224,6 @@ inline void MTRand::seed( const uint32 oneSeed ) reload(); } - inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) { // Seed the generator with an array of uint32's @@ -239,7 +236,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) register int i = 1; register uint32 j = 0; register int k = ( N > int(seedLength) ? N : int(seedLength) ); - for( ; k; --k ) + for (; k; --k ) { state[i] = state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL ); @@ -249,7 +246,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) if( i >= N ) { state[0] = state[N-1]; i = 1; } if( j >= seedLength ) j = 0; } - for( k = N - 1; k; --k ) + for (k = N - 1; k; --k ) { state[i] = state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL ); @@ -262,14 +259,12 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) reload(); } - inline void MTRand::seed() { // Seed the generator with hash of time() and clock() values seed( hash( time(NULL), clock() ) ); } - inline void MTRand::initialize( const uint32 seed ) { // Initialize generator state with seed @@ -280,30 +275,28 @@ inline void MTRand::initialize( const uint32 seed ) register uint32 *r = state; register int i = 1; *s++ = seed & 0xffffffffUL; - for( ; i < N; ++i ) + for (; i < N; ++i ) { *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL; r++; } } - inline void MTRand::reload() { // Generate N new values in state // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) register uint32 *p = state; register int i; - for( i = N - M; i--; ++p ) + for (i = N - M; i--; ++p ) *p = twist( p[M], p[0], p[1] ); - for( i = M; --i; ++p ) + for (i = M; --i; ++p ) *p = twist( p[M-N], p[0], p[1] ); *p = twist( p[M-N], p[0], state[0] ); left = N, pNext = state; } - inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) { // Get a uint32 from t and c @@ -314,14 +307,14 @@ inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) uint32 h1 = 0; unsigned char *p = (unsigned char *) &t; - for( size_t i = 0; i < sizeof(t); ++i ) + for (size_t i = 0; i < sizeof(t); ++i ) { h1 *= UCHAR_MAX + 2U; h1 += p[i]; } uint32 h2 = 0; p = (unsigned char *) &c; - for( size_t j = 0; j < sizeof(c); ++j ) + for (size_t j = 0; j < sizeof(c); ++j ) { h2 *= UCHAR_MAX + 2U; h2 += p[j]; @@ -329,23 +322,21 @@ inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) return ( h1 + differ++ ) ^ h2; } - inline void MTRand::save( uint32* saveArray ) const { register uint32 *sa = saveArray; register const uint32 *s = state; register int i = N; - for( ; i--; *sa++ = *s++ ) {} + for (; i--; *sa++ = *s++ ) {} *sa = left; } - inline void MTRand::load( uint32 *const loadArray ) { register uint32 *s = state; register uint32 *la = loadArray; register int i = N; - for( ; i--; *s++ = *la++ ) {} + for (; i--; *s++ = *la++ ) {} left = *la; pNext = &state[N-left]; } @@ -355,16 +346,15 @@ inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) { register const MTRand::uint32 *s = mtrand.state; register int i = mtrand.N; - for( ; i--; os << *s++ << "\t" ) {} + for (; i--; os << *s++ << "\t" ) {} return os << mtrand.left; } - inline std::istream& operator>>( std::istream& is, MTRand& mtrand ) { register MTRand::uint32 *s = mtrand.state; register int i = mtrand.N; - for( ; i--; is >> *s++ ) {} + for (; i--; is >> *s++ ) {} is >> mtrand.left; mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left]; return is; diff --git a/dep/include/sockets/Base64.h b/dep/include/sockets/Base64.h index b1fd5364fc2..d4323aaa019 100644 --- a/dep/include/sockets/Base64.h +++ b/dep/include/sockets/Base64.h @@ -68,7 +68,6 @@ static const char *bstr; static const char rstr[128]; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Exception.h b/dep/include/sockets/Exception.h index ae48ab765ba..bb881b2d74f 100644 --- a/dep/include/sockets/Exception.h +++ b/dep/include/sockets/Exception.h @@ -29,8 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - - class Exception { public: @@ -48,8 +46,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE { #endif diff --git a/dep/include/sockets/File.h b/dep/include/sockets/File.h index e1d00ec38c7..ed322efa2d8 100644 --- a/dep/include/sockets/File.h +++ b/dep/include/sockets/File.h @@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - /** IFile implementation of a disk file. \ingroup file */ class File : public IFile @@ -74,8 +73,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/IFile.h b/dep/include/sockets/IFile.h index e1e39727b52..657c8a4b1d9 100644 --- a/dep/include/sockets/IFile.h +++ b/dep/include/sockets/IFile.h @@ -62,7 +62,6 @@ public: }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/ISocketHandler.h b/dep/include/sockets/ISocketHandler.h index bb1aa42bafc..940783c104b 100644 --- a/dep/include/sockets/ISocketHandler.h +++ b/dep/include/sockets/ISocketHandler.h @@ -54,7 +54,6 @@ typedef enum { class SocketAddress; class Mutex; - /** Socket container class, event generator. \ingroup basic */ class ISocketHandler @@ -223,7 +222,6 @@ public: }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Ipv4Address.h b/dep/include/sockets/Ipv4Address.h index ba2292425a0..71d925254e9 100644 --- a/dep/include/sockets/Ipv4Address.h +++ b/dep/include/sockets/Ipv4Address.h @@ -26,12 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sockets-config.h" #include "SocketAddress.h" - #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { #endif - /* Ipv4 address implementation. \ingroup basic */ class Ipv4Address : public SocketAddress @@ -89,8 +87,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE { #endif diff --git a/dep/include/sockets/Ipv6Address.h b/dep/include/sockets/Ipv6Address.h index 9bd651786bc..20c68d8c92d 100644 --- a/dep/include/sockets/Ipv6Address.h +++ b/dep/include/sockets/Ipv6Address.h @@ -35,7 +35,6 @@ typedef unsigned __int32 uint32_t; namespace SOCKETS_NAMESPACE { #endif - /** Ipv6 address implementation. \ingroup basic */ class Ipv6Address : public SocketAddress @@ -96,8 +95,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE { #endif diff --git a/dep/include/sockets/ListenSocket.h b/dep/include/sockets/ListenSocket.h index 80aa48f20b4..8934a809d0e 100644 --- a/dep/include/sockets/ListenSocket.h +++ b/dep/include/sockets/ListenSocket.h @@ -51,7 +51,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - /** Binds incoming port number to new Socket class X. \ingroup basic */ template <class X> @@ -410,8 +409,6 @@ private: bool m_bHasCreate; }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Lock.h b/dep/include/sockets/Lock.h index e819537ef26..f3bb9273920 100644 --- a/dep/include/sockets/Lock.h +++ b/dep/include/sockets/Lock.h @@ -50,8 +50,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Mutex.h b/dep/include/sockets/Mutex.h index 8fce2ce08ba..e42a57c3262 100644 --- a/dep/include/sockets/Mutex.h +++ b/dep/include/sockets/Mutex.h @@ -60,7 +60,6 @@ private: #endif }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Parse.h b/dep/include/sockets/Parse.h index 4b42ea768b2..52bd9327e28 100644 --- a/dep/include/sockets/Parse.h +++ b/dep/include/sockets/Parse.h @@ -43,7 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - /***************************************************/ /* interface of class Parse */ @@ -92,7 +91,6 @@ private: bool pa_quote; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/ResolvServer.h b/dep/include/sockets/ResolvServer.h index b713a8ad382..409c9b7a619 100644 --- a/dep/include/sockets/ResolvServer.h +++ b/dep/include/sockets/ResolvServer.h @@ -62,8 +62,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/ResolvSocket.h b/dep/include/sockets/ResolvSocket.h index 38ff3335c28..60743736e08 100644 --- a/dep/include/sockets/ResolvSocket.h +++ b/dep/include/sockets/ResolvSocket.h @@ -95,8 +95,6 @@ private: }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/SctpSocket.h b/dep/include/sockets/SctpSocket.h index 50757fc4b13..ed507fb1880 100644 --- a/dep/include/sockets/SctpSocket.h +++ b/dep/include/sockets/SctpSocket.h @@ -36,7 +36,6 @@ namespace SOCKETS_NAMESPACE { class SocketAddress; - class SctpSocket : public StreamSocket { public: @@ -99,7 +98,6 @@ private: char *m_buf; ///< Temporary receive buffer }; - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE #endif diff --git a/dep/include/sockets/Socket.h b/dep/include/sockets/Socket.h index 8a7fdc9d2fd..23a806b5ea1 100644 --- a/dep/include/sockets/Socket.h +++ b/dep/include/sockets/Socket.h @@ -43,17 +43,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "SocketAddress.h" #include "Thread.h" - #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { #endif - class ISocketHandler; class SocketAddress; class IFile; - /** \defgroup basic Basic sockets */ /** Socket base class. \ingroup basic */ @@ -471,7 +468,6 @@ public: // TCP options in TcpSocket.h/TcpSocket.cpp - #ifdef HAVE_OPENSSL /** @name SSL Support */ //@{ @@ -734,7 +730,6 @@ static WSAInitializer m_winsock_init; ///< Winsock initialization singleton cla } #endif - #endif // _SOCKETS_Socket_H diff --git a/dep/include/sockets/SocketAddress.h b/dep/include/sockets/SocketAddress.h index 496600b112c..abdbbfd2cf6 100644 --- a/dep/include/sockets/SocketAddress.h +++ b/dep/include/sockets/SocketAddress.h @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - /** This class and its subclasses is intended to be used as replacement for the internal data type 'ipaddr_t' and various implementations of @@ -86,8 +85,6 @@ public: }; - - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE { #endif diff --git a/dep/include/sockets/SocketHandler.h b/dep/include/sockets/SocketHandler.h index 1812c9c386f..5598ec4249b 100644 --- a/dep/include/sockets/SocketHandler.h +++ b/dep/include/sockets/SocketHandler.h @@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - class Socket; #ifdef ENABLE_RESOLVER class ResolvServer; @@ -257,7 +256,6 @@ private: #endif }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/StdLog.h b/dep/include/sockets/StdLog.h index 8266479f21c..3ff68d6e9ea 100644 --- a/dep/include/sockets/StdLog.h +++ b/dep/include/sockets/StdLog.h @@ -46,7 +46,6 @@ typedef enum LOG_LEVEL_INFO } loglevel_t; - class ISocketHandler; class Socket; @@ -65,7 +64,6 @@ public: loglevel_t = LOG_LEVEL_WARNING) = 0; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/StdoutLog.h b/dep/include/sockets/StdoutLog.h index aee865be6af..aeb25b3e6e6 100644 --- a/dep/include/sockets/StdoutLog.h +++ b/dep/include/sockets/StdoutLog.h @@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace SOCKETS_NAMESPACE { #endif - /** StdLog implementation, logs to stdout. \ingroup logging */ class StdoutLog : public StdLog @@ -47,8 +46,6 @@ public: }; - - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/StreamSocket.h b/dep/include/sockets/StreamSocket.h index e839040e2b0..bcce10ffbc5 100644 --- a/dep/include/sockets/StreamSocket.h +++ b/dep/include/sockets/StreamSocket.h @@ -3,12 +3,10 @@ #include "Socket.h" - #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { #endif - /** SOCK_STREAM Socket base class. \ingroup basic */ class StreamSocket : public Socket @@ -117,12 +115,10 @@ private: int m_shutdown; ///< Shutdown status }; - #ifdef SOCKETS_NAMESPACE } // namespace SOCKETS_NAMESPACE { #endif - #endif // _StreamSocket_H diff --git a/dep/include/sockets/TcpSocket.h b/dep/include/sockets/TcpSocket.h index 4caeb548aaa..de1be8bd8b9 100644 --- a/dep/include/sockets/TcpSocket.h +++ b/dep/include/sockets/TcpSocket.h @@ -41,14 +41,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TCP_BUFSIZE_READ 16400 #define TCP_OUTPUT_CAPACITY 1024000 - #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { #endif class SocketAddress; - /** Socket implementation for TCP. \ingroup basic */ class TcpSocket : public StreamSocket @@ -349,7 +347,6 @@ static SSLInitializer m_ssl_init; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Thread.h b/dep/include/sockets/Thread.h index e065a257a85..efb766e9ee6 100644 --- a/dep/include/sockets/Thread.h +++ b/dep/include/sockets/Thread.h @@ -91,7 +91,6 @@ private: bool m_b_destructor; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/UdpSocket.h b/dep/include/sockets/UdpSocket.h index fd9965e96e8..3b06c6955bd 100644 --- a/dep/include/sockets/UdpSocket.h +++ b/dep/include/sockets/UdpSocket.h @@ -206,7 +206,6 @@ private: bool m_b_read_ts; }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/Utility.h b/dep/include/sockets/Utility.h index be0f6a05498..724a94e4b32 100644 --- a/dep/include/sockets/Utility.h +++ b/dep/include/sockets/Utility.h @@ -177,7 +177,6 @@ private: static bool m_local_resolved; ///< ResolveLocal has been called if true }; - #ifdef SOCKETS_NAMESPACE } #endif diff --git a/dep/include/sockets/socket_include.h b/dep/include/sockets/socket_include.h index dcfd4acfbd6..89855a54108 100644 --- a/dep/include/sockets/socket_include.h +++ b/dep/include/sockets/socket_include.h @@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. in read operations - helps on ECOS */ #define SOCKETS_DYNAMIC_TEMP - // platform specific stuff #if (defined(__unix__) || defined(unix)) && !defined(USG) #include <sys/param.h> @@ -81,7 +80,6 @@ typedef int SOCKET; namespace SOCKETS_NAMESPACE { #endif - // WIN32 adapt #define closesocket close #define INVALID_SOCKET -1 @@ -97,14 +95,12 @@ namespace SOCKETS_NAMESPACE { #endif // !_WIN32 - // ---------------------------------------- // Generic #ifndef SOL_IP #define SOL_IP IPPROTO_IP #endif - // ---------------------------------------- // OS specific adaptions @@ -151,13 +147,13 @@ namespace SOCKETS_NAMESPACE { # endif #elif defined (__NetBSD__) || defined (__OpenBSD__) -# if !defined(MSG_NOSIGNAL) -# define MSG_NOSIGNAL 0 -# endif -# include <netinet/in.h> -typedef in_addr_t ipaddr_t; -typedef in_port_t port_t; -#elif defined MACOSX +# if !defined(MSG_NOSIGNAL) +# define MSG_NOSIGNAL 0 +# endif +# include <netinet/in.h> +typedef in_addr_t ipaddr_t; +typedef in_port_t port_t; +#elif defined MACOSX // ---------------------------------------- // Mac OS X #include <string.h> @@ -219,7 +215,6 @@ namespace SOCKETS_NAMESPACE { #endif #endif // _MSC_VER < 1200 - #define MSG_NOSIGNAL 0 //#define SHUT_RDWR 2 #define SHUT_WR 1 @@ -231,7 +226,6 @@ const char *StrError(int x); namespace SOCKETS_NAMESPACE { #endif - // class WSAInitializer is a part of the Socket class (on win32) // as a static instance - so whenever an application uses a Socket, // winsock is initialized @@ -269,7 +263,6 @@ namespace SOCKETS_NAMESPACE { } #endif - #endif #ifdef SOCKETS_NAMESPACE @@ -278,12 +271,10 @@ namespace SOCKETS_NAMESPACE { /** List type containing file descriptors. */ typedef std::list<SOCKET> socket_v; - #ifdef SOCKETS_NAMESPACE } #endif - // getaddrinfo / getnameinfo replacements #ifdef NO_GETADDRINFO #ifndef AI_NUMERICHOST @@ -294,7 +285,6 @@ namespace SOCKETS_NAMESPACE { #endif #endif - #endif // _SOCKETS_socket_include_H diff --git a/dep/include/sockets/sockets-config.h b/dep/include/sockets/sockets-config.h index 464ed34cabb..1c8dc439092 100644 --- a/dep/include/sockets/sockets-config.h +++ b/dep/include/sockets/sockets-config.h @@ -46,57 +46,45 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* OpenSSL support. */ //#define HAVE_OPENSSL - /* Ipv6 support. */ //#define ENABLE_IPV6 - /* SCTP support. */ //#define USE_SCTP - /* Define NO_GETADDRINFO if your operating system does not support the "getaddrinfo" and "getnameinfo" function calls. */ #define NO_GETADDRINFO - /* Connection pool support. */ #define ENABLE_POOL - /* Socks4 client support. */ //#define ENABLE_SOCKS4 - /* Asynchronous resolver. */ #define ENABLE_RESOLVER - /* Enable TCP reconnect on lost connection. Socket::OnReconnect Socket::OnDisconnect */ #define ENABLE_RECONNECT - /* Enable socket thread detach functionality. */ #define ENABLE_DETACH - /* Enable socket to socket triggers. Not yet in use. */ //#define ENABLE_TRIGGERS - /* Enabled exceptions. */ //#define ENABLE_EXCEPTIONS - /* Resolver uses the detach function so either enable both or disable both. */ #ifndef ENABLE_DETACH #undef ENABLE_RESOLVER #endif - #endif // _SOCKETS_CONFIG_H |
