]> git.zerfleddert.de Git - micropolis/commitdiff
fix 24bit wire mode
authorMichael Gernoth <michael@gernoth.net>
Sun, 13 Jan 2008 02:21:25 +0000 (03:21 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sun, 13 Jan 2008 02:21:25 +0000 (03:21 +0100)
src/sim/g_map.c
src/sim/g_smmaps.c
src/sim/headers/sim.h
src/sim/w_x.c

index 4b0fe5f6514ca416bb00148813cbc3e24aa0dba2..87c7e273b1c508c041e40b11de5ed4422e98d282 100644 (file)
@@ -467,11 +467,8 @@ drawRect(SimView *view, int pixel, int solid,
        unsigned char *data = 
          (unsigned char *)view->data;
        unsigned char *image;
-       int bitmapPad = view->x->small_tile_image->bitmap_pad;
-       int rowBytes = view->x->small_tile_image->bytes_per_line;
-       line = rowBytes >> 1; /* Convert from byte offset to short offset */
        image = 
-         &data[(line * y) + x];
+         &data[(line * y) + x * pixelBytes];
 
        if (solid) {
          for (i = h; i > 0; i--) {
@@ -479,11 +476,11 @@ drawRect(SimView *view, int pixel, int solid,
              *(image++) = (pixel >> 0) & 0xff;
              *(image++) = (pixel >> 8) & 0xff;
              *(image++) = (pixel >> 16) & 0xff;
-             if (bitmapPad == 32) {
+             if (pixelBytes == 4) {
                image++;
              }
            }
-           image += line - w;
+           image += line - w * pixelBytes;
          }
        } else {
          for (i = h; i > 0; i--) {
@@ -492,15 +489,17 @@ drawRect(SimView *view, int pixel, int solid,
                *(image++) = (pixel >> 0) & 0xff;
                *(image++) = (pixel >> 8) & 0xff;
                *(image++) = (pixel >> 16) & 0xff;
-               if (bitmapPad == 32) {
-                 image++;
-               }
+             } else {
+               image += 3;
+             }
+             if (pixelBytes == 4) {
+               image++;
              }
            }
            if (!(w & 1)) {
              stipple++;
            }
-           image += line - w;
+           image += line - w * pixelBytes;
          }
        }
       }
index ed8c075c0cad25eb530bbe3e9b00cec1a71ce76c..d2646a69251141c6616be506aed57d413a641a7f 100644 (file)
@@ -153,8 +153,6 @@ int DynamicData[32];
                  ROW3_16 \
                  break; \
                case 24: \
-                 ROW3_24 \
-                 break; \
                case 32: \
                  ROW3_32 \
                  break; \
index d6a31a11eb56a5952a79034a6c0bfc7a0333b204..7a81f7cc2718c2859f4b6f51352474571377d607 100644 (file)
@@ -91,7 +91,6 @@
 #include <assert.h>
 #include <ctype.h>
 #include <setjmp.h>
-#include <malloc.h>
 #include <errno.h>
 #include <signal.h>
 #include <math.h>
index a6472a030c03028f1dbfbdf11338242d9f8a82f8..69363b57febcc17ca3b6a3c4d69c203c6cf29cb7 100644 (file)
@@ -1156,7 +1156,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