# HG changeset patch # User Matti Hamalainen # Date 1536175695 -10800 # Node ID c9a77d87e38008bbc6951154de596b96b71959f1 # Parent 2d424d09628166156caa078cb17b479be3b4fb52 Cleanup. diff -r 2d424d096281 -r c9a77d87e380 files.pde --- a/files.pde Wed Sep 05 22:21:18 2018 +0300 +++ b/files.pde Wed Sep 05 22:28:15 2018 +0300 @@ -158,26 +158,8 @@ } -// bordh/v = 64, 32, omag = 1 -void mpSavePNGImage(String name, int fmt, boolean border, int bordh, int bordv, int omag) +boolean mpImportAnyImage(PImage simg) { - PImage simg = mpRenderImage(border, bordh, bordv, omag); -// if (g_data[int('Q')] == 0) - - if (simg !== null) - { - // XXX TODO .. actually save the image, something like .. - //simg.canvas.toBlob(function(idata){ mpSaveBinaryFile(name, idata); }, "image/png", 0.95); - } -} - - -int mpLoadPNGImage(String name) -{ - PImage simg = null; - if (simg == null) - return -1; - int lefth = g_farge; int righth = g_backg; storeparameters(); @@ -187,7 +169,7 @@ g_data[int('b')] = 1; //old IQ if (!mpImportFromImage(simg)) - return -2; + return false; restoreparameters(); refreshpalette(); @@ -195,7 +177,7 @@ g_boxreconstruct = 2; selectcolor(0, lefth); selectcolor(1, righth); - return 0; + return true; }