Debian Codegraph @

prboom2/src/dsda/features.h

raw
1 //
2 // Copyright(C) 2022 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 Features
16 //
17
18 #include "doomtype.h"
19
20 typedef enum {
21 uf_menu,
22 uf_exhud,
23 uf_advhud,
24 uf_crosshair,
25 uf_quickstartcache,
26 uf_100k,
27 uf_console,
28 // 7
29 // 8
30 // 9
31 // 10
32 // 11
33 // 12
34 // 13
35 // 14
36 // 15
37 // 16
38 // 17
39 // 18
40 // 19
41 // 20
42 // 21
43 // 22
44 // 23
45 // 24
46 // 25
47 // 26
48 // 27
49 // 28
50 // 29
51
52 uf_unknown = 30,
53 uf_invalid = 31,
54
55 uf_iddt = 32,
56 uf_automap,
57 uf_liteamp,
58 uf_build,
59 uf_buildzero,
60 uf_bruteforce,
61 uf_tracker,
62 uf_keyframe,
63 uf_skip,
64 uf_wipescreen,
65 uf_speedup,
66 uf_slowdown,
67 uf_coordinates,
68 uf_mouselook,
69 uf_weaponalignment,
70 uf_commanddisplay,
71 uf_crosshaircolor,
72 uf_crosshairlock,
73 uf_shadows,
74 uf_painpalette,
75 uf_bonuspalette,
76 uf_powerpalette,
77 uf_healthbar,
78 uf_alwayssr50,
79 uf_maxplayercorpse,
80 uf_hideweapon,
81 uf_showalive,
82 uf_join,
83 uf_mouse_and_controller,
84 uf_ghost,
85 uf_advanced_map,
86 // uf_blink_keys = 63
87 // uf_fuzz = 64
88 uf_vanillatrans = 65,
89 uf_ghosttrans,
90 uf_levelbrightness,
91 // 68
92
93 // 127
94 } dsda_feature_flag_t;
95
96 #define BITMASK(b) (1 << ((b) % 8))
97 #define BITSLOT(b) ((b) / 8)
98 #define BITSET(a, b) ((a)[BITSLOT(b)] |= BITMASK(b))
99 #define BITCLEAR(a, b) ((a)[BITSLOT(b)] &= ~BITMASK(b))
100 #define BITTEST(a, b) ((a)[BITSLOT(b)] & BITMASK(b))
101 #define BITNSLOTS(nb) ((nb + 8 - 1) / 8)
102
103 #define FEATURE_SIZE 128
104 #define FEATURE_SLOTS BITNSLOTS(FEATURE_SIZE)
105
106
107 void dsda_TrackFeature(int feature);
108 void dsda_ResetFeatures(void);
109 byte *dsda_UsedFeatures(void);
110 void dsda_MergeFeatures(byte *source);
111 void dsda_CopyFeatures(byte* result);
112 char* dsda_DescribeFeatures(void);