changeset 1902:74405ff6bc4a

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 26 Jun 2018 12:20:08 +0300
parents 636d3c8bcd35
children 8ad98bc7402c
files tools/libgfx.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tools/libgfx.c	Tue Jun 26 05:03:55 2018 +0300
+++ b/tools/libgfx.c	Tue Jun 26 12:20:08 2018 +0300
@@ -1975,9 +1975,10 @@
 {
     if (mode == DMODE_LIT)
     {
-        if (offs - *l_offs > *r_count || flush)
+        size_t l_count = offs - *l_offs;
+        if (l_count > *r_count || flush)
         {
-            size_t count = (offs - *l_offs) - *r_count;
+            size_t count = l_count - *r_count;
             Sint8 tmp = count - 1;
 
             if (!dmf_write_byte(fp, tmp) ||
@@ -2086,10 +2087,9 @@
             }
         }
 
-        // Write mask data
+        // Write mask data, if any
         if (iff->bmhd.masking == IFF_MASK_HAS_MASK)
         {
-            // Encode bitplane
             dmMemset(buf, 0, bufLen);
 
             for (int xc = 0; xc < img->width; xc++)