amiga_imgv
diff src/sdl/gfx.c @ 7:4c36d0f44aa6
lbm loading
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 29 Oct 2017 13:21:11 +0200 |
parents | ae0ada629b03 |
children | 01bd8bbc46d4 |
line diff
1.1 --- a/src/sdl/gfx.c Fri Oct 27 15:42:58 2017 +0300 1.2 +++ b/src/sdl/gfx.c Sun Oct 29 13:21:11 2017 +0200 1.3 @@ -7,10 +7,12 @@ 1.4 static int scr_width, scr_height; 1.5 static int fb_width, fb_height; 1.6 static int num_bitplanes; 1.7 +static int init_flags; 1.8 1.9 1.10 int gfx_init(int nbpl, unsigned int flags) 1.11 { 1.12 + init_flags = flags; 1.13 num_bitplanes = nbpl; 1.14 scr_width = fb_width = (flags & GFX_HIRES) ? 640 : 320; 1.15 scr_height = fb_height = (flags & GFX_ILACE) ? 512 : 256; 1.16 @@ -161,14 +163,16 @@ 1.17 1.18 for(j=0; j<img->width; j++) { 1.19 unsigned char idx = 0; 1.20 - unsigned char ham; 1.21 + unsigned char ham = 0; 1.22 int bit = 7 - (j & 7); 1.23 1.24 for(k=0; k<img->nbitplanes; k++) { 1.25 idx |= (((*(src + k * img->width / 8) >> bit) & 1) << k); 1.26 } 1.27 1.28 - ham = (idx >> 4) & 3; 1.29 + if(init_flags & GFX_HAM) { 1.30 + ham = (idx >> 4) & 3; 1.31 + } 1.32 1.33 switch(ham) { 1.34 case 0: