From 9f9eede8abb443e0c8c04c3521c1929bffc1c3a3 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 23 Dec 2009 17:34:25 +0000 Subject: [PATCH] Fix the bmp saving (once again). git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1240 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- fileformats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fileformats.c b/fileformats.c index 1ebf6ed2..4d801eb9 100644 --- a/fileformats.c +++ b/fileformats.c @@ -1457,10 +1457,10 @@ void Save_BMP(void) { // Image width must be a multiple of 4 bytes - if (Main_image_width & 3) - line_size=((Main_image_width >> 3)+1) << 3; - else - line_size=Main_image_width; + line_size = Main_image_width; + + if (line_size & 3) + line_size += (4 - (line_size & 3)); header.Signature[0] = 'B'; header.Signature[1] = 'M';