6
6
#define FUNCTION
7
7
#endif
8
8
9
- FUNCTION static unsigned int FNVHash (char * str , unsigned int length ) {
9
+ FUNCTION unsigned int FNVHash (char * str , unsigned int length ) {
10
10
const unsigned int fnv_prime = 0x811C9DC5 ;
11
11
unsigned int hash = 0 ;
12
12
unsigned int i = 0 ;
@@ -20,31 +20,31 @@ FUNCTION static unsigned int FNVHash(char* str, unsigned int length) {
20
20
return hash ;
21
21
}
22
22
23
- FUNCTION static unsigned int nrand (unsigned int * rng ) {
23
+ FUNCTION unsigned int nrand (unsigned int * rng ) {
24
24
unsigned int orand = * rng ;
25
25
* rng = FNVHash ((char * ) & orand , 4 );
26
26
return * rng ;
27
27
}
28
28
29
- FUNCTION static Scalar drand48 (Ctx * ctx ) {
29
+ FUNCTION Scalar drand48 (Ctx * ctx ) {
30
30
Scalar n = (nrand (& ctx -> rng ) / 65536.0f );
31
31
n = n - floorf (n );
32
32
return n ;
33
33
}
34
34
35
- FUNCTION static Scalar vdot (vec v0 , vec v1 )
35
+ FUNCTION Scalar vdot (vec v0 , vec v1 )
36
36
{
37
37
return v0 .x * v1 .x + v0 .y * v1 .y + v0 .z * v1 .z ;
38
38
}
39
39
40
- FUNCTION static void vcross (vec * c , vec v0 , vec v1 )
40
+ FUNCTION void vcross (vec * c , vec v0 , vec v1 )
41
41
{
42
42
c -> x = v0 .y * v1 .z - v0 .z * v1 .y ;
43
43
c -> y = v0 .z * v1 .x - v0 .x * v1 .z ;
44
44
c -> z = v0 .x * v1 .y - v0 .y * v1 .x ;
45
45
}
46
46
47
- FUNCTION static void vnormalize (vec * c )
47
+ FUNCTION void vnormalize (vec * c )
48
48
{
49
49
Scalar length = sqrtf (vdot ((* c ), (* c )));
50
50
@@ -55,7 +55,7 @@ FUNCTION static void vnormalize(vec *c)
55
55
}
56
56
}
57
57
58
- FUNCTION static void
58
+ FUNCTION void
59
59
ray_sphere_intersect (Isect * isect , const Ray * ray , const Sphere * sphere )
60
60
{
61
61
vec rs = { 0 };
@@ -88,7 +88,7 @@ ray_sphere_intersect(Isect *isect, const Ray *ray, const Sphere *sphere)
88
88
}
89
89
}
90
90
91
- FUNCTION static void
91
+ FUNCTION void
92
92
ray_plane_intersect (Isect * isect , const Ray * ray , const Plane * plane )
93
93
{
94
94
Scalar d = - vdot (plane -> p , plane -> n );
@@ -110,7 +110,7 @@ ray_plane_intersect(Isect *isect, const Ray *ray, const Plane *plane)
110
110
}
111
111
}
112
112
113
- FUNCTION static void
113
+ FUNCTION void
114
114
orthoBasis (vec * basis , vec n )
115
115
{
116
116
basis [2 ] = n ;
@@ -133,7 +133,7 @@ orthoBasis(vec *basis, vec n)
133
133
vnormalize (& basis [1 ]);
134
134
}
135
135
136
- FUNCTION static void ambient_occlusion (Ctx * ctx , vec * col , const Isect * isect )
136
+ FUNCTION void ambient_occlusion (Ctx * ctx , vec * col , const Isect * isect )
137
137
{
138
138
int i , j ;
139
139
int ntheta = NAO_SAMPLES ;
@@ -193,7 +193,7 @@ FUNCTION static void ambient_occlusion(Ctx* ctx, vec *col, const Isect *isect)
193
193
col -> z = occlusion ;
194
194
}
195
195
196
- FUNCTION static unsigned char aobench_clamp (Scalar f )
196
+ FUNCTION unsigned char aobench_clamp (Scalar f )
197
197
{
198
198
Scalar s = (f * 255.5f );
199
199
0 commit comments