]> icculus.org git repositories - divverent/netradiant.git/blob - include/ifilter.h
deluxe: always use a MINIMUM light contribution from ambient
[divverent/netradiant.git] / include / ifilter.h
1 /*
2 Copyright (C) 2001-2006, William Joseph.
3 All Rights Reserved.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 */
21
22 #if !defined(INCLUDED_IFILTER_H)
23 #define INCLUDED_IFILTER_H
24
25 #include "generic/constant.h"
26
27 enum
28 {
29    EXCLUDE_WORLD            = 0x00000001,
30    EXCLUDE_ENT              = 0x00000002,
31    EXCLUDE_CURVES           = 0x00000004,
32    EXCLUDE_TRANSLUCENT      = 0x00000008,
33    EXCLUDE_LIQUIDS          = 0x00000010,
34    EXCLUDE_CAULK            = 0x00000020,
35    EXCLUDE_CLIP             = 0x00000040,
36    EXCLUDE_PATHS            = 0x00000080,
37    EXCLUDE_LIGHTS           = 0x00000100,
38    EXCLUDE_DETAILS          = 0x00000200,
39    EXCLUDE_HINTSSKIPS       = 0x00000400,
40    EXCLUDE_MODELS           = 0x00000800,
41    EXCLUDE_AREAPORTALS      = 0x00001000,
42    EXCLUDE_TRIGGERS         = 0x00002000,
43    EXCLUDE_CLUSTERPORTALS         = 0x00004000,
44    EXCLUDE_TERRAIN          = 0x00008000,
45    EXCLUDE_LIGHTGRID        = 0x00010000,
46    EXCLUDE_STRUCTURAL       = 0x00020000,
47    EXCLUDE_BOTCLIP          = 0x00040000,
48    EXCLUDE_VISPORTALS       = 0x00080000,
49 };
50
51 class Filter
52 {
53 public:
54   virtual void setActive(bool active) = 0;
55 };
56
57 class Filterable
58 {
59 public:
60   virtual void updateFiltered() = 0;
61 };
62
63 class FilterSystem
64 {
65 public:
66   INTEGER_CONSTANT(Version, 1);
67   STRING_CONSTANT(Name, "filters");
68   virtual void addFilter(Filter& filter, int mask) = 0;
69   virtual void registerFilterable(Filterable& filterable) = 0;
70   virtual void unregisterFilterable(Filterable& filterable) = 0;
71 };
72
73 #include "modulesystem.h"
74
75 template<typename Type>
76 class GlobalModule;
77 typedef GlobalModule<FilterSystem> GlobalFilterModule;
78
79 template<typename Type>
80 class GlobalModuleRef;
81 typedef GlobalModuleRef<FilterSystem> GlobalFilterModuleRef;
82
83 inline FilterSystem& GlobalFilterSystem()
84 {
85   return GlobalFilterModule::getTable();
86 }
87
88 #endif