Mercurial > hg > forks > multipaint-js
diff exporters.pde @ 133:f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 08 Aug 2018 11:06:33 +0300 |
parents | 146879c896b9 |
children | 1b2cbf3ab441 |
line wrap: on
line diff
--- a/exporters.pde Sun Aug 05 14:35:13 2018 +0300 +++ b/exporters.pde Wed Aug 08 11:06:33 2018 +0300 @@ -3,11 +3,6 @@ // source writer and other export/import functions // remember hexdump -C ! // -String g_formatname, g_formatext; -int[] g_grids = new int[16]; -int OLD = 0; -int NEW = 1; -int g_gridmode = OLD; public class MPWriteCtx @@ -1054,7 +1049,7 @@ if (image.width <= 16 || image.height <= 16) return false; - int balx, baly, xx, yy, x2, y2, rr, gg, bb, avg, molox, i, j, target; + int balx, baly, xx, yy, x2, y2, rr, gg, bb, avg, i, j, target; int cx, cy; int aas, bbs, swap, idefix, avx, avy; int[] pixut = new int[260]; @@ -1082,13 +1077,10 @@ if (g_multic == 2) { limitter = 16; } - molox = 1; + command(int('O')); //special clear screen - if (g_multic == 1 || g_hzoomer == 2) { - molox = 2; - } - balx = int(image.width / X) * molox; + balx = int(image.width / X) * g_pixelw; baly = int(image.height / Y); if (balx < 1) { balx = 1; @@ -1111,7 +1103,7 @@ for (cy = 0; cy < MY * erkki; cy++) for (cx = 0; cx < MX; cx++) for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) - for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) + for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + g_pixelw) { x2 = int(image.width / X) * xx; y2 = int(image.height / Y) * yy; @@ -1173,7 +1165,7 @@ idx[i] = i; } for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { - for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) { + for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + g_pixelw) { x2 = int(image.width / X) * xx; y2 = int(image.height / Y) * yy; rr = 0; @@ -1227,7 +1219,7 @@ i = idx[idefix]; for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) { - for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) + for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + g_pixelw) { x2 = int(image.width / X) * xx; y2 = int(image.height / Y) * yy; @@ -1269,7 +1261,7 @@ if (idefix == 0) { for (yy = cy * vertti; yy <= cy * vertti + vertti - 1; yy++) - for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + molox) + for (xx = cx * 8; xx <= cx * 8 + 7; xx = xx + g_pixelw) { g_farge = idx[0]; makepoint(xx, yy); @@ -1296,7 +1288,7 @@ for (int xx = 0; xx < X; xx++) { int f; - if (g_multic == 1 || g_hzoomer == 2) + if (g_pixelw == 2) f = getmultic(chop2(xx), yy, 0); else f = getabsa(xx, yy, 0); @@ -1891,4 +1883,10 @@ makecolor(14, 0x23, 0xaf, 0x32); makecolor(15, 0x29, 0xf7, 0xa7); } + + // Compute pixel width + if (g_multic == 1 || g_hzoomer == 2) + g_pixelw = 2; + else + g_pixelw = 1; }