changeset 2072:5d6ae2aa8c56

Rename LocFileInfo::{x,y} to {xoffs,yoffs}.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Aug 2019 13:44:49 +0300
parents 38436de1bbc8
children 108499a64178
files liblocfile.c liblocfile.h mapsearch.c mkcitymap.c mkloc.c
diffstat 5 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/liblocfile.c	Wed Aug 21 13:41:38 2019 +0300
+++ b/liblocfile.c	Wed Aug 21 13:44:49 2019 +0300
@@ -821,5 +821,5 @@
 {
     file->filename = th_strdup(filename);
     file->continent = th_strdup(continent);
-    file->x = file->y = 0;
+    file->xoffs = file->yoffs = 0;
 }
--- a/liblocfile.h	Wed Aug 21 13:41:38 2019 +0300
+++ b/liblocfile.h	Wed Aug 21 13:44:49 2019 +0300
@@ -96,7 +96,7 @@
 {
     char *filename;
     char *continent;
-    int x, y;
+    int xoffs, yoffs;
 } LocFileInfo;
 
 
--- a/mapsearch.c	Wed Aug 21 13:41:38 2019 +0300
+++ b/mapsearch.c	Wed Aug 21 13:44:49 2019 +0300
@@ -260,7 +260,7 @@
 
     // Get world X/Y offsets, if any
     if (piece != NULL &&
-        !mapParseCoordPair(piece, &info->locFile.x, &info->locFile.y))
+        !mapParseCoordPair(piece, &info->locFile.xoffs, &info->locFile.yoffs))
         goto err;
 
     ret = TRUE;
@@ -1141,8 +1141,8 @@
                 match->map = info->locFile.continent;
                 match->mx = ox + 1 + centerX;
                 match->my = oy + 1 + centerY;
-                match->wx = optWorldXC + info->locFile.x + ox + centerX;
-                match->wy = optWorldYC + info->locFile.y + oy + centerY;
+                match->wx = optWorldXC + info->locFile.xoffs + ox + centerX;
+                match->wy = optWorldYC + info->locFile.yoffs + oy + centerY;
 
                 // Check for max matches
                 if (nmatches >= maxMatches)
@@ -1221,8 +1221,8 @@
                 match->map = info->locFile.continent;
                 match->mx = marker->x + 1;
                 match->my = marker->y + 1;
-                match->wx = optWorldXC + info->locFile.x + marker->x;
-                match->wy = optWorldYC + info->locFile.y + marker->y;
+                match->wx = optWorldXC + info->locFile.xoffs + marker->x;
+                match->wy = optWorldYC + info->locFile.yoffs + marker->y;
 
                 // Check for max matches
                 if (nmatches >= SET_MAX_MATCHES)
@@ -1304,8 +1304,8 @@
                     char *vstr = th_strdup_printf(
                         "[\"%s\",%d,%d]%s",
                         info->locFile.continent,
-                        info->locFile.x + optWorldXC,
-                        info->locFile.y + optWorldYC,
+                        info->locFile.xoffs + optWorldXC,
+                        info->locFile.yoffs + optWorldYC,
                         (n < optNMaps - 1) ? "," : "");
 
                     th_strbuf_puts(&buf, &bufSize, &bufLen, vstr);
@@ -1440,7 +1440,7 @@
             info->locFile.continent,
             info->mapFilename,
             info->locFile.filename,
-            info->locFile.x, info->locFile.y);
+            info->locFile.xoffs, info->locFile.yoffs);
 
         if ((info->map = mapBlockParseFile(info->mapFilename, FALSE)) == NULL)
         {
--- a/mkcitymap.c	Wed Aug 21 13:41:38 2019 +0300
+++ b/mkcitymap.c	Wed Aug 21 13:44:49 2019 +0300
@@ -425,7 +425,7 @@
         exit(3);
     }
 
-    if (!locParseLocStream(inFile, &locFile, &locations, locFile.x, locFile.y))
+    if (!locParseLocStream(inFile, &locFile, &locations, locFile.xoffs, locFile.yoffs))
         exit(1);
 
     fclose(inFile);
--- a/mkloc.c	Wed Aug 21 13:41:38 2019 +0300
+++ b/mkloc.c	Wed Aug 21 13:44:49 2019 +0300
@@ -142,14 +142,14 @@
 
     case 7:
         f = &optLocFiles[noptLocFiles];
-        f->x = atoi(optArg);
-        THMSG(2, "Location file #%d X offset = %d\n", noptLocFiles, f->x);
+        f->xoffs = atoi(optArg);
+        THMSG(2, "Location file #%d X offset = %d\n", noptLocFiles, f->xoffs);
         break;
 
     case 8:
         f = &optLocFiles[noptLocFiles];
-        f->y = atoi(optArg);
-        THMSG(2, "Location file #%d Y offset = %d\n", noptLocFiles, f->y);
+        f->yoffs = atoi(optArg);
+        THMSG(2, "Location file #%d Y offset = %d\n", noptLocFiles, f->yoffs);
         break;
 
     case 21:
@@ -1152,7 +1152,7 @@
             goto exit;
         }
 
-        if (!locParseLocStream(inFile, f, &worldLoc, f->x, f->y))
+        if (!locParseLocStream(inFile, f, &worldLoc, f->xoffs, f->yoffs))
             goto exit;
 
         fclose(inFile);