| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |
EXCLUDE_DECALS = 0x00100000, |
| 50 |
EXCLUDE_FUNC_GROUPS = 0x00200000, |
| 51 |
}; |
| 52 |
|
| 53 |
class Filter |
| 54 |
{ |
| 55 |
public: |
| 56 |
virtual void setActive( bool active ) = 0; |
| 57 |
}; |
| 58 |
|
| 59 |
class Filterable |
| 60 |
{ |
| 61 |
public: |
| 62 |
virtual void updateFiltered() = 0; |
| 63 |
}; |
| 64 |
|
| 65 |
class FilterSystem |
| 66 |
{ |
| 67 |
public: |
| 68 |
INTEGER_CONSTANT( Version, 1 ); |
| 69 |
STRING_CONSTANT( Name, "filters" ); |
| 70 |
virtual void addFilter( Filter& filter, int mask ) = 0; |
| 71 |
virtual void registerFilterable( Filterable& filterable ) = 0; |
| 72 |
virtual void unregisterFilterable( Filterable& filterable ) = 0; |
| 73 |
}; |
| 74 |
|
| 75 |
#include "modulesystem.h" |
| 76 |
|
| 77 |
template<typename Type> |
| 78 |
class GlobalModule; |
| 79 |
typedef GlobalModule<FilterSystem> GlobalFilterModule; |
| 80 |
|
| 81 |
template<typename Type> |
| 82 |
class GlobalModuleRef; |
| 83 |
typedef GlobalModuleRef<FilterSystem> GlobalFilterModuleRef; |
| 84 |
|
| 85 |
inline FilterSystem& GlobalFilterSystem(){ |
| 86 |
return GlobalFilterModule::getTable(); |
| 87 |
} |
| 88 |
|
| 89 |
#endif |