X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Finfcubes.c;h=e55b1bc23194228caf5dad7451113c9581a30e6c;hp=3df25fe834713727cb18687deb5d992a5913cc75;hb=e7220b01f07d1df5a45fe7c83608d4157881956a;hpb=a1ede8e271fee1b4d029752603096db2be780e67 diff --git a/src/infcubes.c b/src/infcubes.c index 3df25fe..e55b1bc 100644 --- a/src/infcubes.c +++ b/src/infcubes.c @@ -26,7 +26,7 @@ static struct screen scr = { static float cam_theta = -29, cam_phi = 35; static float cam_dist = 5; -static struct pimage tex_crate; +static struct pimage tex_inner, tex_outer; static struct g3d_mesh mesh_cube; struct screen *infcubes_screen(void) @@ -37,25 +37,19 @@ struct screen *infcubes_screen(void) static int init(void) { - int i, npixels; - unsigned char *src; - uint16_t *dst; - - if(!(tex_crate.pixels = img_load_pixels("data/crate.jpg", &tex_crate.width, - &tex_crate.height, IMG_FMT_RGB24))) { + if(!(tex_inner.pixels = img_load_pixels("data/crate.jpg", &tex_inner.width, + &tex_inner.height, IMG_FMT_RGB24))) { fprintf(stderr, "infcubes: failed to load crate texture\n"); return -1; } + convimg_rgb24_rgb16(tex_inner.pixels, (unsigned char*)tex_inner.pixels, tex_inner.width, tex_inner.height); - npixels = tex_crate.width * tex_crate.height; - src = (unsigned char*)tex_crate.pixels; - dst = tex_crate.pixels; - for(i=0; i