Remove dead gateway<->zone code.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6657 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2009-02-18 19:35:28 +00:00
parent c74230d192
commit d073d9cc7c
2 changed files with 2 additions and 50 deletions

View File

@ -135,9 +135,6 @@ BOOL gwNewGateway(SDWORD x1, SDWORD y1, SDWORD x2, SDWORD y2)
psNew->y1 = (UBYTE)y1; psNew->y1 = (UBYTE)y1;
psNew->x2 = (UBYTE)x2; psNew->x2 = (UBYTE)x2;
psNew->y2 = (UBYTE)y2; psNew->y2 = (UBYTE)y2;
psNew->zone1 = 0;
psNew->zone2 = 0;
psNew->psLinks = NULL;
psNew->flags = 0; psNew->flags = 0;
// add the gateway to the list // add the gateway to the list
@ -216,10 +213,6 @@ void gwFreeGateway(GATEWAY *psDel)
} }
if (psDel->psLinks != NULL)
{
free(psDel->psLinks);
}
free(psDel); free(psDel);
} }

View File

@ -24,47 +24,13 @@
#ifndef __INCLUDED_GATEWAYDEF_H__ #ifndef __INCLUDED_GATEWAYDEF_H__
#define __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 typedef struct _gateway
{ {
UBYTE x1,y1, x2,y2; UBYTE x1,y1, x2,y2;
UBYTE zone1; // zone to the left/above the gateway
UBYTE zone2; // zone to the right/below the gateway
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 UBYTE flags; // open or closed node
SWORD dist, est; // distance so far and estimate to end struct _gateway *psNext;
struct _gateway *psOpen;
struct _gateway *psRoute; // Previous point in the route
} GATEWAY; } GATEWAY;
// types of node for the gateway router // types of node for the gateway router
enum _gw_node_flags enum _gw_node_flags
{ {
@ -78,11 +44,4 @@ enum _gw_node_flags
GWR_WATERLINK = 0x80, // the gateway is a land/water link 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__ #endif // __INCLUDED_GATEWAYDEF_H__