本文整理汇总了C++中Brush_AddToList函数的典型用法代码示例。如果您正苦于以下问题:C++ Brush_AddToList函数的具体用法?C++ Brush_AddToList怎么用?C++ Brush_AddToList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Brush_AddToList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Select_Brush
/*
============
Select_Brush
============
*/
void Select_Brush( brush_s* brush, bool bComplete, bool bStatus )
{
brush_s* b;
entity_s* e;
g_ptrSelectedFaces.RemoveAll();
g_ptrSelectedFaceBrushes.RemoveAll();
//selected_face = NULL;
if ( g_qeglobals.d_select_count < 2 )
g_qeglobals.d_select_order[g_qeglobals.d_select_count] = brush;
g_qeglobals.d_select_count++;
//if (brush->patchBrush)
// Patch_Select(brush->nPatchID);
e = brush->owner;
if ( e )
{
// select complete entity on first click
if ( e != world_entity && bComplete == true )
{
for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next )
if ( b->owner == e )
goto singleselect;
for ( b = e->brushes.onext ; b != &e->brushes ; b = b->onext )
{
Brush_RemoveFromList( b );
Brush_AddToList( b, &selected_brushes );
}
}
else
{
singleselect:
Brush_RemoveFromList( brush );
Brush_AddToList( brush, &selected_brushes );
UpdateSurfaceDialog();
UpdatePatchInspector();
}
if ( e->eclass )
{
UpdateEntitySel( brush->owner->eclass );
}
}
if ( bStatus )
{
edVec3_c vMin, vMax, vSize;
Select_GetBounds( vMin, vMax );
vSize = vMax - vMin;
CString strStatus;
strStatus.Format( "Selection X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2] );
g_pParentWnd->SetStatusText( 2, strStatus );
}
}
示例2: Undo_AddBrush
/*
=============
Undo_AddBrush
=============
*/
void Undo_AddBrush(brush_t *pBrush)
{
if (!g_lastundo)
{
Sys_Status("Undo_AddBrushList: no last undo.\n");
return;
}
if (g_lastundo->entitylist.next != &g_lastundo->entitylist)
{
Sys_Status("Undo_AddBrushList: WARNING adding brushes after entity.\n");
}
//if the brush is already in the undo
if (Undo_BrushInUndo(g_lastundo, pBrush))
return;
//clone the brush
brush_t* pClone = Brush_FullClone(pBrush);
//save the ID of the owner entity
pClone->ownerId = pBrush->owner->entityId;
if (pBrush->owner && !(pBrush->owner->eclass->nShowFlags & ECLASS_WORLDSPAWN)) {
Undo_AddEntity(pBrush->owner);
}
//save the old undo ID for previous undos
pClone->undoId = pBrush->undoId;
Brush_AddToList (pClone, &g_lastundo->brushlist);
//
g_undoMemorySize += Brush_MemorySize(pClone);
}
示例3: Undo_AddBrush
/*
=============
Undo_AddBrush
=============
*/
void Undo_AddBrush(brush_t *pBrush)
{
// spog - disable undo if undo levels = 0
if (g_PrefsDlg.m_nUndoLevels == 0)
{
#ifdef DBG_UNDO
Sys_Printf("Undo_AddBrush: undo is disabled.\n");
#endif
return;
}
if (!g_lastundo)
{
Sys_Printf("Undo_AddBrushList: no last undo.\n");
return;
}
if (g_lastundo->entitylist.next != &g_lastundo->entitylist)
{
Sys_Printf("Undo_AddBrushList: WARNING adding brushes after entity.\n");
}
//if the brush is already in the undo
if (Undo_BrushInUndo(g_lastundo, pBrush))
return;
//clone the brush
brush_t* pClone = Brush_FullClone(pBrush);
//save the ID of the owner entity
pClone->ownerId = pBrush->owner->entityId;
//save the old undo ID for previous undos
pClone->undoId = pBrush->undoId;
Brush_AddToList (pClone, &g_lastundo->brushlist);
//
g_undoMemorySize += Brush_MemorySize(pClone);
}
示例4: Select_Inside
void Select_Inside( void )
{
brush_s* b, *next;
int i;
edVec3_c mins, maxs;
if ( !QE_SingleBrush() )
return;
clearSelection();
mins = selected_brushes.next->getMins();
maxs = selected_brushes.next->getMaxs();
Select_Delete();
for ( b = active_brushes.next ; b != &active_brushes ; b = next )
{
next = b->next;
if ( FilterBrush( b ) )
continue;
for ( i = 0 ; i < 3 ; i++ )
if ( b->getMaxs()[i] > maxs[i] || b->getMins()[i] < mins[i] )
break;
if ( i == 3 )
{
Brush_RemoveFromList( b );
Brush_AddToList( b, &selected_brushes );
}
}
Sys_UpdateWindows( W_ALL );
}
示例5: Map_RegionOff
/*
=======================================================================================================================
Map_RegionOff Other filtering options may still be on
=======================================================================================================================
*/
void Map_RegionOff(void) {
brush_t *b, *next;
int i;
region_active = false;
for (i = 0; i < 3; i++) {
region_maxs[i] = MAX_WORLD_COORD; // 4096;
region_mins[i] = MIN_WORLD_COORD; // -4096;
}
for (b = filtered_brushes.next; b != &filtered_brushes; b = next) {
next = b->next;
if (Map_IsBrushFiltered(b)) {
continue; // still filtered
}
Brush_RemoveFromList(b);
if (active_brushes.next == NULL || active_brushes.prev == NULL) {
active_brushes.next = &active_brushes;
active_brushes.prev = &active_brushes;
}
Brush_AddToList(b, &active_brushes);
}
Sys_UpdateWindows(W_ALL);
}
示例6: Select_Ungroup
/* Turn the currently selected entity back into normal brushes
*/
void Select_Ungroup (void)
{
entity_t *e;
brush_t *b;
e = selected_brushes.next->owner;
if (!e || e == world_entity || e->eclass->fixedsize)
{
Sys_Status ("Not a grouped entity.", 0);
return;
}
for (b=e->brushes.onext ; b != &e->brushes ; b=e->brushes.onext)
{
Brush_RemoveFromList (b);
Brush_AddToList (b, &active_brushes);
Entity_UnlinkBrush (b);
Entity_LinkBrush (world_entity, b);
Brush_Build( b );
b->owner = world_entity;
}
Entity_Free (e);
Sys_UpdateWindows (W_ALL);
}
示例7: Map_RegionOff
/*
===========
Map_RegionOff
Other filtering options may still be on
===========
*/
void Map_RegionOff( void ){
brush_t *b, *next;
int i;
region_active = false;
for ( i = 0 ; i < 3 ; i++ )
{
region_maxs[i] = g_MaxWorldCoord - 64;
region_mins[i] = g_MinWorldCoord + 64;
}
for ( b = filtered_brushes.next ; b != &filtered_brushes ; b = next )
{
next = b->next;
if ( Map_IsBrushFiltered( b ) ) {
continue; // still filtered
}
Brush_RemoveFromList( b );
if ( active_brushes.next == NULL || active_brushes.prev == NULL ) {
active_brushes.next = &active_brushes;
active_brushes.prev = &active_brushes;
}
Brush_AddToList( b, &active_brushes );
b->bFiltered = FilterBrush( b );
}
Sys_UpdateWindows( W_ALL );
}
示例8: Select_Inside
void Select_Inside (void)
{
brush_t *b, *next;
int i;
vec3_t mins, maxs;
if (!QE_SingleBrush ())
return;
g_qeglobals.d_select_mode = sel_brush;
Math_VectorCopy (selected_brushes.next->mins, mins);
Math_VectorCopy (selected_brushes.next->maxs, maxs);
Select_Delete ();
for (b=active_brushes.next ; b != &active_brushes ; b=next)
{
next = b->next;
for (i=0 ; i<3 ; i++)
if (b->maxs[i] > maxs[i] || b->mins[i] < mins[i])
break;
if (i == 3)
{
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
}
}
Sys_UpdateWindows (W_ALL);
}
示例9: Select_Ray
/*
============
Select_Ray
If the origin is inside a brush, that brush will be ignored.
============
*/
void Select_Ray (vec3_t origin, vec3_t dir, int flags)
{
trace_t t;
t = Test_Ray (origin, dir, flags);
if (!t.brush)
return;
if (flags == SF_SINGLEFACE)
{
selected_face = t.face;
selected_face_brush = t.brush;
Sys_UpdateWindows (W_ALL);
g_qeglobals.d_select_mode = sel_brush;
Texture_SetTexture (&t.face->texdef);
UpdateSurfaceDialog();
return;
}
// move the brush to the other list
g_qeglobals.d_select_mode = sel_brush;
if (t.selected)
{
Brush_RemoveFromList (t.brush);
Brush_AddToList (t.brush, &active_brushes);
} else
{
Select_Brush (t.brush, !(GetKeyState(VK_MENU) & 0x8000));
}
Sys_UpdateWindows (W_ALL);
}
示例10: Select_Touching
void Select_Touching (void)
{
brush_t *b, *next;
int i;
vec3_t mins, maxs;
if (!QE_SingleBrush ())
return;
g_qeglobals.d_select_mode = sel_brush;
VectorCopy (selected_brushes.next->mins, mins);
VectorCopy (selected_brushes.next->maxs, maxs);
for (b=active_brushes.next ; b != &active_brushes ; b=next)
{
next = b->next;
if (FilterBrush (b))
continue;
for (i=0 ; i<3 ; i++)
if (b->mins[i] > maxs[i]+1 || b->maxs[i] < mins[i]-1)
break;
if (i == 3)
{
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
}
}
Sys_UpdateWindows (W_ALL);
}
示例11: Select_PartialTall
void Select_PartialTall( void )
{
brush_s* b, *next;
//int i;
edVec3_c mins, maxs;
if ( !QE_SingleBrush() )
return;
clearSelection();
mins = selected_brushes.next->getMins();
maxs = selected_brushes.next->getMaxs();
Select_Delete();
int nDim1 = ( g_pParentWnd->ActiveXY()->GetViewType() == YZ ) ? 1 : 0;
int nDim2 = ( g_pParentWnd->ActiveXY()->GetViewType() == XY ) ? 1 : 2;
for ( b = active_brushes.next ; b != &active_brushes ; b = next )
{
next = b->next;
if ( ( b->getMins()[nDim1] > maxs[nDim1] || b->getMaxs()[nDim1] < mins[nDim1] )
|| ( b->getMins()[nDim2] > maxs[nDim2] || b->getMaxs()[nDim2] < mins[nDim2] ) )
continue;
if ( FilterBrush( b ) )
continue;
Brush_RemoveFromList( b );
Brush_AddToList( b, &selected_brushes );
#if 0
// old stuff
for ( i = 0 ; i < 2 ; i++ )
if ( b->mins[i] > maxs[i] || b->maxs[i] < mins[i] )
break;
if ( i == 2 )
{
Brush_RemoveFromList( b );
Brush_AddToList( b, &selected_brushes );
}
#endif
}
Sys_UpdateWindows( W_ALL );
}
示例12: AddRegionBrushes
/*
=======================================================================================================================
AddRegionBrushes a regioned map will have temp walls put up at the region boundary
=======================================================================================================================
*/
void AddRegionBrushes(void)
{
idVec3 mins, maxs;
int i;
texdef_t td;
if (!region_active) {
return;
}
memset(&td, 0, sizeof(td));
td = g_qeglobals.d_texturewin.texdef;
// strcpy (td.name, "REGION");
td.SetName("textures/REGION");
const int REGION_WIDTH = 1024;
mins[0] = region_mins[0] - REGION_WIDTH;
maxs[0] = region_mins[0] + 1;
mins[1] = region_mins[1] - REGION_WIDTH;
maxs[1] = region_maxs[1] + REGION_WIDTH;
mins[2] = MIN_WORLD_COORD;
maxs[2] = MAX_WORLD_COORD;
region_sides[0] = Brush_Create(mins, maxs, &td);
mins[0] = region_maxs[0] - 1;
maxs[0] = region_maxs[0] + REGION_WIDTH;
region_sides[1] = Brush_Create(mins, maxs, &td);
mins[0] = region_mins[0] - REGION_WIDTH;
maxs[0] = region_maxs[0] + REGION_WIDTH;
mins[1] = region_mins[1] - REGION_WIDTH;
maxs[1] = region_mins[1] + 1;
region_sides[2] = Brush_Create(mins, maxs, &td);
mins[1] = region_maxs[1] - 1;
maxs[1] = region_maxs[1] + REGION_WIDTH;
region_sides[3] = Brush_Create(mins, maxs, &td);
mins = region_mins;
maxs = region_maxs;
maxs[2] = mins[2] + REGION_WIDTH;
region_sides[4] = Brush_Create(mins, maxs, &td);
mins = region_mins;
maxs = region_maxs;
mins[2] = maxs[2] - REGION_WIDTH;
region_sides[5] = Brush_Create(mins, maxs, &td);
for (i = 0; i < 6; i++) {
Brush_AddToList(region_sides[i], &selected_brushes);
Entity_LinkBrush(world_entity, region_sides[i]);
Brush_Build(region_sides[i]);
}
}
示例13: Select_CompleteTall
void Select_CompleteTall (void)
{
brush_t *b, *next;
//int i;
vec3_t mins, maxs;
if (!QE_SingleBrush ())
return;
g_qeglobals.d_select_mode = sel_brush;
VectorCopy (selected_brushes.next->mins, mins);
VectorCopy (selected_brushes.next->maxs, maxs);
Select_Delete ();
int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0;
int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2;
for (b=active_brushes.next ; b != &active_brushes ; b=next)
{
next = b->next;
if ( (b->maxs[nDim1] > maxs[nDim1] || b->mins[nDim1] < mins[nDim1])
|| (b->maxs[nDim2] > maxs[nDim2] || b->mins[nDim2] < mins[nDim2]) )
continue;
if (FilterBrush (b))
continue;
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
#if 0
// old stuff
for (i=0 ; i<2 ; i++)
if (b->maxs[i] > maxs[i] || b->mins[i] < mins[i])
break;
if (i == 2)
{
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
}
#endif
}
Sys_UpdateWindows (W_ALL);
}
示例14: SelectBrush
void SelectBrush (int entitynum, int brushnum)
{
entity_t *e;
brush_t *b;
int i;
if (entitynum == 0)
e = world_entity;
else
{
e = entities.next;
while (--entitynum)
{
e=e->next;
if (e == &entities)
{
Sys_Status ("No such entity.", 0);
return;
}
}
}
b = e->brushes.onext;
if (b == &e->brushes)
{
Sys_Status ("No such brush.", 0);
return;
}
while (brushnum--)
{
b=b->onext;
if (b == &e->brushes)
{
Sys_Status ("No such brush.", 0);
return;
}
}
Brush_RemoveFromList (b);
Brush_AddToList (b, &selected_brushes);
Sys_UpdateWindows (W_ALL);
for (i=0 ; i<3 ; i++)
{
if (g_pParentWnd->GetXYWnd())
g_pParentWnd->GetXYWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
if (g_pParentWnd->GetXZWnd())
g_pParentWnd->GetXZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
if (g_pParentWnd->GetYZWnd())
g_pParentWnd->GetYZWnd()->GetOrigin()[i] = (b->mins[i] + b->maxs[i])/2;
}
Sys_Status ("Selected.", 0);
}
示例15: Select_Ray
/*
============
Select_Ray
If the origin is inside a brush, that brush will be ignored.
============
*/
void Select_Ray( vec3_t origin, vec3_t dir, int flags )
{
trace_t t;
t = Test_Ray( origin, dir, flags );
if ( !t.brush )
return;
if ( flags == SF_SINGLEFACE )
{
int nCount = g_SelectedFaces.GetSize();
bool bOk = true;
for ( int i = 0; i < nCount; i++ )
{
if ( t.face == reinterpret_cast<face_s*>( g_SelectedFaces.GetAt( i ) ) )
{
bOk = false;
// need to move remove i'th entry
g_SelectedFaces.RemoveAt( i, 1 );
g_SelectedFaceBrushes.RemoveAt( i, 1 );
}
}
if ( bOk )
{
g_SelectedFaces.Add( t.face );
g_SelectedFaceBrushes.Add( t.brush );
}
//selected_face = t.face;
//selected_face_brush = t.brush;
Sys_UpdateWindows( W_ALL );
clearSelection();
// Texture_SetTexture requires a brushprimit_texdef fitted to the default width=2 height=2 texture
brushprimit_texdef_s brushprimit_texdef;
ConvertTexMatWithQTexture( &t.face->brushprimit_texdef, t.face->d_texture, &brushprimit_texdef, NULL );
Texture_SetTexture( &t.face->texdef, &brushprimit_texdef, false, false );
UpdateSurfaceDialog();
return;
}
// move the brush to the other list
clearSelection();
if ( t.selected )
{
Brush_RemoveFromList( t.brush );
Brush_AddToList( t.brush, &active_brushes );
UpdatePatchInspector();
}
else
{
Select_Brush( t.brush, !( GetKeyState( VK_MENU ) & 0x8000 ) );
}
Sys_UpdateWindows( W_ALL );
}