From d073d9cc7c0c8c77efe14ac75f5e1f9b1ab4c958 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Wed, 18 Feb 2009 19:35:28 +0000 Subject: [PATCH] Remove dead gateway<->zone code. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6657 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/gateway.c | 7 ------- src/gatewaydef.h | 45 ++------------------------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/src/gateway.c b/src/gateway.c index 8826eec9b..edba16c16 100644 --- a/src/gateway.c +++ b/src/gateway.c @@ -135,9 +135,6 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2) psNew->y1 = (UBYTE)y1; psNew->x2 = (UBYTE)x2; psNew->y2 = (UBYTE)y2; - psNew->zone1 = 0; - psNew->zone2 = 0; - psNew->psLinks = NULL; psNew->flags = 0; // add the gateway to the list @@ -216,10 +213,6 @@ void gwFreeGateway(GATEWAY *psDel) } - if (psDel->psLinks != NULL) - { - free(psDel->psLinks); - } free(psDel); } diff --git a/src/gatewaydef.h b/src/gatewaydef.h index 00a048e8f..e0d9f69ee 100644 --- a/src/gatewaydef.h +++ b/src/gatewaydef.h @@ -24,47 +24,13 @@ #ifndef __INCLUDED_GATEWAYDEF_H__ #define __INCLUDED_GATEWAYDEF_H__ -typedef struct _gateway_link -{ - struct _gateway *psGateway; - SWORD dist; - SWORD flags; -} GATEWAY_LINK; - -// flags for the gateway links -enum _gw_link_flags -{ - GWRL_PARENT = 0x01, // the link is part of the current route - to the previous gateway - GWRL_CHILD = 0x02, // the link is part of the current route - to the next gateway - GWRL_BLOCKED = 0x04, // the route between the two zones is blocked -}; - -// the flags that get reset by the router -#define GWRL_RESET_MASK 0x3 - typedef struct _gateway { - UBYTE x1,y1, x2,y2; - - UBYTE zone1; // zone to the left/above the gateway - UBYTE zone2; // zone to the right/below the gateway - + UBYTE x1,y1, x2,y2; + UBYTE flags; // open or closed node struct _gateway *psNext; - - GATEWAY_LINK *psLinks; // array of links to other zones - UBYTE zone1Links; // number of links - UBYTE zone2Links; - - // Data for the gateway router - UBYTE flags; // open or closed node - SWORD dist, est; // distance so far and estimate to end - - struct _gateway *psOpen; - struct _gateway *psRoute; // Previous point in the route - } GATEWAY; - // types of node for the gateway router enum _gw_node_flags { @@ -78,11 +44,4 @@ enum _gw_node_flags GWR_WATERLINK = 0x80, // the gateway is a land/water link }; -// the flags reset by the router -#define GWR_RESET_MASK 0x3f - -// the maximum width and height of the map -#define GW_MAP_MAXWIDTH (MAP_MAXWIDTH - 1) -#define GW_MAP_MAXHEIGHT (MAP_MAXHEIGHT - 1) - #endif // __INCLUDED_GATEWAYDEF_H__