diff multipaint.pde @ 88:03823fa2cb01

Refactor export_image() and export_image_sans_border() to use common code, and also rename them to mpRenderImageWithBorder() and mpRenderImageWithoutBorder().
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Jul 2018 00:23:23 +0300
parents 025efefd1704
children 09c1a4aba305
line wrap: on
line diff
--- a/multipaint.pde	Fri Jul 06 00:19:38 2018 +0300
+++ b/multipaint.pde	Fri Jul 06 00:23:23 2018 +0300
@@ -61,8 +61,6 @@
 
 
 byte g_realfront, g_realback;
-PImage output, outputsans;
-String g_name;
 
 
 //dimensions
@@ -188,9 +186,6 @@
     g_realfront = byte(g_farge);
     g_realback = byte(g_backg);
 
-    output = createImage(X * g_omag + g_bordh * g_omag, Y * g_omag + g_bordv * g_omag, RGB);
-    outputsans = createImage(X * g_omag, Y * g_omag, RGB);
-
     for (int y = 0; y < Y; y++)
     for (int x = 0; x < X; x++)
         absolute_clearpoint(x, y);
@@ -318,10 +313,13 @@
 
 void mpSavePNGImage(String name)
 {
+    PImage simg;
     if (g_data[int('Q')] == 0)
-        export_image_sans_border(name);
+        simg = mpRenderImageWithoutBorder();
     else
-        export_image(name);
+        simg = mpRenderImageWithBorder();
+
+    // XXX TODO .. actually save the image
 }