]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/filters.cpp
* allow the setting of the orientation and the gametype in the gtkgensurf plugin...
[xonotic/netradiant.git] / radiant / filters.cpp
index 9bd8503575cc2409dd3dfa3b6bea376e7b4688d1..4931d4d3974e1b2538b59bd0a3187137c214d93e 100644 (file)
@@ -30,6 +30,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include "stdafx.h"
 
+// type 1 = texture filter (name)
+// type 3 = entity filter (name)
+// type 2 = QER_* shader flags
+// type 4 = entity classes
 bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exclude)
 {
        bfilter_t *pNew = new bfilter_t;
@@ -44,6 +48,21 @@ bfilter_t *FilterAdd(bfilter_t *pFilter, int type, int bmask, char *str, int exc
        return pNew;
 }
 
+bfilter_t *FilterCreate (int type, int bmask, char *str, int exclude)
+{
+       g_qeglobals.d_savedinfo.filters = FilterAdd(g_qeglobals.d_savedinfo.filters, type, bmask, str, exclude);
+       Syn_Printf("Added filter %s (type: %i, bmask: %i, exclude: %i)\n", str, type, bmask, exclude);
+       return g_qeglobals.d_savedinfo.filters;
+}
+
+extern void PerformFiltering();
+
+void FiltersActivate (void)
+{
+       PerformFiltering();
+       Sys_UpdateWindows(W_XY|W_CAMERA);
+}
+
   // removes the filter list at *pFilter, returns NULL pointer
 bfilter_t *FilterListDelete(bfilter_t *pFilter)
 {
@@ -137,7 +156,7 @@ bool FilterBrush(brush_t *pb)
                || !strncmp( pb->owner->eclass->name, "func", 4)
                || !strncmp( pb->owner->eclass->name, "trigger", 7) ) && !pb->patchBrush )
        {
-               bool filterbrush;
+               bool filterbrush = false;
                for (face_t *f=pb->brush_faces;f!=NULL;f = f->next)
                {
                        filterbrush=false;