]> cvs.zerfleddert.de Git - micropolis/blobdiff - src/sim/w_x.c
automatic byteorder detection
[micropolis] / src / sim / w_x.c
index a6472a030c03028f1dbfbdf11338242d9f8a82f8..76e9ff6eb6392a87b4f551f7feed35d2d178094e 100644 (file)
@@ -441,7 +441,9 @@ FindXDisplay(Tk_Window tkwin)
        } else {
          fprintf(stderr,
                  "Cool, I found the shared memory extension!\n");
-         xd->shared = 1;
+         fprintf(stderr,
+                 "Disabled SHM, because it is currently broken!\n");
+         xd->shared = 0;
        }
       }
     }
@@ -582,6 +584,8 @@ InitNewView(SimView *view, char *title, int class, int w, int h)
     view->type = X_Mem_View;
   }
 
+  view->x->big_endian = (ImageByteOrder(view->x->dpy) == MSBFirst);
+
   GetPixmaps(view->x);
   view->pixels = view->x->pixels;
 
@@ -1156,7 +1160,7 @@ DoResizeView(SimView *view, int w, int h)
          view->pixel_bytes = 4;
          //view->pixel_bytes = 3;
          view->depth = 24;
-         bitmap_depth = 32;
+         bitmap_depth = 24;
          bitmap_pad = 32;
          view->line_bytes8 =
            ((view->m_width * 4) + 3) & (~3);
Impressum, Datenschutz