Debian Codegraph @

Descent3/bnode.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/bnode.h $
21 * $Revision: 13 $
22 * $Date: 5/06/99 5:18p $
23 * $Author: Chris $
24 *
25 * BOA Helper Node structs and externs
26 *
27 * $Log: /DescentIII/main/bnode.h $
28 *
29 * 13 5/06/99 5:18p Chris
30 * Updated the BNode system - vastly improved error checking and verify
31 *
32 * 12 5/03/99 12:56a 3dsmax
33 * Knocked MAX_BNODES_PER_ROOM down to 127 after reading the comment about
34 * a byte count in the portal struct.
35 *
36 * 11 5/03/99 12:50a 3dsmax
37 * Changed MAX_BNODES_PER_ROOM from 100 to 200 for Luke. (MattT)
38 *
39 * 10 4/29/99 1:59a Chris
40 * Added the portal blockage support
41 *
42 * 9 4/28/99 5:33a Chris
43 * Further improved the BNode system. (It actually works inside and
44 * outside now)
45 *
46 * 8 4/27/99 3:01a Chris
47 * Improving Bnode stuff
48 *
49 * 7 4/26/99 11:11a Chris
50 * Updated Bnode system
51 *
52 * 6 4/25/99 9:02p Chris
53 * Improving the Bnode system
54 *
55 * 5 4/18/99 4:35p Matt
56 * Changed BNode_FreeRoom() to take a room pointer instead of a room
57 * number, since it was being called for rooms in the scrap buffer, which
58 * weren't in the room list. Also added code to InitRoom() to init the
59 * bnode data.
60 *
61 * 4 4/18/99 5:39a Chris
62 * Vastly improved the path node system
63 *
64 * 3 4/15/99 5:48p Chris
65 * Fixed a bug with rendering the BOAPath nodes
66 *
67 * 2 4/14/99 3:13p Chris
68 * Beginning to add BoaNode stuff
69 *
70 * $NoKeywords: $
71 */
72
73 #ifndef BNODE_H_
74 #define BNODE_H_
75
76 #include "vecmat_external.h"
77
78 #define MAX_BNODE_SIZE 20.0f
79 // Not bigger than 127 - char bnode - in portal struct
80 #define MAX_BNODES_PER_ROOM 127
81
82 struct bn_edge {
83 int16_t end_room;
84 char end_index;
85
86 int16_t flags;
87 int16_t cost;
88
89 float max_rad;
90 };
91
92 struct bn_node {
93 vector pos;
94 int num_edges;
95 bn_edge *edges;
96 };
97
98 struct bn_list {
99 int num_nodes;
100 bn_node *nodes;
101 };
102
103 struct room;
104
105 extern void BNode_FreeRoom(room *rp);
106 extern void BNode_ClearBNodeInfo(void);
107
108 bn_list *BNode_GetBNListPtr(int roomnum, bool f_in_load_level = false);
109
110 extern bn_list BNode_terrain_list[8];
111 extern bool BNode_allocated;
112 extern bool BNode_verified;
113 void BNode_RemapTerrainRooms(int old_hri, int new_hri);
114
115 extern int BNode_Path[MAX_BNODES_PER_ROOM];
116 extern int BNode_PathNumNodes;
117 extern bool BNode_FindPath(int start_room, int i, int j, float rad);
118 extern int BNode_FindDirLocalVisibleBNode(int roomnum, vector *pos, vector *fvec, float rad);
119 extern int BNode_FindClosestLocalVisibleBNode(int roomnum, vector *pos, float rad);
120
121 #endif