Changeset 211
- Timestamp:
- 03/16/08 04:53:49 (4 months ago)
- Files:
-
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_actorclip.bmp (modified) (previous)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_nodraw.bmp (modified) (previous)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_stepon.bmp (modified) (previous)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/bitmaps/ufoai_weaponclip.bmp (modified) (previous)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/plugin.cpp (modified) (3 diffs)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/ufoai_filters.cpp (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant/contrib/ufoai/ufoai_filters.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/branches/ZeroRadiant/contrib/ufoai/plugin.cpp
r207 r211 48 48 static const char *PLUGIN_ABOUT = "UFO: Alien Invasion plugin " PLUGIN_VERSION "\nby Martin Gerhardy"; 49 49 50 #define NUM_TOOLBAR_BUTTONS 1250 #define NUM_TOOLBAR_BUTTONS FILTER_MAX 51 51 typedef struct toolbar_button_info_s 52 52 { … … 61 61 { 62 62 { 63 "ufoai_actorclip.bmp", 64 "Filter actorclip", 65 "Actorclip", 66 DoActorClipFiltering, 67 IToolbarButton::eToggleButton 68 }, 69 { 70 "ufoai_weaponclip.bmp", 71 "Filter weaponclip", 72 "Weaponclip", 73 DoWeaponClipFiltering, 74 IToolbarButton::eToggleButton 75 }, 76 { 77 "ufoai_nodraw.bmp", 78 "Filter nodraw", 79 "NoDraw", 80 DoNoDrawFiltering, 81 IToolbarButton::eToggleButton 82 }, 83 { 84 "ufoai_stepon.bmp", 85 "Filter stepon", 86 "Stepon", 87 DoSteponFiltering, 88 IToolbarButton::eToggleButton 89 }, 90 { 63 91 "ufoai_level1.bmp", 64 92 "Filter level1", … … 114 142 "Level 8", 115 143 DoLevel8Filtering, 116 IToolbarButton::eToggleButton117 },118 {119 "ufoai_actorclip.bmp",120 "Filter actorclip",121 "Actorclip",122 DoActorClipFiltering,123 IToolbarButton::eToggleButton124 },125 {126 "ufoai_stepon.bmp",127 "Filter stepon",128 "Stepon",129 DoSteponFiltering,130 IToolbarButton::eToggleButton131 },132 {133 "ufoai_weaponclip.bmp",134 "Filter weaponclip",135 "Weaponclip",136 DoWeaponClipFiltering,137 IToolbarButton::eToggleButton138 },139 {140 "ufoai_nodraw.bmp",141 "Filter nodraw",142 "NoDraw",143 DoNoDrawFiltering,144 144 IToolbarButton::eToggleButton 145 145 }, GtkRadiant/branches/ZeroRadiant/contrib/ufoai/ufoai_filters.cpp
r207 r211 1 1 2 2 #include "plugin.h" 3 #include "ufoai_filters.h" 3 4 #include "ifilters.h" 4 5 5 6 #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 }; 7 #define FiltersActivate g_FuncTable.m_pfnFiltersActivate 23 8 24 9 static bfilter_t* filters[FILTER_MAX]; … … 26 11 void UFOAIFilterInit (void) 27 12 { 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)); 13 filters[FILTER_ACTORCLIP] = FilterAdd(2, 0, "actorclip", UFOAI_CONTENTS_ACTORCLIP); 14 filters[FILTER_WEAPONCLIP] = FilterAdd(2, 0, "weaponclip", UFOAI_CONTENTS_WEAPONCLIP); 15 filters[FILTER_NODRAW] = FilterAdd(2, 0, "nodraw", UFOAI_SURF_NODRAW); 16 filters[FILTER_STEPON] = FilterAdd(2, 0, "stepon", UFOAI_CONTENTS_STEPON); 17 18 filters[FILTER_LEVEL1] = FilterAdd(2, 0, "level1", UFOAI_CONTENTS_LEVEL_1); 19 filters[FILTER_LEVEL2] = FilterAdd(2, 0, "level2", UFOAI_CONTENTS_LEVEL_2); 20 filters[FILTER_LEVEL3] = FilterAdd(2, 0, "level3", UFOAI_CONTENTS_LEVEL_3); 21 filters[FILTER_LEVEL4] = FilterAdd(2, 0, "level4", UFOAI_CONTENTS_LEVEL_4); 22 filters[FILTER_LEVEL5] = FilterAdd(2, 0, "level5", UFOAI_CONTENTS_LEVEL_5); 23 filters[FILTER_LEVEL6] = FilterAdd(2, 0, "level6", UFOAI_CONTENTS_LEVEL_6); 24 filters[FILTER_LEVEL7] = FilterAdd(2, 0, "level7", UFOAI_CONTENTS_LEVEL_7); 25 filters[FILTER_LEVEL8] = FilterAdd(2, 0, "level8", UFOAI_CONTENTS_LEVEL_8); 26 27 Sys_Printf("UFO:AI Filters initialized\n"); 36 28 } 37 29 38 30 void PerformFiltering (int type) 39 31 { 40 switch (type) { 41 default: 42 Sys_Printf("TODO: Implement filters"); 43 break; 32 if (!filters[type]) { 33 Sys_Printf("filters are not yet initialized\n"); 34 return; 44 35 } 36 37 if (filters[type]->active) { 38 filters[type]->active = false; 39 Sys_Printf("filter %i deactivated\n", type); 40 } else { 41 filters[type]->active = true; 42 Sys_Printf("filter %i activated\n", type); 43 } 44 45 FiltersActivate(); 45 46 } 46 47 GtkRadiant/branches/ZeroRadiant/contrib/ufoai/ufoai_filters.h
r207 r211 1 2 enum FILTERS { 3 FILTER_ACTORCLIP, 4 FILTER_WEAPONCLIP, 5 FILTER_NODRAW, 6 FILTER_STEPON, 7 FILTER_LEVEL1, 8 FILTER_LEVEL2, 9 FILTER_LEVEL3, 10 FILTER_LEVEL4, 11 FILTER_LEVEL5, 12 FILTER_LEVEL6, 13 FILTER_LEVEL7, 14 FILTER_LEVEL8, 15 16 FILTER_MAX 17 }; 18 19 #define UFOAI_CONTENTS_LEVEL_1 0x0100 20 #define UFOAI_CONTENTS_LEVEL_2 0x0200 21 #define UFOAI_CONTENTS_LEVEL_3 0x0400 22 #define UFOAI_CONTENTS_LEVEL_4 0x0800 23 #define UFOAI_CONTENTS_LEVEL_5 0x1000 24 #define UFOAI_CONTENTS_LEVEL_6 0x2000 25 #define UFOAI_CONTENTS_LEVEL_7 0x4000 26 #define UFOAI_CONTENTS_LEVEL_8 0x8000 27 28 #define UFOAI_CONTENTS_ACTORCLIP 0x00010000 29 #define UFOAI_CONTENTS_WEAPONCLIP 0x02000000 30 #define UFOAI_CONTENTS_STEPON 0x40000000 31 32 #define UFOAI_SURF_NODRAW 0x00000080 33 1 34 2 35 void DoSteponFiltering(void);
