Ejemplo n.º 1
0
/*
   ===========
   Map_RegionTallBrush
   ===========
 */
void Map_RegionTallBrush( void ){
	brush_t *b;

	if ( !QE_SingleBrush() ) {
		return;
	}

	b = selected_brushes.next;

	Map_RegionOff();

	VectorCopy( b->mins, region_mins );
	VectorCopy( b->maxs, region_maxs );
	region_mins[2] = g_MinWorldCoord + 64;
	region_maxs[2] = g_MaxWorldCoord - 64;

	Undo_Start( "delete" );
	Undo_AddBrushList( &selected_brushes );
	Undo_AddEntity( b->owner );
	Select_Delete();
	Undo_EndBrushList( &selected_brushes );
	Undo_End();

	Map_ApplyRegion();
}
Ejemplo n.º 2
0
/*
================
Drag_MouseUp
================
*/
void Drag_MouseUp(int nButtons) {
	Sys_Status("drag completed.", 0);

	if (g_qeglobals.d_select_mode == sel_area) {
		Patch_SelectAreaPoints();
		g_qeglobals.d_select_mode = sel_curvepoint;
		Sys_UpdateWindows(W_ALL);
	}

	if (g_qeglobals.d_select_translate[0] || g_qeglobals.d_select_translate[1] || g_qeglobals.d_select_translate[2]) {
		Select_Move(g_qeglobals.d_select_translate);
		VectorCopy(vec3_origin, g_qeglobals.d_select_translate);
		Sys_UpdateWindows(W_CAMERA);
	}

	g_pParentWnd->SetStatusText(3, "");

/*
	if (g_pParentWnd->GetCamera()->UpdateRenderEntities()) {
		Sys_UpdateWindows(W_CAMERA);
	}
*/
	
	Undo_EndBrushList(&selected_brushes);
	Undo_End();
}
Ejemplo n.º 3
0
void SI_SetTexdef_FaceList(texdef_to_face_t* texdef_face_list, bool b_SetUndoPoint, bool bFit_to_Scale)
{
    texdef_to_face_t* texdef_to_face;
    bool b_isQuake2;

    if (g_pGameDescription->quake2)
        b_isQuake2 = true;
    else
        b_isQuake2 = false;

    if (!texdef_face_list)
        return;

    if (b_SetUndoPoint)
    {
        if(g_ptrSelectedFaces.GetSize() > 1)
            Sys_FPrintf(SYS_WRN, "WARNING: Undo NOT supported for multiple face selections\n");
        else if( (selected_brushes.next != &selected_brushes) || (g_ptrSelectedFaces.GetSize() == 1))
        {
            // Give something to undo to
            for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next)
                if (b_isQuake2)
                    SetFaceTexdef_Q2(texdef_to_face->face, &texdef_to_face->orig_texdef, bFit_to_Scale);
                else
                    SetFaceTexdef(texdef_to_face->face, &texdef_to_face->orig_texdef, &texdef_to_face->orig_bp_texdef, bFit_to_Scale);

            Undo_Start("set facelist texdefs");

            if( selected_brushes.next != &selected_brushes )
                Undo_AddBrushList(&selected_brushes);
            else
                Undo_AddBrush(texdef_face_list->brush);

        }
    }

    for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next)
    {
        if (b_isQuake2)
            SetFaceTexdef_Q2(texdef_to_face->face, &texdef_to_face->texdef,  bFit_to_Scale);
        else
        {
            brushprimit_texdef_t brushprimit_texdef;
            FakeTexCoordsToTexMat(texdef_to_face->texdef.shift, texdef_to_face->texdef.rotate, texdef_to_face->texdef.scale, brushprimit_texdef.coords);
            SetFaceTexdef(texdef_to_face->face, &texdef_to_face->texdef, &brushprimit_texdef , bFit_to_Scale);
        }
        Brush_Build(texdef_to_face->brush);
        if(bFit_to_Scale)
            texdef_to_face->texdef = texdef_to_face->face->texdef;
    }

    if ( b_SetUndoPoint )
    {
        if( (selected_brushes.next != &selected_brushes) || (g_ptrSelectedFaces.GetSize() == 1) )
        {
            if(selected_brushes.next != &selected_brushes)
                Undo_EndBrushList(&selected_brushes);
            else
                Undo_EndBrush(texdef_face_list->brush);

            Undo_End();
            // Over-write the orig_texdef list, cementing the change.
            for(texdef_to_face = texdef_face_list; texdef_to_face; texdef_to_face = texdef_to_face->next)
            {
                texdef_to_face->orig_texdef = texdef_to_face->texdef;
                texdef_to_face->orig_bp_texdef = texdef_to_face->face->brushprimit_texdef;
            }
        }
    }

    Sys_UpdateWindows (W_ALL);
}