X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ftunnel.c;h=13eea708f5afc2a8b752b2628ce971d26047a1d8;hb=49f1b7996c5a754dad949f4fb6043316ac7b75e7;hp=466242049e308173ab7fe497ac627144426e1fd4;hpb=77c1d84c258ca14e1bba06ab711426668ff24290;p=dosdemo diff --git a/src/tunnel.c b/src/tunnel.c index 4662420..13eea70 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -1,8 +1,9 @@ #include #include +#include #include #include -/*#include */ +#include "imago2.h" #include "demo.h" #include "screen.h" @@ -64,7 +65,7 @@ static int init(void) unsigned char *fog; float aspect = (float)fb_width / (float)fb_height; - xsz = fb_width / 2; + xsz = fb_width; ysz = fb_height; vxsz = xsz * VSCALE; vysz = ysz * VSCALE; @@ -102,16 +103,16 @@ static int init(void) } } - /*if(!(tex_pixels = img_load_pixels(TEX_FNAME, &tex_xsz, &tex_ysz, IMG_FMT_RGBA32))) { + if(!(tex_pixels = img_load_pixels(TEX_FNAME, &tex_xsz, &tex_ysz, IMG_FMT_RGBA32))) { fprintf(stderr, "failed to load image " TEX_FNAME "\n"); return -1; } if((count_bits(tex_xsz) | count_bits(tex_ysz)) != 1) { fprintf(stderr, "non-pow2 image (%dx%d)\n", tex_xsz, tex_ysz); return -1; - }*/ + } - tex_pixels = gen_test_image(&tex_xsz, &tex_ysz); + /*tex_pixels = gen_test_image(&tex_xsz, &tex_ysz);*/ n = count_zeros(tex_xsz); for(i=0; i> 1); for(i=0; i>1); j++) { unsigned int col; - int r, g, b; + int r, g, b, idx = j << 1; - tunnel_color(&r, &g, &b, toffs, tmap[j], fog[j]); + tunnel_color(&r, &g, &b, toffs, tmap[idx], fog[idx]); col = PACK_RGB16(r, g, b); - *pixels++ = (col << 16) | col; + tunnel_color(&r, &g, &b, toffs, tmap[idx + 1], fog[idx + 1]); + col |= PACK_RGB16(r, g, b) << 16; + *pixels++ = col; } tmap += vxsz; fog += vxsz;