예제 #1
0
/*
 =======================================================================================================================
	Map_RegionSelectedBrushes
 =======================================================================================================================
 */
void Map_RegionSelectedBrushes(void) {
	Map_RegionOff();

	if (selected_brushes.next == &selected_brushes) {	// nothing selected
		Sys_Status("Tried to region with no selection...\n");
		return;
	}

	region_active = true;
	Select_GetBounds(region_mins, region_maxs);

	// move the entire active_brushes list to filtered_brushes
	filtered_brushes.next = active_brushes.next;
	filtered_brushes.prev = active_brushes.prev;
	filtered_brushes.next->prev = &filtered_brushes;
	filtered_brushes.prev->next = &filtered_brushes;

	Patch_Deselect();
	// move the entire selected_brushes list to active_brushes
	active_brushes.next = selected_brushes.next;
	active_brushes.prev = selected_brushes.prev;
	active_brushes.next->prev = &active_brushes;
	active_brushes.prev->next = &active_brushes;

	// clear selected_brushes
	selected_brushes.next = selected_brushes.prev = &selected_brushes;

	Sys_UpdateWindows(W_ALL);
}
예제 #2
0
void Select_Deselect (bool bDeSelectToListBack /*= false*/)	// to avoid continuously re-finding same selected ents
{
	brush_t	*b;

  Patch_Deselect();

  g_qeglobals.d_workcount++;
	g_qeglobals.d_select_count = 0;
	g_qeglobals.d_num_move_points = 0;
	b = selected_brushes.next;

	if (b == &selected_brushes)
	{
		if (selected_face)
		{
			selected_face = NULL;
		}
 		Sys_UpdateWindows (W_ALL);
		return;
	}

	selected_face = NULL;
	g_qeglobals.d_select_mode = sel_brush;

	// grab top / bottom height for new brushes
	if (b->mins[2] < b->maxs[2])
	{
		g_qeglobals.d_new_brush_bottom_z = b->mins[2];
		g_qeglobals.d_new_brush_top_z = b->maxs[2];
	}

	if (bDeSelectToListBack)
	{
		selected_brushes.next->prev = active_brushes.prev;
		selected_brushes.prev->next = &active_brushes;
		active_brushes.prev->next	= selected_brushes.next;
		active_brushes.prev			= selected_brushes.prev;
	}
	else
	{	
		selected_brushes.next->prev = &active_brushes;
		selected_brushes.prev->next = active_brushes.next;
		active_brushes.next->prev = selected_brushes.prev;
		active_brushes.next = selected_brushes.next;
	}

	selected_brushes.prev = selected_brushes.next = &selected_brushes;	

	Sys_UpdateWindows (W_ALL);
}
예제 #3
0
파일: SELECT.CPP 프로젝트: chenbk85/3dlearn
void Select_Deselect (bool bDeselectFaces)
{
	brush_t	*b;

	Patch_Deselect();

	g_pParentWnd->ActiveXY()->UndoClear();

	g_qeglobals.d_workcount++;
	g_qeglobals.d_select_count = 0;
	g_qeglobals.d_num_move_points = 0;
	b = selected_brushes.next;

	if (b == &selected_brushes)
	{
		if (bDeselectFaces)
		{
			g_ptrSelectedFaces.RemoveAll();
			g_ptrSelectedFaceBrushes.RemoveAll();
			//selected_face = NULL;
		}
		Sys_UpdateWindows (W_ALL);
		return;
	}

	if (bDeselectFaces)
	{
		g_ptrSelectedFaces.RemoveAll();
		g_ptrSelectedFaceBrushes.RemoveAll();
		//selected_face = NULL;
	}

	clearSelection();

	// grab top / bottom height for new brushes
	if (b->mins[2] < b->maxs[2])
	{
		g_qeglobals.d_new_brush_bottom_z = b->mins[2];
		g_qeglobals.d_new_brush_top_z = b->maxs[2];
	}

	selected_brushes.next->prev = &active_brushes;
	selected_brushes.prev->next = active_brushes.next;
	active_brushes.next->prev = selected_brushes.prev;
	active_brushes.next = selected_brushes.next;
	selected_brushes.prev = selected_brushes.next = &selected_brushes;	

	Sys_UpdateWindows (W_ALL);
}