mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-10 22:51:59 +00:00
refactored CONTENTS_DETAIL macro
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@99 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
0b3ffc80a7
commit
3e076b28de
3 changed files with 10 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue