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
|
--- ./src/egl/opengles2/es2gears.c.orig
+++ ./src/egl/opengles2/es2gears.c
@@ -109,13 +109,15 @@
c[4] = 1;
v = gear->vertices;
for (i = 0; i < teeth; i++) {
+ GLint j;
s[0] = s[4];
c[0] = c[4];
- sincos(i * 2.0 * M_PI / teeth + da, &s[1], &c[1]);
- sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]);
- sincos(i * 2.0 * M_PI / teeth + da * 3, &s[3], &c[3]);
- sincos(i * 2.0 * M_PI / teeth + da * 4, &s[4], &c[4]);
+ for (j=1; j <=4; j++) {
+ s[j] = sin(i * 2.0 * M_PI / teeth + da * j);
+ c[j] = cos(i * 2.0 * M_PI / teeth + da * j);
+ }
+
normal[0] = 0.0;
normal[1] = 0.0;
normal[2] = 1.0;
@@ -199,7 +201,8 @@
{
double s, c;
- sincos(angle, &s, &c);
+ s = sin(angle);
+ c = cos(angle);
GLfloat r[16] = {
x * x * (1 - c) + c, y * x * (1 - c) + z * s, x * z * (1 - c) - y * s, 0,
x * y * (1 - c) - z * s, y * y * (1 - c) + c, y * z * (1 - c) + x * s, 0,
|