Mercurial > hg > forks > multipaint-js
diff draw_inputs.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 | 9b77ed046003 |
children | e899ca447a69 |
line wrap: on
line diff
--- a/draw_inputs.pde Sun Aug 05 14:35:13 2018 +0300 +++ b/draw_inputs.pde Wed Aug 08 11:06:33 2018 +0300 @@ -55,13 +55,12 @@ int getmultic(int x1, int y1, int mode) //mode 0=screen 1=brush { - //returns the multicolor color on point x1,y1 - int ad, looks, mmc, source1, source2; ad = 1024 + x1 + y1 * X; - if (g_multic == 2) { + if (g_multic == 2) + { if (mode == 0) return g_map[ad]; if (mode == 1) return g_brush[ad]; } @@ -152,14 +151,15 @@ val = 0; sad = 1024 + xx + yy * X; ad = 65536 + int(xx / 8) + yy * MX; + chek = int(g_map[sad]); - if (chek == 100 || chek == 200) return chek; + if (chek == 100 || chek == 200) + return chek; - if (mode == 0) { + if (mode == 0) ssap = int(g_map[sad]); - } else { + else ssap = int(g_brush[sad]); - } if (ssap == 1) { if (mode == 0) { @@ -191,15 +191,13 @@ } void infersize() { - int xx, yy, cp, molox, okay; + int xx, yy, cp, okay; int bx, by; storeparameters(); xx = 0; - molox = 1; okay = 0; - if (g_multic == 1 || g_hzoomer == 2) molox = 2; cp = easygetcolor(0, 0); - for (xx = 0; xx < X; xx = xx + molox) { + for (xx = 0; xx < X; xx = xx + g_pixelw) { if (easygetcolor(xx, 0) == cp && okay == 0) { g_animx = xx; } else { @@ -215,7 +213,7 @@ } } - g_animx = g_animx + molox; + g_animx = g_animx + g_pixelw; g_animy = g_animy + 1; if (g_animx > 63 || g_animy > 63 || g_animx <= 2 || g_animy <= 2) { message("BAD SIZE|See manual"); @@ -230,7 +228,7 @@ g_bsourcex = g_animx; g_bsourcey = 0; - g_bsourcex2 = g_animx + g_animx - molox; + g_bsourcex2 = g_animx + g_animx - g_pixelw; g_bsourcey2 = g_animy - 1; g_animframes = 0; g_animno = 1; @@ -238,7 +236,7 @@ for (yy = 0; yy <= Y; yy = yy + g_animy) { for (xx = 0; xx <= X; xx = xx + g_animx) { okay = 1; - for (bx = 0; bx < g_animx; bx = bx + molox) { + for (bx = 0; bx < g_animx; bx = bx + g_pixelw) { for (by = 0; by < g_animy; by++) { if (easygetcolor(xx + bx, yy + by) != cp) okay = 0; } @@ -263,8 +261,6 @@ void animbrush_do() { int bx, by; int horisize; - int molox = 1; - if (g_multic == 1) molox = 2; horisize = int(X / g_animx); g_animno = g_animno + 1; if (g_animno > g_animframes) g_animno = 1; @@ -272,7 +268,7 @@ bx = g_animno - (by * horisize); g_bsourcex = bx * g_animx; g_bsourcey = by * g_animy; - g_bsourcex2 = g_bsourcex + g_animx - molox; + g_bsourcex2 = g_bsourcex + g_animx - g_pixelw; g_bsourcey2 = g_bsourcey + g_animy - 1; } @@ -283,11 +279,9 @@ } int get_raster(int xx, int yy) { - int molox = 1; - if (g_multic == 1 || g_hzoomer == 2) molox = 2; - xx = xx + g_raster_offset_x * molox; + xx = xx + g_raster_offset_x * g_pixelw; yy = yy + g_raster_offset_y; - if (g_multic == 1 || g_hzoomer == 2) { + if (g_pixelw == 2) { xx = int(xx / 2); } int mx = chop8(xx);