X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16%2F16planar.c;h=cd528e46fd3675f8fde171dc74365a4278ef0281;hb=a9fe632397649ac62b1d7febda9a62bc517c5c53;hp=4c167597c292b135026234d81b4719598aa9bdb0;hpb=c932501b7326877eac49c5e64e9ef76b70b3b124;p=16.git diff --git a/src/lib/modex16/16planar.c b/src/lib/modex16/16planar.c index 4c167597..cd528e46 100755 --- a/src/lib/modex16/16planar.c +++ b/src/lib/modex16/16planar.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -90,7 +90,7 @@ pbuf_alloc(word width, word height) { /* allocate the planes */ for(i=0; i<4; i++) { - p.plane[i] = _fmalloc(p.height * p.pwidth); + p.plane[i] = _fmalloc((p.height * p.pwidth)+1); } return p; @@ -180,6 +180,9 @@ fprintf(stderr, "%u ", w++);*/ /* write the pixel the specified number of times */ //fprintf(stderr, "\nputting in memory~ %u\n", w++); for(; count && (index[0]+index[1]+index[2]+index[3]) < bufSize; count--,index[plane]++) { + // copy to each plane + result.plane[plane][index[plane]]=(word)val; +//fprintf(stdout, "plane=%u index val=%02X val=%02X\n", plane, result.plane[plane][index[plane]], val); switch (plane) { case 4: @@ -194,17 +197,14 @@ fprintf(stderr, "%u ", w++);*/ plane=0; break; } - // copy to each plane - result.plane[plane][index[plane]]=val; //fprintf(stdout, "count=%02X index=%u plane=%u ", count, index[plane], plane); -//fprintf(stdout, "index val=%02X val=%02X\n", result.plane[plane][index[plane]], val); } + //val++; // fprintf(stdout, "\nindex=%lu bufsize=%lu\n\n", (dword)(index[0]+index[1]+index[2]+index[3]), bufSize); } while((index[0]+index[1]+index[2]+index[3]) < bufSize); loadPcxpbufPalette(file, &result); fclose(file); // fprintf(stderr, "\n\n%s count=%d index=%d plane=%d\n", filename, count, (dword)(index[0]+index[1]+index[2]+index[3]), pla); -// exit(0); return result; }