]> git.wh0rd.org - ICEs.git/blame - 195695/xorg.i.3
initial import
[ICEs.git] / 195695 / xorg.i.3
CommitLineData
45516216 1typedef void GLvoid;
2typedef int GLint;
3typedef unsigned char GLubyte;
4typedef unsigned int GLuint;
5typedef float GLfloat;
6typedef GLubyte GLchan;
7static void fxt1_encode(void);
8static void texstore_rgba_fxt1(void)
9{
10 fxt1_encode();
11}
12struct {
13 void (*foo)(void);
14} structfoo = { texstore_rgba_fxt1 };
15typedef unsigned long long Fx64;
16static void fxt1_quantize_ALPHA1(void)
17{
18 GLuint * cc;
19 GLubyte input[32][4];
20 const GLint n_vect = 3;
21 const GLint n_comp = 4;
22 GLfloat vec[1 + 1 + 1][4];
23 GLint i, j, k;
24 Fx64 hi;
25 GLint j1, j2;
26 GLint v1 = 0, v2 = 0;
27 GLfloat err = 1e9;
28 GLfloat tv[2 * 2][4];
29 for (i = 0; i < n_comp; i++) {
30 }
31 for (j1 = 0; j1 < 2; j1++) {
32 for (j2 = 2; j2 < 4; j2++) {
33 GLfloat e = 0.0F;
34 for (i = 0; i < n_comp; i++) {
35 e += (tv[j1][i] -
36 tv[j2][i]) * (tv[j1][i] -
37 tv[j2][i]);
38 }
39 if (e < err) {
40 v1 = j1;
41 }
42 }
43 }
44 for (i = 0; i < n_comp; i++) {
45 vec[0][i] = tv[1 - v1][i];
46 }
47 for (j = n_vect - 1; j >= 0; j--) {
48 for (i = 0; i < n_comp - 1; i++) {
49 hi |= (GLuint) (vec[j][i] / 8.0F);
50 }
51 }
52 ((Fx64 *) cc)[1] = hi;
53}
54static void fxt1_quantize(void)
55{
56 GLint k;
57 for (k = 0; k < 4; k++)
58 fxt1_quantize_ALPHA1();
59}
60static void fxt1_encode(void)
61{
62 fxt1_quantize();
63}