From 1870e5a41be029bbddc8627e45a944420c304645 Mon Sep 17 00:00:00 2001 From: Ray Chason Date: Sat, 25 Jan 2020 19:00:54 -0500 Subject: [PATCH] Fix bugs affecting full-color BMP files --- win/share/bmptiles.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/win/share/bmptiles.c b/win/share/bmptiles.c index 641415915..b75bbdc54 100644 --- a/win/share/bmptiles.c +++ b/win/share/bmptiles.c @@ -107,15 +107,6 @@ struct TileSetImage *image; if (!read_info_header(fp, &header2)) goto error; if (!check_info_header(&header2)) goto error; -#if 0 /* TODO */ - if (header2.Compression == BI_PNG) { - /* Image data is an embedded PNG bit stream */ - boolean ok = do_read_png_tiles(fp, image)); - fclose(fp); - return ok; - } -#endif - /* header2.Height < 0 means the Y coordinate is reversed; the origin is * top left rather than bottom left */ image->width = header2.Width; @@ -300,7 +291,7 @@ struct TileSetImage *image; break; case 32: for (x = 0; x < image->width; ++x) { - uint32 color = read_u32(row_bytes + x * 2); + uint32 color = read_u32(row_bytes + x * 4); row[x] = build_pixel(&header2, color); } break; @@ -609,7 +600,7 @@ uint32 color; if (mask == 0) return 0; bits = 0xFFFF; /* 0xFF, 0xF, 0x3, 0x1 */ shift = 16; /* 8, 4, 2, 1 */ - while (bits != 0) { + while (shift != 0) { if ((mask & bits) == 0) { mask >>= shift; color >>= shift;