* updated ufoai plugin
* converted toolbar icons to indexed bitmaps - none indexed bitmaps are not supported git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant@211 8a3a26a2-13c4-0310-b231-cf6edde360e5
Before Width: | Height: | Size: 1,014 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 1,014 B After Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 1,014 B After Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 1,014 B After Width: | Height: | Size: 558 B |
|
@ -47,7 +47,7 @@ void *g_pMainWidget;
|
||||||
static const char *PLUGIN_COMMANDS = CMD_ABOUT ";" CMD_SEP;
|
static const char *PLUGIN_COMMANDS = CMD_ABOUT ";" CMD_SEP;
|
||||||
static const char *PLUGIN_ABOUT = "UFO: Alien Invasion plugin " PLUGIN_VERSION "\nby Martin Gerhardy";
|
static const char *PLUGIN_ABOUT = "UFO: Alien Invasion plugin " PLUGIN_VERSION "\nby Martin Gerhardy";
|
||||||
|
|
||||||
#define NUM_TOOLBAR_BUTTONS 12
|
#define NUM_TOOLBAR_BUTTONS FILTER_MAX
|
||||||
typedef struct toolbar_button_info_s
|
typedef struct toolbar_button_info_s
|
||||||
{
|
{
|
||||||
char *image;
|
char *image;
|
||||||
|
@ -59,6 +59,34 @@ typedef struct toolbar_button_info_s
|
||||||
|
|
||||||
static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
|
static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
"ufoai_actorclip.bmp",
|
||||||
|
"Filter actorclip",
|
||||||
|
"Actorclip",
|
||||||
|
DoActorClipFiltering,
|
||||||
|
IToolbarButton::eToggleButton
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ufoai_weaponclip.bmp",
|
||||||
|
"Filter weaponclip",
|
||||||
|
"Weaponclip",
|
||||||
|
DoWeaponClipFiltering,
|
||||||
|
IToolbarButton::eToggleButton
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ufoai_nodraw.bmp",
|
||||||
|
"Filter nodraw",
|
||||||
|
"NoDraw",
|
||||||
|
DoNoDrawFiltering,
|
||||||
|
IToolbarButton::eToggleButton
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ufoai_stepon.bmp",
|
||||||
|
"Filter stepon",
|
||||||
|
"Stepon",
|
||||||
|
DoSteponFiltering,
|
||||||
|
IToolbarButton::eToggleButton
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"ufoai_level1.bmp",
|
"ufoai_level1.bmp",
|
||||||
"Filter level1",
|
"Filter level1",
|
||||||
|
@ -115,34 +143,6 @@ static const toolbar_button_info_t toolbar_buttons[NUM_TOOLBAR_BUTTONS] =
|
||||||
DoLevel8Filtering,
|
DoLevel8Filtering,
|
||||||
IToolbarButton::eToggleButton
|
IToolbarButton::eToggleButton
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ufoai_actorclip.bmp",
|
|
||||||
"Filter actorclip",
|
|
||||||
"Actorclip",
|
|
||||||
DoActorClipFiltering,
|
|
||||||
IToolbarButton::eToggleButton
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ufoai_stepon.bmp",
|
|
||||||
"Filter stepon",
|
|
||||||
"Stepon",
|
|
||||||
DoSteponFiltering,
|
|
||||||
IToolbarButton::eToggleButton
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ufoai_weaponclip.bmp",
|
|
||||||
"Filter weaponclip",
|
|
||||||
"Weaponclip",
|
|
||||||
DoWeaponClipFiltering,
|
|
||||||
IToolbarButton::eToggleButton
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ufoai_nodraw.bmp",
|
|
||||||
"Filter nodraw",
|
|
||||||
"NoDraw",
|
|
||||||
DoNoDrawFiltering,
|
|
||||||
IToolbarButton::eToggleButton
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class UFOAIButton : public IToolbarButton
|
class UFOAIButton : public IToolbarButton
|
||||||
|
|
|
@ -1,47 +1,48 @@
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "ufoai_filters.h"
|
||||||
#include "ifilters.h"
|
#include "ifilters.h"
|
||||||
|
|
||||||
#define FilterAdd g_FuncTable.m_pfnFilterAdd
|
#define FilterAdd g_FuncTable.m_pfnFilterAdd
|
||||||
|
#define FiltersActivate g_FuncTable.m_pfnFiltersActivate
|
||||||
enum FILTERS {
|
|
||||||
FILTER_ACTORCLIP,
|
|
||||||
FILTER_WEAPONCLIP,
|
|
||||||
FILTER_NODRAW,
|
|
||||||
FILTER_STEPON,
|
|
||||||
FILTER_LEVEL1,
|
|
||||||
FILTER_LEVEL2,
|
|
||||||
FILTER_LEVEL3,
|
|
||||||
FILTER_LEVEL4,
|
|
||||||
FILTER_LEVEL5,
|
|
||||||
FILTER_LEVEL6,
|
|
||||||
FILTER_LEVEL7,
|
|
||||||
FILTER_LEVEL8,
|
|
||||||
|
|
||||||
FILTER_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
static bfilter_t* filters[FILTER_MAX];
|
static bfilter_t* filters[FILTER_MAX];
|
||||||
|
|
||||||
void UFOAIFilterInit (void)
|
void UFOAIFilterInit (void)
|
||||||
{
|
{
|
||||||
filters[FILTER_LEVEL1] = FilterAdd(1, 0, "level1", (0x10 << 0));
|
filters[FILTER_ACTORCLIP] = FilterAdd(2, 0, "actorclip", UFOAI_CONTENTS_ACTORCLIP);
|
||||||
filters[FILTER_LEVEL2] = FilterAdd(1, 0, "level2", (0x10 << 1));
|
filters[FILTER_WEAPONCLIP] = FilterAdd(2, 0, "weaponclip", UFOAI_CONTENTS_WEAPONCLIP);
|
||||||
filters[FILTER_LEVEL3] = FilterAdd(1, 0, "level3", (0x10 << 2));
|
filters[FILTER_NODRAW] = FilterAdd(2, 0, "nodraw", UFOAI_SURF_NODRAW);
|
||||||
filters[FILTER_LEVEL4] = FilterAdd(1, 0, "level4", (0x10 << 3));
|
filters[FILTER_STEPON] = FilterAdd(2, 0, "stepon", UFOAI_CONTENTS_STEPON);
|
||||||
filters[FILTER_LEVEL5] = FilterAdd(1, 0, "level5", (0x10 << 4));
|
|
||||||
filters[FILTER_LEVEL6] = FilterAdd(1, 0, "level6", (0x10 << 5));
|
filters[FILTER_LEVEL1] = FilterAdd(2, 0, "level1", UFOAI_CONTENTS_LEVEL_1);
|
||||||
filters[FILTER_LEVEL7] = FilterAdd(1, 0, "level7", (0x10 << 6));
|
filters[FILTER_LEVEL2] = FilterAdd(2, 0, "level2", UFOAI_CONTENTS_LEVEL_2);
|
||||||
filters[FILTER_LEVEL8] = FilterAdd(1, 0, "level8", (0x10 << 7));
|
filters[FILTER_LEVEL3] = FilterAdd(2, 0, "level3", UFOAI_CONTENTS_LEVEL_3);
|
||||||
|
filters[FILTER_LEVEL4] = FilterAdd(2, 0, "level4", UFOAI_CONTENTS_LEVEL_4);
|
||||||
|
filters[FILTER_LEVEL5] = FilterAdd(2, 0, "level5", UFOAI_CONTENTS_LEVEL_5);
|
||||||
|
filters[FILTER_LEVEL6] = FilterAdd(2, 0, "level6", UFOAI_CONTENTS_LEVEL_6);
|
||||||
|
filters[FILTER_LEVEL7] = FilterAdd(2, 0, "level7", UFOAI_CONTENTS_LEVEL_7);
|
||||||
|
filters[FILTER_LEVEL8] = FilterAdd(2, 0, "level8", UFOAI_CONTENTS_LEVEL_8);
|
||||||
|
|
||||||
|
Sys_Printf("UFO:AI Filters initialized\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PerformFiltering (int type)
|
void PerformFiltering (int type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
if (!filters[type]) {
|
||||||
default:
|
Sys_Printf("filters are not yet initialized\n");
|
||||||
Sys_Printf("TODO: Implement filters");
|
return;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filters[type]->active) {
|
||||||
|
filters[type]->active = false;
|
||||||
|
Sys_Printf("filter %i deactivated\n", type);
|
||||||
|
} else {
|
||||||
|
filters[type]->active = true;
|
||||||
|
Sys_Printf("filter %i activated\n", type);
|
||||||
|
}
|
||||||
|
|
||||||
|
FiltersActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSteponFiltering(void)
|
void DoSteponFiltering(void)
|
||||||
|
|
|
@ -1,4 +1,37 @@
|
||||||
|
|
||||||
|
enum FILTERS {
|
||||||
|
FILTER_ACTORCLIP,
|
||||||
|
FILTER_WEAPONCLIP,
|
||||||
|
FILTER_NODRAW,
|
||||||
|
FILTER_STEPON,
|
||||||
|
FILTER_LEVEL1,
|
||||||
|
FILTER_LEVEL2,
|
||||||
|
FILTER_LEVEL3,
|
||||||
|
FILTER_LEVEL4,
|
||||||
|
FILTER_LEVEL5,
|
||||||
|
FILTER_LEVEL6,
|
||||||
|
FILTER_LEVEL7,
|
||||||
|
FILTER_LEVEL8,
|
||||||
|
|
||||||
|
FILTER_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_1 0x0100
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_2 0x0200
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_3 0x0400
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_4 0x0800
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_5 0x1000
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_6 0x2000
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_7 0x4000
|
||||||
|
#define UFOAI_CONTENTS_LEVEL_8 0x8000
|
||||||
|
|
||||||
|
#define UFOAI_CONTENTS_ACTORCLIP 0x00010000
|
||||||
|
#define UFOAI_CONTENTS_WEAPONCLIP 0x02000000
|
||||||
|
#define UFOAI_CONTENTS_STEPON 0x40000000
|
||||||
|
|
||||||
|
#define UFOAI_SURF_NODRAW 0x00000080
|
||||||
|
|
||||||
|
|
||||||
void DoSteponFiltering(void);
|
void DoSteponFiltering(void);
|
||||||
void DoWeaponClipFiltering(void);
|
void DoWeaponClipFiltering(void);
|
||||||
void DoActorClipFiltering(void);
|
void DoActorClipFiltering(void);
|
||||||
|
|