aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/G3D-v9.0 hotfix15.diff
blob: d385def554a066307197cbdf002e9acb0964db58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
diff --git a/dep/g3dlite/include/G3D/AABox.h b/dep/g3dlite/include/G3D/AABox.h
index 7a47ea63aa..97a47cf986 100644
--- a/dep/g3dlite/include/G3D/AABox.h
+++ b/dep/g3dlite/include/G3D/AABox.h
@@ -17,14 +17,14 @@
 
 #include "G3D/platform.h"
 #include "G3D/debug.h"
-#include "G3D/Array.h"
-#include "G3D/Plane.h"
-#include "G3D/Sphere.h"
 #include "G3D/Vector3.h"
 
 namespace G3D {
 
 class Any;
+template <class T, size_t MIN_ELEMENTS> class Array;
+class Plane;
+class Sphere;
 
 /**
  An axis-aligned box.
@@ -221,7 +221,7 @@ public:
        
      */
     bool culledBy
-    (const Array<Plane>&    plane,
+    (const Array<Plane, 10>&    plane,
      int32&            cullingPlaneIndex,
      const uint32          testMask,
      uint32&                    childMask) const;
@@ -230,7 +230,7 @@ public:
      Conservative culling test that does not produce a mask for children.
      */
     bool culledBy
-    (const Array<Plane>&        plane,
+    (const Array<Plane, 10>&        plane,
      int32&                        cullingPlaneIndex = dummy,
      const uint32               testMask  = 0xFFFFFFFF) const;
 
diff --git a/dep/g3dlite/include/G3D/AtomicInt32.h b/dep/g3dlite/include/G3D/AtomicInt32.h
index 9824d426d7..51561e3dcc 100644
--- a/dep/g3dlite/include/G3D/AtomicInt32.h
+++ b/dep/g3dlite/include/G3D/AtomicInt32.h
@@ -12,7 +12,9 @@
 #include "G3D/platform.h"
 #include "G3D/g3dmath.h"
 
-#if defined(G3D_OSX)
+#if defined(G3D_WINDOWS)
+#   include <Windows.h>
+#elif defined(G3D_OSX)
 #   include <libkern/OSAtomic.h>
 #endif
 
diff --git a/dep/g3dlite/include/G3D/HashTrait.h b/dep/g3dlite/include/G3D/HashTrait.h
index 1de3777bae..6199f4504e 100644
--- a/dep/g3dlite/include/G3D/HashTrait.h
+++ b/dep/g3dlite/include/G3D/HashTrait.h
@@ -13,7 +13,6 @@
 #define G3D_HashTrait_h
 
 #include "G3D/platform.h"
-#include "G3D/Crypto.h"
 #include "G3D/g3dmath.h"
 #include "G3D/uint128.h"
 #include <typeinfo>
diff --git a/dep/g3dlite/include/G3D/Random.h b/dep/g3dlite/include/G3D/Random.h
index 9d911806a9..359755044a 100644
--- a/dep/g3dlite/include/G3D/Random.h
+++ b/dep/g3dlite/include/G3D/Random.h
@@ -159,6 +159,7 @@ public:
     static Random& common();
 };
 
+Random& commonRandom();
 }
 
 #endif
diff --git a/dep/g3dlite/include/G3D/System.h b/dep/g3dlite/include/G3D/System.h
index 9ed88957d7..81c83527c9 100644
--- a/dep/g3dlite/include/G3D/System.h
+++ b/dep/g3dlite/include/G3D/System.h
@@ -21,6 +21,10 @@
 #include "G3D/FileNotFound.h"
 #include <string>
 
+#ifdef G3D_WINDOWS
+#include <Windows.h>
+#endif
+
 #if defined(__aarch64__)
 #include <sys/time.h>
 #endif
diff --git a/dep/g3dlite/include/G3D/Vector2.h b/dep/g3dlite/include/G3D/Vector2.h
index 65cf7fa8f2..696889d630 100644
--- a/dep/g3dlite/include/G3D/Vector2.h
+++ b/dep/g3dlite/include/G3D/Vector2.h
@@ -19,20 +19,21 @@
 
 #include "G3D/platform.h"
 #include "G3D/g3dmath.h"
-#include "G3D/Table.h"
 #include "G3D/HashTrait.h"
 #include "G3D/Vector2int16.h"
 #include "G3D/Vector2unorm16.h"
-#include "G3D/Random.h"
 
 namespace G3D {
 
+class Random;
 class Vector2;    
 class Vector3;
 class Vector4;
 class Vector2int32;
 class Any;
 
+Random& commonRandom();
+
 /**
  Do not subclass-- this implementation makes assumptions about the
  memory layout.
@@ -210,7 +211,7 @@ public:
     }
 
     /** Uniformly distributed random vector on the unit sphere */
-    static Vector2 random(Random& r = Random::common());
+    static Vector2 random(Random& r = commonRandom());
 
     // Special values.
     // Intentionally not inlined: see Matrix3::identity() for details.
diff --git a/dep/g3dlite/include/G3D/Vector3.h b/dep/g3dlite/include/G3D/Vector3.h
index 05d9b11ed5..c79f70b916 100644
--- a/dep/g3dlite/include/G3D/Vector3.h
+++ b/dep/g3dlite/include/G3D/Vector3.h
@@ -17,9 +17,7 @@
 
 #include "G3D/platform.h"
 #include "G3D/g3dmath.h"
-#include "G3D/Random.h"
 #include "G3D/Vector2.h"
-#include "G3D/Table.h"
 #include "G3D/HashTrait.h"
 #include "G3D/PositionTrait.h"
 #include "G3D/Vector2.h"
@@ -365,7 +363,7 @@ public:
        Distribution rendered by G3D::DirectionHistogram:
        \image html vector3-random.png
       */
-    static Vector3 random(Random& r = Random::common());
+    static Vector3 random(Random& r = commonRandom());
 
     /** \brief Random unit vector, distributed according to \f$\max(\cos \theta,0)\f$.
 
@@ -380,9 +378,9 @@ public:
 
         @cite Henrik Wann Jensen, Realistic Image Synthesis using Photon Mapping eqn 2.24
     */
-    static Vector3 cosHemiRandom(const Vector3& n, Random& r = Random::common());
+    static Vector3 cosHemiRandom(const Vector3& n, Random& r = commonRandom());
 
-    static Vector3 cosSphereRandom(const Vector3& n, Random& r = Random::common());
+    static Vector3 cosSphereRandom(const Vector3& n, Random& r = commonRandom());
 
     /** \brief Random unit vector, distributed according to \f$\max(\cos^k \theta,0)\f$.
 
@@ -397,7 +395,7 @@ public:
 
         @cite Ashikhmin and Shirley, An anisotropic Phong BRDF model, Journal of Graphics Tools, 2002
     */
-    static Vector3 cosPowHemiRandom(const Vector3& n, const float k, Random& r = Random::common());
+    static Vector3 cosPowHemiRandom(const Vector3& n, const float k, Random& r = commonRandom());
 
     /**
      \brief Random vector distributed over the hemisphere about normal.
@@ -405,7 +403,7 @@ public:
      Distribution rendered by G3D::DirectionHistogram:
       \image html vector3-hemirandom.png
      */
-    static Vector3 hemiRandom(const Vector3& normal, Random& r = Random::common());
+    static Vector3 hemiRandom(const Vector3& normal, Random& r = commonRandom());
 
     inline float sum() const {
         return x + y + z;
diff --git a/dep/g3dlite/include/G3D/Vector4.h b/dep/g3dlite/include/G3D/Vector4.h
index 24521efc93..0f0ea459df 100644
--- a/dep/g3dlite/include/G3D/Vector4.h
+++ b/dep/g3dlite/include/G3D/Vector4.h
@@ -19,7 +19,6 @@
 #include "G3D/g3dmath.h"
 #include "G3D/Vector3.h"
 #include "G3D/Vector2.h"
-#include "G3D/Table.h"
 #include "G3D/HashTrait.h"
 #include "G3D/PositionTrait.h"
 #include <string>
diff --git a/dep/g3dlite/include/G3D/debugAssert.h b/dep/g3dlite/include/G3D/debugAssert.h
index edff671061..197312bd12 100644
--- a/dep/g3dlite/include/G3D/debugAssert.h
+++ b/dep/g3dlite/include/G3D/debugAssert.h
@@ -32,6 +32,7 @@
 #include <cstdlib>

 #ifdef _MSC_VER
+#include <intrin.h>
 // conditional expression is constant
 #   pragma warning (disable : 4127)
 #endif
@@ -116,7 +117,7 @@ namespace _internal {
 #ifdef G3D_DEBUG

 #    if defined(_MSC_VER)
-#       define rawBreak()  ::DebugBreak();
+#       define rawBreak()  ::__debugbreak();
 #    elif defined(__i386__)
         // gcc on intel
 #       define rawBreak() __asm__ __volatile__ ( "int $3" );
diff --git a/dep/g3dlite/include/G3D/platform.h b/dep/g3dlite/include/G3D/platform.h
index d043f21491..9202fe41d0 100644
--- a/dep/g3dlite/include/G3D/platform.h
+++ b/dep/g3dlite/include/G3D/platform.h
@@ -190,6 +190,7 @@ These control the version of Winsock used by G3D.
     //  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_Compiler_Reference.asp
     //
 
+#if 0
     // DLL runtime
     #ifndef _DLL
         #define _DLL
@@ -227,6 +228,8 @@ These control the version of Winsock used by G3D.
 #   undef WIN32_LEAN_AND_MEAN
 #   undef NOMINMAX
 
+#endif // 0
+
 #   ifdef _G3D_INTERNAL_HIDE_WINSOCK_
 #      undef _G3D_INTERNAL_HIDE_WINSOCK_
 #      undef _WINSOCKAPI_
diff --git a/dep/g3dlite/source/Random.cpp b/dep/g3dlite/source/Random.cpp
index cbfa07dec0..a31d52a557 100644
--- a/dep/g3dlite/source/Random.cpp
+++ b/dep/g3dlite/source/Random.cpp
@@ -227,4 +227,9 @@ void Random::sphere(float& x, float& y, float& z) {
     z *= s;
 }
 
+Random& commonRandom()
+{
+    return Random::common();
+}
+
 } // G3D
diff --git a/dep/g3dlite/source/Vector2.cpp b/dep/g3dlite/source/Vector2.cpp
index a6edea9a83..194cd3090d 100644
--- a/dep/g3dlite/source/Vector2.cpp
+++ b/dep/g3dlite/source/Vector2.cpp
@@ -23,6 +23,7 @@
 #include "G3D/TextInput.h"
 #include "G3D/TextOutput.h"
 #include "G3D/Any.h"
+#include "G3D/Random.h"
 
 namespace G3D {
 
diff --git a/dep/g3dlite/source/Vector3.cpp b/dep/g3dlite/source/Vector3.cpp
index e2d9643e5c..ccbf7d6a0b 100644
--- a/dep/g3dlite/source/Vector3.cpp
+++ b/dep/g3dlite/source/Vector3.cpp
@@ -28,6 +28,7 @@
 #include "G3D/Vector4.h"
 #include "G3D/Vector3int32.h"
 #include "G3D/Any.h"
+#include "G3D/Random.h"
  
 namespace G3D {
 
diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp
index 3c3e43a0af..ff843fb7ee 100644
--- a/dep/g3dlite/source/debugAssert.cpp
+++ b/dep/g3dlite/source/debugAssert.cpp
@@ -23,6 +23,7 @@
 #include <cstdlib>
 
 #ifdef _MSC_VER
+#include <Windows.h>
     // disable: "C++ exception handler used"
 #   pragma warning (push)
 #   pragma warning (disable : 4530)