svnno****@sourc*****
svnno****@sourc*****
2010年 10月 5日 (火) 23:07:33 JST
Revision: 217 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=217 Author: yoya Date: 2010-10-05 23:07:33 +0900 (Tue, 05 Oct 2010) Log Message: ----------- PNG 画像を取り込む処理のデグレード修正 横が4の倍数でない時に画像が崩れていた Modified Paths: -------------- trunk/src/swf_png.c -------------- next part -------------- Modified: trunk/src/swf_png.c =================================================================== --- trunk/src/swf_png.c 2010-10-04 17:22:47 UTC (rev 216) +++ trunk/src/swf_png.c 2010-10-05 14:07:33 UTC (rev 217) @@ -211,15 +211,12 @@ *colormap = result_colormap; } unsigned char *indices_data = malloc(((png_width+ 3) & -4) * png_height); - i = 0; for (y=0 ; y < png_height ; y++) { bitstream_t *bs = bitstream_open(); bitstream_input(bs, png_image_data[y], png_width); for (x=0 ; x < png_width ; x++) { - indices_data[i] = bitstream_getbits(bs, bpp); - i++; + indices_data[x+y*((png_width + 3) & -4)] = bitstream_getbits(bs, bpp); } - if (i % 4) { i++; } // 4byte alignment bitstream_close(bs); } image_data = indices_data;