amiga_imgv

diff src/image.c @ 5:0d3d7b020e6a

progress...
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 Oct 2017 12:32:24 +0300
parents 0fd37effde29
children ae0ada629b03
line diff
     1.1 --- a/src/image.c	Fri Oct 27 11:36:18 2017 +0300
     1.2 +++ b/src/image.c	Fri Oct 27 12:32:24 2017 +0300
     1.3 @@ -153,15 +153,15 @@
     1.4  			pixval = 0;
     1.5  			for(x=0; x<w; x++) {
     1.6  				if(i < 4) {
     1.7 -					unsigned char val = (y & 1) ? 0 : 0xff;
     1.8 -					pixval = (pixval >> 1) | (((val >> i) & 1) ? 0x80 : 0);
     1.9 +					unsigned char val = ((y >> 3) & 1) == ((x >> 3) & 1) ? 0 : 0xff;
    1.10 +					pixval = (pixval >> 1) | (val & 0x80);
    1.11  				}
    1.12  				if((x & 7) == 7) {
    1.13  					*pptr++ = pixval;
    1.14  					pixval = 0;
    1.15  				}
    1.16  			}
    1.17 -			pptr += w / 8 * (img->nbitplanes - 1);
    1.18 +			pptr += w / 8 * (nbpl - 1);
    1.19  		}
    1.20  	}
    1.21