]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
refactored CONTENTS_DETAIL macro
authorspog <spog>
Sun, 13 Aug 2006 13:55:20 +0000 (13:55 +0000)
committerspog <spog>
Sun, 13 Aug 2006 13:55:20 +0000 (13:55 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@99 8a3a26a2-13c4-0310-b231-cf6edde360e5

radiant/brush.h
radiant/brushmanip.cpp
radiant/surfacedialog.cpp

index ab2029844d32eaa1a9857c9c97b539dc84411261..b4c0f0934d0e7ffccc2f97bfce18cbd744257ce3 100644 (file)
@@ -65,8 +65,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "winding.h"
 #include "brush_primit.h"
 
-#define CONTENTS_DETAIL 0x8000000
-
+const unsigned int BRUSH_DETAIL_FLAG = 27;
+const unsigned int BRUSH_DETAIL_MASK = (1 << BRUSH_DETAIL_FLAG);
 
 enum EBrushType
 {
@@ -380,15 +380,15 @@ public:
 
 inline void ContentsFlagsValue_assignMasked(ContentsFlagsValue& flags, const ContentsFlagsValue& other)
 {
-  bool detail = bitfield_enabled(flags.m_contentFlags, CONTENTS_DETAIL);
+  bool detail = bitfield_enabled(flags.m_contentFlags, BRUSH_DETAIL_MASK);
   flags = other;
   if(detail)
   {
-    flags.m_contentFlags = bitfield_enable(flags.m_contentFlags, CONTENTS_DETAIL);
+    flags.m_contentFlags = bitfield_enable(flags.m_contentFlags, BRUSH_DETAIL_MASK);
   }
   else
   {
-    flags.m_contentFlags = bitfield_disable(flags.m_contentFlags, CONTENTS_DETAIL);
+    flags.m_contentFlags = bitfield_disable(flags.m_contentFlags, BRUSH_DETAIL_MASK);
   }
 }
 
@@ -1416,18 +1416,18 @@ public:
 
   bool isDetail() const
   {
-    return (m_shader.m_flags.m_contentFlags & CONTENTS_DETAIL) != 0;
+    return (m_shader.m_flags.m_contentFlags & BRUSH_DETAIL_MASK) != 0;
   }
   void setDetail(bool detail)
   {
     undoSave();
     if(detail && !isDetail())
     {
-      m_shader.m_flags.m_contentFlags |= CONTENTS_DETAIL;
+      m_shader.m_flags.m_contentFlags |= BRUSH_DETAIL_MASK;
     }
     else if(!detail && isDetail())
     {
-      m_shader.m_flags.m_contentFlags &= ~CONTENTS_DETAIL;
+      m_shader.m_flags.m_contentFlags &= ~BRUSH_DETAIL_MASK;
     }
     m_observer->shaderChanged();
   }
index c7b63bf2e1c035e4aa9ff074084fcecfb106ebe8..7b1d08bf0d2251bea2a542d2ac45538ef3d96573 100644 (file)
@@ -996,7 +996,7 @@ filter_brush_all_faces g_filter_brush_lightgrid(&g_filter_face_lightgrid);
 filter_face_flags g_filter_face_translucent(QER_TRANS);
 filter_brush_all_faces g_filter_brush_translucent(&g_filter_face_translucent);
 
-filter_face_contents g_filter_face_detail(CONTENTS_DETAIL);
+filter_face_contents g_filter_face_detail(BRUSH_DETAIL_MASK);
 filter_brush_all_faces g_filter_brush_detail(&g_filter_face_detail);
 
 
index d8183fa5a121748b558b47bfc1918d03069a75e1..0343bbd2a9a388743cbf2011ff551b8b62a8ba32 100644 (file)
@@ -1065,7 +1065,7 @@ GtkWindow* SurfaceInspector::BuildDialog()
             }
 
             // not allowed to modify detail flag using Surface Inspector
-            gtk_widget_set_sensitive(GTK_WIDGET(m_contentFlags[27]), FALSE);
+            gtk_widget_set_sensitive(GTK_WIDGET(m_contentFlags[BRUSH_DETAIL_FLAG]), FALSE);
           }
         }
       }