From 93200bebd82795ae3fa18226d8e31e0be9e0f1cc Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sun, 13 Jan 2008 03:21:25 +0100 Subject: [PATCH] fix 24bit wire mode --- src/sim/g_map.c | 19 +++++++++---------- src/sim/g_smmaps.c | 2 -- src/sim/headers/sim.h | 1 - src/sim/w_x.c | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/sim/g_map.c b/src/sim/g_map.c index 4b0fe5f..87c7e27 100644 --- a/src/sim/g_map.c +++ b/src/sim/g_map.c @@ -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; } } } diff --git a/src/sim/g_smmaps.c b/src/sim/g_smmaps.c index ed8c075..d2646a6 100644 --- a/src/sim/g_smmaps.c +++ b/src/sim/g_smmaps.c @@ -153,8 +153,6 @@ int DynamicData[32]; ROW3_16 \ break; \ case 24: \ - ROW3_24 \ - break; \ case 32: \ ROW3_32 \ break; \ diff --git a/src/sim/headers/sim.h b/src/sim/headers/sim.h index d6a31a1..7a81f7c 100644 --- a/src/sim/headers/sim.h +++ b/src/sim/headers/sim.h @@ -91,7 +91,6 @@ #include #include #include -#include #include #include #include diff --git a/src/sim/w_x.c b/src/sim/w_x.c index a6472a0..69363b5 100644 --- a/src/sim/w_x.c +++ b/src/sim/w_x.c @@ -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); -- 2.39.2