From 1ffe24f1bb2b3d1b3645c3a5e2b998f425ec5ef5 Mon Sep 17 00:00:00 2001 From: spog Date: Sun, 13 Aug 2006 13:55:20 +0000 Subject: [PATCH] refactored CONTENTS_DETAIL macro git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@99 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- radiant/brush.h | 16 ++++++++-------- radiant/brushmanip.cpp | 2 +- radiant/surfacedialog.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/radiant/brush.h b/radiant/brush.h index ab202984..b4c0f093 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -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(); } diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index c7b63bf2..7b1d08bf 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -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); diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index d8183fa5..0343bbd2 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -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); } } } -- 2.39.2