1 /************************************************************************
2  *                                                                      *
3  *  FreeSynd - a remake of the classic Bullfrog game "Syndicate".       *
4  *                                                                      *
5  *   Copyright (C) 2010  Bohdan Stelmakh <chamel@users.sourceforge.net> *
6  *                                                                      *
7  *    This program is free software;  you can redistribute it and / or  *
8  *  modify it  under the  terms of the  GNU General  Public License as  *
9  *  published by the Free Software Foundation; either version 2 of the  *
10  *  License, or (at your option) any later version.                     *
11  *                                                                      *
12  *    This program is  distributed in the hope that it will be useful,  *
13  *  but WITHOUT  ANY WARRANTY;  without even  the implied  warranty of  *
14  *  MERCHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  *
15  *  General Public License for more details.                            *
16  *                                                                      *
17  *    You can view the GNU  General Public License, online, at the GNU  *
18  *  project's  web  site;  see <http://www.gnu.org/licenses/gpl.html>.  *
19  *  The full text of the license is also included in the file COPYING.  *
20  *                                                                      *
21  ************************************************************************/
22 
23 #ifndef PATHSURFACES_H
24 #define PATHSURFACES_H
25 
26 #include "common.h"
27 #include "model/position.h"
28 
29     typedef struct {
30         // tile walkable data from g_App.walkdata_p_[]
31         unsigned char twd;
32     }surfaceDesc;
33 
34     typedef struct {
35         // mapFloodDesc
36         // 0 - not defined, 0b - base point, 1b - target point,
37         // 2b - link (when base point reaches target point or vice versa),
38         // 3b - walkable, 4b - constant, 5b - non walkable, 6b - needs to
39         // be defined, after tiles are defined as walkable this flag will
40         // have meaning of safe walking ground (non-highway, non-railway tiles)
41         unsigned char t;
42         // dirh(z + 1), dirm(z), dirl(z - 1) - directions
43         // 0x01 = (x, y + 1, z); 0x02 = (x + 1, y + 1, z);
44         // 0x04 = (x + 1, y, z); 0x08 = (x + 1, y - 1, z);
45         // 0x10 = (x, y - 1, z); 0x20 = (x - 1, y - 1, z);
46         // 0x40 = (x - 1, y, z); 0x80 = (x - 1, y + 1, z)
47         // can be combined 0x01 | 0x02; 0x01 | 0x10 | 0x40 etc.
48         unsigned char dirh;
49         unsigned char dirm;
50         unsigned char dirl;
51 
52         unsigned short lvl;
53     }floodPointDesc;
54 
55     typedef enum {
56         m_fdNotDefined    = 0,
57         m_fdBasePoint     = 1,
58         m_fdTargetPoint   = 2,
59         m_fdLink          = 4,
60         m_fdWalkable      = 8,
61         m_fdConstant      = 16,
62         m_fdNonWalkable   = 32,
63         m_fdDefReq        = 64,
64         m_fdSafeWalk      = 64
65     } mapFloodDesc;
66 
67     struct toSetDesc {
68         WorldPoint coords;
69         floodPointDesc *p;
70     };
71     typedef struct {
72         uint16 indxs;
73         uint16 n;
74     } lvlNodesDesc;
75 
76 #endif
77 
78