Debian Codegraph @

Descent3/gamepath.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/gamepath.h $
21 * $Revision: 12 $
22 * $Date: 10/08/98 4:23p $
23 * $Author: Kevin $
24 *
25 * Header for gamepath.cpp
26 *
27 * $Log: /DescentIII/main/gamepath.h $
28 *
29 * 12 10/08/98 4:23p Kevin
30 * Changed code to comply with memory library usage. Always use mem_malloc
31 * , mem_free and mem_strdup
32 *
33 * 11 2/10/98 10:48a Matt
34 * Moved editor code from gamepath.cpp to epath.cpp
35 *
36 */
37
38 #ifndef GAME_PATH_H
39 #define GAME_PATH_Hcxx . . $ `Descent3/gamepath.h:39:9`!
40
41 #include "stdlib.h"
42 #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/
43 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
44 #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/
45 #include "3d.h"cxx . . $ `<file>/lib/3d.h`/
46 #include "manage.h"cxx . . $ `<file>/lib/manage.h`/
47 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
48 // chrishack -- this could be dynamically allocated at the beginning of a level
49 // MAX_NODES_PER_PATH is big and so is MAX_GAME_PATHS
50
51 #define MAX_GAME_PATHScxx . . $ `Descent3/gamepath.h:51:9`! 300
52 #define MAX_NODES_PER_PATHcxx . . $ `Descent3/gamepath.h:52:9`! 100
53
54 struct nodecxx . . $ node# {
55 vectorcxx . . $ vector# poscxx . . $ node#pos.; // where this node is in the world
56 int roomnumcxx . . $ node#roomnum.; // what room?
57 int flagscxx . . $ node#flags.; // if this point lives over the terrain, etc
58 vectorcxx . . $ vector# fveccxx . . $ node#fvec.;
59 vectorcxx . . $ vector# uveccxx . . $ node#uvec.;
60 };
61
62 class game_pathcxx . . $ game_path# {
63 public:
64 game_pathcxx . . $ game_path#game_path(49f6e7a06ebc5aa8).() {
65 num_nodescxx . . $ game_path#num_nodes. = 0;
66 pathnodescxx . . $ game_path#pathnodes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
67 usedcxx . . $ game_path#used. = false;
68 }
69 ~cxx . . $ game_path#`~game_path`(ced63f7c635d850d).game_pathcxx . . $ game_path#() {
70 if (usedcxx . . $ game_path#used.)
71 mem_freecxx . . $ free(bd21765a0afc8e3c).(pathnodes);
72 usedcxx . . $ game_path#used. = false;
73 }
74
75 nodecxx . . $ node# *pathnodescxx . . $ game_path#pathnodes.;
76 int num_nodescxx . . $ game_path#num_nodes.; // how many nodes in this path?
77 char namecxx . . $ game_path#name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; // the name of this path
78 uint8_tcxx . . $ uint8_t# flagscxx . . $ game_path#flags.; // special properties of this path
79 bool usedcxx . . $ game_path#used.; // if this path is in use
80 };
81
82 extern game_pathcxx . . $ game_path# GamePathscxx . . $ GamePaths.[MAX_GAME_PATHScxx . . $ `Descent3/gamepath.h:51:9`!];
83 extern int Num_game_pathscxx . . $ Num_game_paths.;
84
85 void InitGamePathscxx . . $ InitGamePaths(49f6e7a06ebc5aa8).();
86
87 // searches through GamePath index and returns index of path matching name
88 // returns -1 if not found
89 int FindGamePathNamecxx . . $ FindGamePathName(5c4306d8553b3696).(const char *name);
90
91 #endif