changeset 1339:65f8fd1bf76e

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Aug 2017 15:01:23 +0300
parents 2603f6ca632e
children 1f8687c61891
files tools/libgfx.c
diffstat 1 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/tools/libgfx.c	Tue Aug 22 14:56:10 2017 +0300
+++ b/tools/libgfx.c	Tue Aug 22 15:01:23 2017 +0300
@@ -84,6 +84,7 @@
     return DMERR_OK;
 }
 
+
 BOOL dmCompareColor(const DMColor *c1, const DMColor *c2, BOOL alpha)
 {
     if (c1->r == c2->r &&
@@ -340,17 +341,16 @@
 
     if (spec->planar)
     {
-        // Output bitplanes in planerd format (each plane of line sequentially)
+        // Output bitplanes in planar format
+        // (each plane of line sequentially)
         for (yc = 0; yc < img->height; yc++)
+        for (plane = 0; plane < spec->nplanes; plane++)
         {
-            for (plane = 0; plane < spec->nplanes; plane++)
+            Uint8 *sp = img->data + yc * img->pitch;
+            for (xc = 0; xc < img->width; xc++)
             {
-                Uint8 *sp = img->data + yc * img->pitch;
-                for (xc = 0; xc < img->width; xc++)
-                {
-                    if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1))
-                        return DMERR_FWRITE;
-                }
+                if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1))
+                    return DMERR_FWRITE;
             }
         }
     }
@@ -358,15 +358,13 @@
     {
         // Output each bitplane in sequence
         for (plane = 0; plane < spec->nplanes; plane++)
+        for (yc = 0; yc < img->height; yc++)
         {
-            for (yc = 0; yc < img->height; yc++)
+            Uint8 *sp = img->data + yc * img->pitch;
+            for (xc = 0; xc < img->width; xc++)
             {
-                Uint8 *sp = img->data + yc * img->pitch;
-                for (xc = 0; xc < img->width; xc++)
-                {
-                    if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1))
-                        return DMERR_FWRITE;
-                }
+                if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1))
+                    return DMERR_FWRITE;
             }
         }
     }