diff multipaint.pde @ 175:3ddf4d799fe6

Get rid of globals g_omag, g_bordh and g_bordv which set PNG/JPEG image magnification factor (default 1) and horiz/vert border sizes (64/32).
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 23 Aug 2018 12:38:52 +0300
parents e77a726a587e
children 0940d991d3b0
line wrap: on
line diff
--- a/multipaint.pde	Thu Aug 23 11:32:38 2018 +0300
+++ b/multipaint.pde	Thu Aug 23 12:38:52 2018 +0300
@@ -33,10 +33,9 @@
 int machine = -1; // change this to autoselect
 int platform = PSJS;
 
-int g_active, g_tooltrigger, g_prevtool;
-int g_rband, g_rbang, g_boxreconstruct, g_charlimit;
-int g_animx, g_animy, g_animframes, g_animno, g_animtime, g_animspeed;
-int g_omag, g_bordh, g_bordv, g_keymacpos;
+int g_active, g_tooltrigger, g_prevtool, g_rband, g_rbang,
+    g_boxreconstruct, g_charlimit, g_animx, g_animy,
+    g_animframes, g_animno, g_animtime, g_animspeed, g_keymacpos;
 int g_wheelup = int(':'), g_wheeldown = int(';'), g_middlebutton = int(',');
 
 boolean g_control = false, g_shift = false, g_dirty, g_inhibit_aspect = false;
@@ -151,10 +150,6 @@
     g_magpiy[121] = 8;
     g_magpiy[122] = 14;
 
-    g_omag = 1;
-    g_bordh = 64;
-    g_bordv = 32;
-
     // Set up UI
     g_uizoom = 2;
     g_animspeed = 1;
@@ -444,9 +439,10 @@
 }
 
 
-void mpSavePNGImage(String name, int fmt, boolean border)
+// bordh/v = 64, 32, omag = 1
+void mpSavePNGImage(String name, int fmt, boolean border, int bordh, int bordv, int omag)
 {
-    PImage simg = mpRenderImage(border);
+    PImage simg = mpRenderImage(border, bordh, bordv, omag);
 //    if (g_data[int('Q')] == 0)
 
     if (simg !== null)