typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef void GLvoid; typedef int GLint; typedef unsigned char GLubyte; typedef unsigned int GLuint; typedef float GLfloat; typedef GLubyte GLchan; typedef void (*FetchTexelFuncF) (const struct gl_texture_image * texImage, GLint col, GLint row, GLint img, GLfloat * texelOut); typedef void (*StoreTexelFunc) (struct gl_texture_image * texImage, GLint col, GLint row, GLint img, const void *texel); struct gl_texture_format { GLint MesaFormat; GLenum BaseFormat; GLenum DataType; GLubyte RedBits; GLubyte GreenBits; GLubyte BlueBits; GLubyte AlphaBits; GLubyte LuminanceBits; GLubyte IntensityBits; GLubyte IndexBits; GLubyte DepthBits; GLubyte StencilBits; FetchTexelFuncF FetchTexel3Df; StoreTexelFunc StoreTexel; }; static void fxt1_encode(void); static GLboolean texstore_rgba_fxt1(GLuint dims, GLenum baseInternalFormat, const struct gl_texture_format *dstFormat, GLvoid * dstAddr, GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, GLint dstRowStride, const GLuint * dstImageOffsets, GLint srcWidth, GLint srcHeight, GLint srcDepth, GLenum srcFormat, GLenum srcType, const GLvoid * srcAddr, const struct gl_pixelstore_attrib *srcPacking) { fxt1_encode(); } static void fetch_texel_2d_rgba_fxt1(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan * texel) { } static void fetch_texel_2d_f_rgba_fxt1(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat * texel) { } const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { 0, 0x1908, 0x8C17, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, texstore_rgba_fxt1, 0, fetch_texel_2d_rgba_fxt1, 0, 0, fetch_texel_2d_f_rgba_fxt1, 0, 0 }; typedef unsigned long long Fx64; static void fxt1_quantize_CHROMA(GLuint * cc, GLubyte input[32][4]) { const GLint n_vect = 4; GLint i, j, k; for (j = n_vect - 1; k >= 32 / 2; k--) { } } static void fxt1_quantize_ALPHA1(GLuint * cc, GLubyte input[32][4]) { const GLint n_vect = 3; const GLint n_comp = 4; GLfloat vec[1 + 1 + 1][4]; GLint i, j, k; Fx64 hi; GLint j1, j2; GLint v1 = 0, v2 = 0; GLfloat err = 1e9; GLfloat tv[2 * 2][4]; for (i = 0; i < n_comp; i++) { } for (j1 = 0; j1 < 2; j1++) { for (j2 = 2; j2 < 4; j2++) { GLfloat e = 0.0F; for (i = 0; i < n_comp; i++) { e += (tv[j1][i] - tv[j2][i]) * (tv[j1][i] - tv[j2][i]); } if (e < err) { v1 = j1; } } } for (i = 0; i < n_comp; i++) { vec[0][i] = tv[1 - v1][i]; } for (j = n_vect - 1; j >= 0; j--) { for (i = 0; i < n_comp - 1; i++) { hi |= (GLuint) (vec[j][i] / 8.0F); } } ((Fx64 *) cc)[1] = hi; } static void fxt1_quantize(GLuint * cc, const GLubyte * lines[], GLint comps) { GLubyte input[32][4]; GLint i; GLint k; GLint l; for (l = 0; l < 4; l++) { for (k = 0; k < 4; k++) { for (i = 0; i < comps; i++) { } } fxt1_quantize_ALPHA1(cc, input); } } static void fxt1_encode(void) { fxt1_quantize(0, 0, 0); }