Depth4Image.st
changeset 2215 f7183f306690
parent 2203 49d06f1c9fe2
child 2225 8fb244eaaf90
--- a/Depth4Image.st	Sat Aug 01 15:53:25 1998 +0200
+++ b/Depth4Image.st	Sat Aug 01 15:53:48 1998 +0200
@@ -234,8 +234,13 @@
 #ifdef MSBFIRST
                 ((short *)dstPtr)[0] = v;
 #else
+# ifdef SWAP_BYTES
+		SWAP_BYTES(v);
+		((short *)dstPtr)[0] = v;
+# else
                 dstPtr[0] = (v>>8) & 0xFF;
                 dstPtr[1] = (v) & 0xFF;
+# endif
 #endif
                 dstPtr += 2;
 
@@ -276,10 +281,10 @@
                     OBJ clr;
 
                     if (r & 1) {
+                        idx = byte & 0xF;
+                    } else {
                         byte = *srcPtr++;
                         idx = (byte>>4) & 0xF;
-                    } else {
-                        idx = byte & 0xF;
                     }
                     clr = ap[idx];
                     v = __intVal(clr);
@@ -331,10 +336,10 @@
                         OBJ clr;
 
                         if (r & 1) {
+                            idx = byte & 0xF;
+                        } else {
                             byte = *srcPtr++;
                             idx = (byte>>4) & 0xF;
-                        } else {
-                            idx = byte & 0xF;
                         }
                         clr = ap[idx];
                         v = __intVal(clr);
@@ -381,10 +386,10 @@
                             OBJ clr;
 
                             if (r & 1) {
+                                idx = byte & 0xF;
+                            } else {
                                 byte = *srcPtr++;
                                 idx = (byte>>4) & 0xF;
-                            } else {
-                                idx = byte & 0xF;
                             }
                             clr = ap[idx];
                             v = __intVal(clr);
@@ -976,5 +981,5 @@
 !Depth4Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.32 1998-07-29 11:18:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.33 1998-08-01 13:53:48 cg Exp $'
 ! !