aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress_fxt1.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-04-02 14:47:58 +0000
committermarha <marha@users.sourceforge.net>2010-04-02 14:47:58 +0000
commit7933658107276f9d5491f8736a743cf8f8bbd5f2 (patch)
treef2893a761364e7abc9d934e9c5427e5cf5190c7a /mesalib/src/mesa/main/texcompress_fxt1.c
parent83fa9a9811e2c18cffd83a020757f7fb51ffddaa (diff)
downloadvcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.gz
vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.bz2
vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.zip
Updated to following packages:
mesa-7.8
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_fxt1.c')
-rw-r--r--mesalib/src/mesa/main/texcompress_fxt1.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c
index 85becb80d..04acf05e5 100644
--- a/mesalib/src/mesa/main/texcompress_fxt1.c
+++ b/mesalib/src/mesa/main/texcompress_fxt1.c
@@ -105,7 +105,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
dst, dstRowStride);
if (tempImage)
- _mesa_free((void*) tempImage);
+ free((void*) tempImage);
return GL_TRUE;
}
@@ -162,7 +162,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
dst, dstRowStride);
if (tempImage)
- _mesa_free((void*) tempImage);
+ free((void*) tempImage);
return GL_TRUE;
}
@@ -406,7 +406,7 @@ fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv,
} hist[N_TEXELS];
GLint lenh = 0;
- _mesa_memset(hist, 0, sizeof(hist));
+ memset(hist, 0, sizeof(hist));
for (k = 0; k < n; k++) {
GLint l;
@@ -476,7 +476,7 @@ fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv,
* for each sample color
* sort to nearest vector.
*
- * replace each vector with the centroid of it's matching colors.
+ * replace each vector with the centroid of its matching colors.
*
* repeat until RMS doesn't improve.
*
@@ -528,6 +528,7 @@ fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv,
#else
GLint best = fxt1_bestcol(vec, nv, input[k], nc, &err);
#endif
+ assert(best >= 0);
/* add in closest color */
for (i = 0; i < nc; i++) {
sum[best][i] += input[k][i];
@@ -1211,7 +1212,7 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps)
if (comps == 3) {
/* make the whole block opaque */
- _mesa_memset(input, -1, sizeof(input));
+ memset(input, -1, sizeof(input));
}
/* 8 texels each line */
@@ -1305,7 +1306,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
if ((width & 7) | (height & 3)) {
GLint newWidth = (width + 7) & ~7;
GLint newHeight = (height + 3) & ~3;
- newSource = _mesa_malloc(comps * newWidth * newHeight * sizeof(GLchan));
+ newSource = malloc(comps * newWidth * newHeight * sizeof(GLchan));
if (!newSource) {
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression");
@@ -1324,7 +1325,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
if (CHAN_TYPE != GL_UNSIGNED_BYTE) {
const GLuint n = width * height * comps;
const GLchan *src = (const GLchan *) source;
- GLubyte *dest = (GLubyte *) _mesa_malloc(n * sizeof(GLubyte));
+ GLubyte *dest = (GLubyte *) malloc(n * sizeof(GLubyte));
GLuint i;
if (!dest) {
GET_CURRENT_CONTEXT(ctx);
@@ -1335,7 +1336,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
dest[i] = CHAN_TO_UBYTE(src[i]);
}
if (newSource != NULL) {
- _mesa_free(newSource);
+ free(newSource);
}
newSource = dest; /* we'll free this buffer before returning */
source = dest; /* the new, GLubyte incoming image */
@@ -1361,7 +1362,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
cleanUp:
if (newSource != NULL) {
- _mesa_free(newSource);
+ free(newSource);
}
}