diff tools/lib64fmts.c @ 2606:92909caccc9e

Rename various compression related internal constants.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 25 Nov 2023 15:56:18 +0200
parents f5f03c5d9fd5
children 2cda64a11715
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sat Nov 25 06:06:18 2023 +0200
+++ b/tools/lib64fmts.c	Sat Nov 25 15:56:18 2023 +0200
@@ -666,8 +666,8 @@
     DMCompParams cfg;
 
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_2;
     cfg.rleMarkerB   = fmt->extra;
 
     if ((res = dmDecodeGenericRLEAlloc(&mem, buf, &cfg)) != DMERR_OK)
@@ -693,8 +693,8 @@
 
     // And now RLE compress the data to the existing buffer
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_2;
     cfg.rleMarkerB   = fmt->extra;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
@@ -729,8 +729,8 @@
     DMCompParams cfg;
 
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMarkerB   = buf->data[0x0d];
 
     if ((res = dmDecodeGenericRLEAlloc(&mem,
@@ -758,8 +758,8 @@
 
     // Analyze and setup RLE
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
 
@@ -846,8 +846,8 @@
     DMCompParams cfg;
 
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_WORD_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMarkerB   = buf->data[8];
     cfg.rleMarkerW   = buf->data[9];
 
@@ -883,8 +883,8 @@
 
     // Analyze and setup RLE
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_WORD_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
     cfg.rleMinCountW = 256;
@@ -983,8 +983,8 @@
 
     // Now do an RLE decode on the enlarged buffer
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMarkerB   = 0xC2;
 
     if ((res = dmDecodeGenericRLEAlloc(&mem, &tmp, &cfg)) != DMERR_OK)
@@ -1012,8 +1012,8 @@
 
     // And now RLE compress the data to the existing buffer
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMarkerB   = 0xC2;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
@@ -1067,9 +1067,9 @@
     DMCompParams cfg;
 
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX |
-                       DM_RLE_BACKWARDS_INPUT | DM_RLE_BACKWARDS_OUTPUT | DM_OUT_CROP_END;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX |
+                       DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_BACKWARDS | DM_COMP_OUTPUT_CROP_END;
     cfg.rleMarkerB   = psrc->data[0];
     cfg.cropOutLen   = 0x4442 - 2; // Crop to unpacked size - load address
 
@@ -1102,9 +1102,9 @@
 
     // And now RLE compress the data to the existing buffer
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX |
-                       DM_RLE_BACKWARDS_INPUT | DM_RLE_BACKWARDS_OUTPUT;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX |
+                       DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_BACKWARDS;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 256; // this format allows 256 byte runs with ZERO_COUNT_MAX
 
@@ -1208,8 +1208,8 @@
     // 1b7e-67e8 decoded by original depacker
     // 1c00-67e8 is the actual area used tho
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BACKWARDS_OUTPUT | DM_RLE_BACKWARDS_INPUT | DM_OUT_CROP_END;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_OUTPUT_BACKWARDS | DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_CROP_END;
     cfg.rleMarkerB   = 0xfe;
     cfg.cropOutLen   = 0x67e8 - 0x1c00;
 
@@ -1674,8 +1674,8 @@
         DMCompParams cfg;
 
         cfg.func         = fmt->name;
-        cfg.type         = DM_COMP_RLE_MARKER;
-        cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+        cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+        cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
         cfg.rleMarkerB   = buf->data[15];
 
         dmGrowBufCopyOffs(&tmp, buf, fmtFunPaint2_Header_Size, 1);
@@ -1721,8 +1721,8 @@
 
     // Analyze and setup RLE
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;
 
@@ -1869,8 +1869,8 @@
     // However, as a difference to the uncompressed files, only the data of the
     // 96 pixels wide area (4 sprite widths) x 168 tall is saved.
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX;
     cfg.rleMarkerB   = buf->data[0];
 
     if ((res = dmDecodeGenericRLEAlloc(
@@ -2153,8 +2153,8 @@
     DMCompParams cfg;
 
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMarkerB   = buf->data[0];
 
     if ((res = dmDecodeGenericRLEAlloc(
@@ -2178,8 +2178,8 @@
 
     // Analyze and setup RLE
     cfg.func         = fmt->name;
-    cfg.type         = DM_COMP_RLE_MARKER;
-    cfg.flags        = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
+    cfg.type         = DM_COMP_TYPE_RLE_MARKER;
+    cfg.flags        = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1;
     cfg.rleMinCountB = 4;
     cfg.rleMaxCountB = 255;