changeset 1783:fe17380576ac

Remove unused function from the lib.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 29 Oct 2017 03:08:49 +0200
parents 77d6e13fb95e
children 9ee269ae165d
files libmaputils.c libmaputils.h
diffstat 2 files changed, 0 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/libmaputils.c	Sun Oct 29 03:08:25 2017 +0200
+++ b/libmaputils.c	Sun Oct 29 03:08:49 2017 +0200
@@ -819,39 +819,3 @@
         fputc(0xff, fh);
     }
 }
-
-
-int mapBlockGetEntropy(const MapBlock *map, const unsigned char *exclude, const int nexclude)
-{
-    unsigned char *list;
-    int num, i;
-
-    // Allocate memory for entropy array
-    if ((list = th_malloc0(256)) == NULL)
-        return -1;
-
-    // Collect sums into entropy array
-    for (int y = 0; y < map->height; y++)
-    {
-        unsigned char *c = map->data + (y * map->scansize);
-        for (int x = 0; x < map->width; x++)
-        {
-            list[*c]++;
-            c++;
-        }
-    }
-
-    // Handle exclusions
-    if (exclude != NULL && nexclude > 0)
-    {
-        for (i = 0; i < nexclude; i++)
-            list[(int) exclude[i]] = 0;
-    }
-
-    // Calculate simple entropy
-    for (num = 0, i = 0; i < 256; i++)
-        if (list[i]) num++;
-
-    th_free(list);
-    return num;
-}
--- a/libmaputils.h	Sun Oct 29 03:08:25 2017 +0200
+++ b/libmaputils.h	Sun Oct 29 03:08:49 2017 +0200
@@ -124,7 +124,6 @@
 int         mapBlockPut(MapBlock **pmap, const MapBlock *src, const int ox, const int oy);
 void        mapBlockClean(MapBlock *block, const char *symbols);
 void        mapBlockPrintRaw(FILE *fh, const MapBlock *block);
-int         mapBlockGetEntropy(const MapBlock *map, const unsigned char *exclude, const int nexclude);
 
 
 #endif