# HG changeset patch # User John Tsiombikas # Date 1315445036 -10800 # Node ID 206348366635c4c4b03f988ef9d63a5f6e69fb64 # Parent 70309d71c899cffc2bc0187b7278a7b4f458ef2f trying to figure out why the textures are looking crappy on ipod diff -r 70309d71c899 -r 206348366635 src/istereo.c --- a/src/istereo.c Thu Sep 08 03:06:46 2011 +0300 +++ b/src/istereo.c Thu Sep 08 04:23:56 2011 +0300 @@ -51,7 +51,7 @@ return -1; } - cam_fov(43.0); + cam_fov(42.0); return 0; } diff -r 70309d71c899 -r 206348366635 src/tex.c --- a/src/tex.c Thu Sep 08 03:06:46 2011 +0300 +++ b/src/tex.c Thu Sep 08 04:23:56 2011 +0300 @@ -10,8 +10,8 @@ { unsigned int tex; FILE *fp; - void *pixels; - int xsz, ysz, sz; + unsigned char *pixels; + int xsz, ysz, sz, i; char buf[512]; if(!(fp = fopen(fname, "r"))) { @@ -31,17 +31,27 @@ } fgets(buf, sizeof buf, fp); - sz = xsz * ysz * 3; + sz = xsz * ysz * 4; if(!(pixels = malloc(sz))) { fprintf(stderr, "failed to allocate %d bytes\n", sz); fclose(fp); return 0; } - if(fread(pixels, 1, xsz * ysz * 3, fp) < sz) { - fprintf(stderr, "partial read: %s\n", fname); - free(pixels); - fclose(fp); - return 0; + for(i=0; i