Debian Codegraph @

prboom2/src/dsda/id_list.h

raw
1 //
2 // Copyright(C) 2023 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA ID List
16 //
17
18 #ifndef __DSDA_ID_LIST__
19 #define __DSDA_ID_LIST__
20
21 #include "r_main.h"
22
23 void dsda_AddLineID(int id, int value);
24 void dsda_AddSectorID(int id, int value);
25 const int* dsda_FindLinesFromID(int id);
26 const int* dsda_FindSectorsFromID(int id);
27 const int* dsda_FindSectorsFromIDOrLine(int id, const line_t *line);
28 void dsda_ResetLineIDList(int size);
29 void dsda_ResetSectorIDList(int size);
30
31 #define FIND_SECTORS(id_p, tag) for (id_p = dsda_FindSectorsFromID(tag); *id_p >= 0; id_p++)
32 #define FIND_SECTORS2(id_p, tag, line) for (id_p = dsda_FindSectorsFromIDOrLine(tag, line); *id_p >= 0; id_p++)
33
34 #define FIND_LINES(id_p, tag) for (id_p = dsda_FindLinesFromID(tag); *id_p >= 0; id_p++)
35
36 #endif