* added basic code for ufoai plugin (this still needs the pending filter api patch...
[xonotic/netradiant.git] / contrib / ufoai / ufoai_filters.cpp
1
2 #include "plugin.h"
3 #include "ifilters.h"
4
5 #define FilterAdd g_FuncTable.m_pfnFilterAdd
6
7 enum FILTERS {
8         FILTER_ACTORCLIP,
9         FILTER_WEAPONCLIP,
10         FILTER_NODRAW,
11         FILTER_STEPON,
12         FILTER_LEVEL1,
13         FILTER_LEVEL2,
14         FILTER_LEVEL3,
15         FILTER_LEVEL4,
16         FILTER_LEVEL5,
17         FILTER_LEVEL6,
18         FILTER_LEVEL7,
19         FILTER_LEVEL8,
20
21         FILTER_MAX
22 };
23
24 static bfilter_t* filters[FILTER_MAX];
25
26 void UFOAIFilterInit (void)
27 {
28         filters[FILTER_LEVEL1] = FilterAdd(1, 0, "level1", (0x10 << 0));
29         filters[FILTER_LEVEL2] = FilterAdd(1, 0, "level2", (0x10 << 1));
30         filters[FILTER_LEVEL3] = FilterAdd(1, 0, "level3", (0x10 << 2));
31         filters[FILTER_LEVEL4] = FilterAdd(1, 0, "level4", (0x10 << 3));
32         filters[FILTER_LEVEL5] = FilterAdd(1, 0, "level5", (0x10 << 4));
33         filters[FILTER_LEVEL6] = FilterAdd(1, 0, "level6", (0x10 << 5));
34         filters[FILTER_LEVEL7] = FilterAdd(1, 0, "level7", (0x10 << 6));
35         filters[FILTER_LEVEL8] = FilterAdd(1, 0, "level8", (0x10 << 7));
36 }
37
38 void PerformFiltering (int type)
39 {
40         switch (type) {
41         default:
42                 Sys_Printf("TODO: Implement filters");
43                 break;
44         }
45 }
46
47 void DoSteponFiltering(void)
48 {
49         PerformFiltering(FILTER_STEPON);
50 }
51
52 void DoWeaponClipFiltering(void)
53 {
54         PerformFiltering(FILTER_WEAPONCLIP);
55 }
56
57 void DoActorClipFiltering(void)
58 {
59         PerformFiltering(FILTER_ACTORCLIP);
60 }
61
62 void DoNoDrawFiltering(void)
63 {
64         PerformFiltering(FILTER_NODRAW);
65 }
66
67 void DoLevel1Filtering(void)
68 {
69         PerformFiltering(FILTER_LEVEL1);
70 }
71
72 void DoLevel2Filtering(void)
73 {
74         PerformFiltering(FILTER_LEVEL2);
75 }
76
77 void DoLevel3Filtering(void)
78 {
79         PerformFiltering(FILTER_LEVEL3);
80 }
81
82 void DoLevel4Filtering(void)
83 {
84         PerformFiltering(FILTER_LEVEL4);
85 }
86
87 void DoLevel5Filtering(void)
88 {
89         PerformFiltering(FILTER_LEVEL5);
90 }
91
92 void DoLevel6Filtering(void)
93 {
94         PerformFiltering(FILTER_LEVEL6);
95 }
96
97 void DoLevel7Filtering(void)
98 {
99         PerformFiltering(FILTER_LEVEL7);
100 }
101
102 void DoLevel8Filtering(void)
103 {
104         PerformFiltering(FILTER_LEVEL8);
105 }