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 ab20298..b4c0f09 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"
 
 #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
 {
 
 enum EBrushType
 {
@@ -380,15 +380,15 @@ public:
 
 inline void ContentsFlagsValue_assignMasked(ContentsFlagsValue& flags, const ContentsFlagsValue& other)
 {
 
 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 = 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
   {
   }
   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
   {
 
   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())
     {
   }
   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())
     {
     }
     else if(!detail && isDetail())
     {
-      m_shader.m_flags.m_contentFlags &= ~CONTENTS_DETAIL;
+      m_shader.m_flags.m_contentFlags &= ~BRUSH_DETAIL_MASK;
     }
     m_observer->shaderChanged();
   }
     }
     m_observer->shaderChanged();
   }
index c7b63bf..7b1d08b 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_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);
 
 
 filter_brush_all_faces g_filter_brush_detail(&g_filter_face_detail);
 
 
index d8183fa..0343bbd 100644 (file)
@@ -1065,7 +1065,7 @@ GtkWindow* SurfaceInspector::BuildDialog()
             }
 
             // not allowed to modify detail flag using Surface Inspector
             }
 
             // 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);
           }
         }
       }
           }
         }
       }