summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-05-10 17:30:44 -0600
committerBrian <[email protected]>2007-05-10 17:30:44 -0600
commitaed53ba525e4a105a5e817786fa6346d64ad81a6 (patch)
tree957688fec15876e98323e0785df5b1b387719b70 /src
parent3dec7c57b0159a4d8fbb980de73264ef8b8a3720 (diff)
re-indent some code
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/image.c116
1 files changed, 62 insertions, 54 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 2220e39f7d7..8f890b57d6c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.0
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -4263,60 +4263,68 @@ _mesa_unpack_image( GLuint dimensions,
const GLvoid *src = _mesa_image_address(dimensions, unpack, pixels,
width, height, format, type, img, row, 0);
- if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) {
- GLint i;
- flipBytes = GL_FALSE;
- if (unpack->LsbFirst) {
- GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
- *d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 128) {
- srcMask = 1;
- s++;
- } else {
- srcMask = srcMask << 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- } else {
- dstMask = dstMask >> 1;
- }
- }
- } else {
- GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7);
- GLubyte dstMask = 128;
- const GLubyte *s = src;
- GLubyte *d = dst;
+ if ((type == GL_BITMAP) && (unpack->SkipPixels & 0x7)) {
+ GLint i;
+ flipBytes = GL_FALSE;
+ if (unpack->LsbFirst) {
+ GLubyte srcMask = 1 << (unpack->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 128) {
+ srcMask = 1;
+ s++;
+ }
+ else {
+ srcMask = srcMask << 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
+ *d = 0;
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ else {
+ GLubyte srcMask = 128 >> (unpack->SkipPixels & 0x7);
+ GLubyte dstMask = 128;
+ const GLubyte *s = src;
+ GLubyte *d = dst;
+ *d = 0;
+ for (i = 0; i < width; i++) {
+ if (*s & srcMask) {
+ *d |= dstMask;
+ }
+ if (srcMask == 1) {
+ srcMask = 128;
+ s++;
+ }
+ else {
+ srcMask = srcMask >> 1;
+ }
+ if (dstMask == 1) {
+ dstMask = 128;
+ d++;
*d = 0;
- for (i = 0; i < width; i++) {
- if (*s & srcMask) {
- *d |= dstMask;
- }
- if (srcMask == 1) {
- srcMask = 128;
- s++;
- } else {
- srcMask = srcMask >> 1;
- }
- if (dstMask == 1) {
- dstMask = 128;
- d++;
- *d = 0;
- } else {
- dstMask = dstMask >> 1;
- }
- }
- }
- } else
- _mesa_memcpy(dst, src, bytesPerRow);
+ }
+ else {
+ dstMask = dstMask >> 1;
+ }
+ }
+ }
+ }
+ else {
+ _mesa_memcpy(dst, src, bytesPerRow);
+ }
+
/* byte flipping/swapping */
if (flipBytes) {
flip_bytes((GLubyte *) dst, bytesPerRow);