diff options
author | Brian Paul <[email protected]> | 2011-11-11 07:30:18 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-11-15 07:49:25 -0700 |
commit | 6d68855df133bdd4891e8aa428787b520739e0fe (patch) | |
tree | 4d242ff9bbbc094774792440ae25cff47346568f /src/mesa/main/pack.c | |
parent | cc502aa9419a6fb127b264dbb131c786281cb8c7 (diff) |
mesa: replace GLstencil with GLubyte
Diffstat (limited to 'src/mesa/main/pack.c')
-rw-r--r-- | src/mesa/main/pack.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 539a06c9a07..de29395b0fe 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -4586,10 +4586,10 @@ _mesa_unpack_stencil_span( struct gl_context *ctx, GLuint n, void _mesa_pack_stencil_span( struct gl_context *ctx, GLuint n, - GLenum dstType, GLvoid *dest, const GLstencil *source, + GLenum dstType, GLvoid *dest, const GLubyte *source, const struct gl_pixelstore_attrib *dstPacking ) { - GLstencil *stencil = (GLstencil *) malloc(n * sizeof(GLstencil)); + GLubyte *stencil = (GLubyte *) malloc(n * sizeof(GLubyte)); if (!stencil) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "stencil packing"); @@ -4599,23 +4599,14 @@ _mesa_pack_stencil_span( struct gl_context *ctx, GLuint n, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { /* make a copy of input */ - memcpy(stencil, source, n * sizeof(GLstencil)); + memcpy(stencil, source, n * sizeof(GLubyte)); _mesa_apply_stencil_transfer_ops(ctx, n, stencil); source = stencil; } switch (dstType) { case GL_UNSIGNED_BYTE: - if (sizeof(GLstencil) == 1) { - memcpy( dest, source, n ); - } - else { - GLubyte *dst = (GLubyte *) dest; - GLuint i; - for (i=0;i<n;i++) { - dst[i] = (GLubyte) source[i]; - } - } + memcpy(dest, source, n); break; case GL_BYTE: { @@ -5120,11 +5111,11 @@ void _mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n, GLenum dstType, GLuint *dest, const GLfloat *depthVals, - const GLstencil *stencilVals, + const GLubyte *stencilVals, const struct gl_pixelstore_attrib *dstPacking) { GLfloat *depthCopy = (GLfloat *) malloc(n * sizeof(GLfloat)); - GLstencil *stencilCopy = (GLstencil *) malloc(n * sizeof(GLstencil)); + GLubyte *stencilCopy = (GLubyte *) malloc(n * sizeof(GLubyte)); GLuint i; if (!depthCopy || !stencilCopy) { @@ -5143,7 +5134,7 @@ _mesa_pack_depth_stencil_span(struct gl_context *ctx,GLuint n, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { - memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); + memcpy(stencilCopy, stencilVals, n * sizeof(GLubyte)); _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy); stencilVals = stencilCopy; } |