2007-11-04 03:51:54 +00:00
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
Copyright (C) 1999-2007 id Software, Inc. and contributors.
|
|
|
|
For a list of contributors, see the accompanying CONTRIBUTORS file.
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
This file is part of GtkRadiant.
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
GtkRadiant is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
GtkRadiant is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GtkRadiant; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
//#include "qe3.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
drag either multiple brushes, or select plane points from
|
|
|
|
a single brush.
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
*/
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
extern int g_nPatchClickedView;
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
qboolean drag_ok;
|
|
|
|
vec3_t drag_xvec;
|
|
|
|
vec3_t drag_yvec;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
//static int buttonstate;
|
2012-03-17 20:01:54 +00:00
|
|
|
int pressx, pressy;
|
|
|
|
static vec3_t pressdelta;
|
|
|
|
static vec3_t vPressStart;
|
2007-11-04 03:51:54 +00:00
|
|
|
//static int buttonx, buttony;
|
|
|
|
|
|
|
|
|
|
|
|
//int num_move_points;
|
|
|
|
//float *move_points[1024];
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
int lastx, lasty;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
qboolean drag_first;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
void AxializeVector( vec3_t v ){
|
|
|
|
vec3_t a;
|
|
|
|
float o;
|
|
|
|
int i;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( !v[0] && !v[1] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
if ( !v[1] && !v[2] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
if ( !v[0] && !v[2] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
for ( i = 0 ; i < 3 ; i++ )
|
|
|
|
a[i] = fabs( v[i] );
|
|
|
|
if ( a[0] > a[1] && a[0] > a[2] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
i = 0;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
else if ( a[1] > a[0] && a[1] > a[2] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
i = 1;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
else{
|
2007-11-04 03:51:54 +00:00
|
|
|
i = 2;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
o = v[i];
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorCopy( vec3_origin, v );
|
|
|
|
if ( o < 0 ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
v[i] = -1;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
else{
|
2007-11-04 03:51:54 +00:00
|
|
|
v[i] = 1;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2008-06-27 15:09:36 +00:00
|
|
|
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
===========
|
|
|
|
Drag_Setup
|
|
|
|
===========
|
|
|
|
*/
|
|
|
|
extern void SelectCurvePointByRay( vec3_t org, vec3_t dir, int buttons );
|
|
|
|
|
|
|
|
void Drag_Setup( int x, int y, int buttons,
|
|
|
|
vec3_t xaxis, vec3_t yaxis,
|
|
|
|
vec3_t origin, vec3_t dir ){
|
|
|
|
trace_t t;
|
|
|
|
face_t *f;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
drag_first = true;
|
2008-06-27 15:09:36 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorCopy( vec3_origin, pressdelta );
|
|
|
|
pressx = x;
|
|
|
|
pressy = y;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// snap to nearest axis for camwindow drags
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorCopy( xaxis, drag_xvec );
|
|
|
|
AxializeVector( drag_xvec );
|
|
|
|
VectorCopy( yaxis, drag_yvec );
|
|
|
|
AxializeVector( drag_yvec );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_select_mode == sel_curvepoint ) {
|
|
|
|
SelectCurvePointByRay( origin, dir, buttons );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_select_mode == sel_area ) {
|
|
|
|
drag_ok = true;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_nPatchClickedView == W_CAMERA ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
VectorSet( g_qeglobals.d_vAreaTL, x, y, 0 );
|
|
|
|
VectorSet( g_qeglobals.d_vAreaBR, x, y, 0 );
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
else if ( g_qeglobals.d_num_move_points ) { // don't add an undo if there are no points selected
|
|
|
|
drag_ok = true;
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
|
|
|
Undo_Start( "drag curve point" );
|
|
|
|
Undo_AddBrushList( &selected_brushes );
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_qeglobals.d_num_move_points = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_areatall ) {
|
|
|
|
VectorCopy( origin, g_qeglobals.d_vAreaTL );
|
|
|
|
VectorCopy( origin, g_qeglobals.d_vAreaBR );
|
|
|
|
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
|
|
|
|
|
|
|
drag_ok = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( selected_brushes.next == &selected_brushes ) {
|
|
|
|
//in this case a new brush is created when the dragging
|
|
|
|
//takes place in the XYWnd, An useless undo is created
|
|
|
|
//when the dragging takes place in the CamWnd
|
|
|
|
Undo_Start( "create brush" );
|
|
|
|
|
|
|
|
Sys_Status( "No selection to drag", 0 );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_vertex ) {
|
|
|
|
SelectVertexByRay( origin, dir );
|
|
|
|
if ( g_qeglobals.d_num_move_points ) {
|
|
|
|
drag_ok = true;
|
|
|
|
Undo_Start( "drag vertex" );
|
|
|
|
Undo_AddBrushList( &selected_brushes );
|
|
|
|
// Need an update here for highlighting selected vertices
|
|
|
|
Sys_UpdateWindows( W_XY | W_CAMERA );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_edge ) {
|
|
|
|
SelectEdgeByRay( origin, dir );
|
|
|
|
if ( g_qeglobals.d_num_move_points ) {
|
|
|
|
drag_ok = true;
|
|
|
|
Undo_Start( "drag edge" );
|
|
|
|
Undo_AddBrushList( &selected_brushes );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// check for direct hit first
|
|
|
|
//
|
|
|
|
t = Test_Ray( origin, dir, true );
|
|
|
|
if ( t.selected ) {
|
|
|
|
drag_ok = true;
|
|
|
|
|
|
|
|
Undo_Start( "drag selection" );
|
|
|
|
Undo_AddBrushList( &selected_brushes );
|
|
|
|
|
|
|
|
if ( buttons == ( MK_LBUTTON | MK_CONTROL ) ) {
|
|
|
|
Sys_Printf( "Shear dragging face\n" );
|
|
|
|
Brush_SelectFaceForDragging( t.brush, t.face, true );
|
|
|
|
}
|
|
|
|
else if ( buttons == ( MK_LBUTTON | MK_CONTROL | MK_SHIFT ) ) {
|
|
|
|
Sys_Printf( "Sticky dragging brush\n" );
|
|
|
|
for ( f = t.brush->brush_faces ; f ; f = f->next )
|
|
|
|
Brush_SelectFaceForDragging( t.brush, f, false );
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
Sys_Printf( "Dragging entire selection\n" );
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_edge ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// check for side hit
|
|
|
|
//
|
|
|
|
// multiple brushes selected?
|
|
|
|
if ( selected_brushes.next->next != &selected_brushes ) {
|
|
|
|
// yes, special handling
|
|
|
|
bool bOK = ( g_PrefsDlg.m_bALTEdge ) ? Sys_AltDown() : true;
|
|
|
|
if ( bOK ) {
|
|
|
|
for ( brush_t* pBrush = selected_brushes.next ; pBrush != &selected_brushes ; pBrush = pBrush->next )
|
|
|
|
{
|
|
|
|
if ( buttons & MK_CONTROL ) {
|
|
|
|
Brush_SideSelect( pBrush, origin, dir, true );
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
Brush_SideSelect( pBrush, origin, dir, false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Sys_Printf( "press ALT to drag multiple edges\n" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// single select.. trying to drag fixed entities handle themselves and just move
|
|
|
|
if ( buttons & MK_CONTROL ) {
|
|
|
|
Brush_SideSelect( selected_brushes.next, origin, dir, true );
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
Brush_SideSelect( selected_brushes.next, origin, dir, false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Sys_Printf( "Side stretch\n" );
|
|
|
|
drag_ok = true;
|
|
|
|
|
|
|
|
Undo_Start( "side stretch" );
|
|
|
|
Undo_AddBrushList( &selected_brushes );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
entity_t *peLink;
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
void UpdateTarget( vec3_t origin, vec3_t dir ){
|
|
|
|
trace_t t;
|
2007-11-04 03:51:54 +00:00
|
|
|
entity_t *pe;
|
|
|
|
int i;
|
|
|
|
char sz[128];
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
t = Test_Ray( origin, dir, 0 );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( !t.brush ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
pe = t.brush->owner;
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( pe == NULL ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// is this the first?
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( peLink != NULL ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// Get the target id from out current target
|
|
|
|
// if there is no id, make one
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
i = IntForKey( pe, "target" );
|
|
|
|
if ( i <= 0 ) {
|
|
|
|
i = GetUniqueTargetId( 1 );
|
|
|
|
sprintf( sz, "%d", i );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
SetKeyValue( pe, "target", sz );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set the target # into our src
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
sprintf( sz, "%d", i );
|
|
|
|
SetKeyValue( peLink, "targetname", sz );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Sys_UpdateWindows( W_ENTITY );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// promote the target to the src
|
|
|
|
|
|
|
|
peLink = pe;
|
2008-06-27 15:09:36 +00:00
|
|
|
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
===========
|
|
|
|
Drag_Begin
|
|
|
|
//++timo test three button mouse and three button emulation here ?
|
|
|
|
===========
|
|
|
|
*/
|
|
|
|
void Drag_Begin( int x, int y, int buttons,
|
|
|
|
vec3_t xaxis, vec3_t yaxis,
|
|
|
|
vec3_t origin, vec3_t dir, bool sf_camera ){
|
|
|
|
trace_t t;
|
|
|
|
bool altdown;
|
|
|
|
int nFlag;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
drag_ok = false;
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorCopy( vec3_origin, pressdelta );
|
|
|
|
VectorCopy( vec3_origin, vPressStart );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
drag_first = true;
|
|
|
|
peLink = NULL;
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
altdown = Sys_AltDown();
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// shift-LBUTTON = select entire brush
|
2012-03-17 20:01:54 +00:00
|
|
|
// shift-alt-LBUTTON = drill select
|
|
|
|
if ( buttons == ( MK_LBUTTON | MK_SHIFT ) && g_qeglobals.d_select_mode != sel_curvepoint ) {
|
|
|
|
nFlag = altdown ? SF_CYCLE : 0;
|
|
|
|
if ( sf_camera ) {
|
|
|
|
nFlag |= SF_CAMERA;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
nFlag |= SF_ENTITIES_FIRST;
|
|
|
|
}
|
|
|
|
Select_Ray( origin, dir, nFlag );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
// (shift-)alt-LBUTTON = area select completely tall
|
|
|
|
if ( !sf_camera &&
|
|
|
|
( g_PrefsDlg.m_bALTEdge ? buttons == ( MK_LBUTTON | MK_CONTROL | MK_SHIFT ) : ( buttons == MK_LBUTTON || buttons == ( MK_LBUTTON | MK_CONTROL | MK_SHIFT ) ) ) &&
|
|
|
|
altdown && g_qeglobals.d_select_mode != sel_curvepoint ) {
|
|
|
|
if ( g_pParentWnd->ActiveXY()->AreaSelectOK() ) {
|
|
|
|
g_qeglobals.d_select_mode = sel_areatall;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Drag_Setup( x, y, buttons, xaxis, yaxis, origin, dir );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// ctrl-alt-LBUTTON = multiple brush select without selecting whole entities
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons == ( MK_LBUTTON | MK_CONTROL ) && altdown && g_qeglobals.d_select_mode != sel_curvepoint ) {
|
|
|
|
nFlag = 0;
|
|
|
|
if ( sf_camera ) {
|
|
|
|
nFlag |= SF_CAMERA;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
nFlag |= SF_ENTITIES_FIRST;
|
|
|
|
}
|
|
|
|
Select_Ray( origin, dir, nFlag );
|
|
|
|
UpdateSurfaceDialog();
|
2008-06-27 15:09:36 +00:00
|
|
|
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ctrl-shift LBUTTON = select single face
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( sf_camera && buttons == ( MK_LBUTTON | MK_CONTROL | MK_SHIFT ) && g_qeglobals.d_select_mode != sel_curvepoint ) {
|
|
|
|
if ( Sys_AltDown() ) {
|
|
|
|
brush_t *b;
|
|
|
|
for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next )
|
|
|
|
{
|
|
|
|
if ( b->pPatch ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( face_t* pFace = b->brush_faces; pFace; pFace = pFace->next )
|
|
|
|
{
|
|
|
|
g_ptrSelectedFaces.Add( pFace );
|
|
|
|
g_ptrSelectedFaceBrushes.Add( b );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( b = selected_brushes.next; b != &selected_brushes; )
|
|
|
|
{
|
|
|
|
brush_t *pb = b;
|
|
|
|
b = b->next;
|
|
|
|
Brush_RemoveFromList( pb );
|
|
|
|
Brush_AddToList( pb, &active_brushes );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
Select_Deselect( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
Select_Ray( origin, dir, ( SF_SINGLEFACE | SF_CAMERA ) );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// LBUTTON + all other modifiers = manipulate selection
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons & MK_LBUTTON ) {
|
|
|
|
Drag_Setup( x, y, buttons, xaxis, yaxis, origin, dir );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int nMouseButton = g_PrefsDlg.m_nMouseButtons == 2 ? MK_RBUTTON : MK_MBUTTON;
|
|
|
|
// middle button = grab texture
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons == nMouseButton ) {
|
|
|
|
t = Test_Ray( origin, dir, false );
|
|
|
|
if ( t.face ) {
|
|
|
|
UpdateWorkzone_ForBrush( t.brush );
|
2007-11-04 03:51:54 +00:00
|
|
|
// use a local brushprimit_texdef fitted to a default 2x2 texture
|
|
|
|
brushprimit_texdef_t bp_local;
|
|
|
|
ConvertTexMatWithQTexture( &t.face->brushprimit_texdef, t.face->d_texture, &bp_local, NULL );
|
2012-03-17 20:01:54 +00:00
|
|
|
Texture_SetTexture( &t.face->texdef, &bp_local, false, NULL );
|
2007-11-04 03:51:54 +00:00
|
|
|
UpdateSurfaceDialog();
|
|
|
|
UpdatePatchInspector();
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
else{
|
|
|
|
Sys_Printf( "Did not select a texture\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ctrl-middle button = set entire brush to texture
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons == ( nMouseButton | MK_CONTROL ) ) {
|
|
|
|
t = Test_Ray( origin, dir, false );
|
|
|
|
if ( t.brush ) {
|
|
|
|
if ( t.brush->brush_faces->texdef.GetName()[0] == '(' ) {
|
|
|
|
Sys_Printf( "Can't change an entity texture\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
else
|
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
Brush_SetTexture( t.brush, &g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, false, static_cast<IPluginTexdef *>( g_qeglobals.d_texturewin.pTexdef ) );
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
else{
|
|
|
|
Sys_Printf( "Didn't hit a btrush\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ctrl-shift-middle button = set single face to texture
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons == ( nMouseButton | MK_SHIFT | MK_CONTROL ) ) {
|
|
|
|
t = Test_Ray( origin, dir, false );
|
|
|
|
if ( t.brush ) {
|
|
|
|
if ( t.brush->brush_faces->texdef.GetName()[0] == '(' ) {
|
|
|
|
Sys_Printf( "Can't change an entity texture\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
else
|
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
SetFaceTexdef( t.face, &g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef );
|
2007-11-04 03:51:54 +00:00
|
|
|
Brush_Build( t.brush );
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Sys_UpdateWindows( W_ALL );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
else{
|
|
|
|
Sys_Printf( "Didn't hit a btrush\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( buttons == ( nMouseButton | MK_SHIFT ) ) {
|
|
|
|
Sys_Printf( "Set brush face texture info\n" );
|
|
|
|
t = Test_Ray( origin, dir, false );
|
|
|
|
if ( t.brush ) {
|
|
|
|
if ( t.brush->brush_faces->texdef.GetName()[0] == '(' ) {
|
|
|
|
if ( t.brush->owner->eclass->nShowFlags & ECLASS_LIGHT ) {
|
|
|
|
CString strBuff;
|
|
|
|
qtexture_t* pTex = g_qeglobals.d_texturewin.pShader->getTexture();
|
|
|
|
if ( pTex ) {
|
|
|
|
vec3_t vColor;
|
|
|
|
VectorCopy( pTex->color, vColor );
|
|
|
|
|
|
|
|
float fLargest = 0.0f;
|
|
|
|
for ( int i = 0; i < 3; i++ )
|
|
|
|
{
|
|
|
|
if ( vColor[i] > fLargest ) {
|
|
|
|
fLargest = vColor[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( fLargest == 0.0f ) {
|
|
|
|
vColor[0] = vColor[1] = vColor[2] = 1.0f;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
float fScale = 1.0f / fLargest;
|
|
|
|
for ( int i = 0; i < 3; i++ )
|
|
|
|
{
|
|
|
|
vColor[i] *= fScale;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
strBuff.Format( "%f %f %f",pTex->color[0], pTex->color[1], pTex->color[2] );
|
|
|
|
SetKeyValue( t.brush->owner, "_color", strBuff.GetBuffer() );
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Sys_Printf( "Can't select an entity brush face\n" );
|
|
|
|
}
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
else
|
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
Face_SetShader( t.face, g_qeglobals.d_texturewin.texdef.GetName() );
|
|
|
|
Brush_Build( t.brush );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Sys_UpdateWindows( W_ALL );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
else{
|
|
|
|
Sys_Printf( "Didn't hit a brush\n" );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//===========
|
|
|
|
//MoveSelection
|
|
|
|
//===========
|
|
|
|
//
|
2012-03-17 20:01:54 +00:00
|
|
|
void MoveSelection( vec3_t move ){
|
|
|
|
int i, success;
|
|
|
|
brush_t *b;
|
2007-11-04 03:51:54 +00:00
|
|
|
CString strStatus;
|
|
|
|
vec3_t vTemp, vTemp2, end;
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( !move[0] && !move[1] && !move[2] ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( !( g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall ) ) {
|
|
|
|
move[0] = ( g_nScaleHow & SCALE_X ) ? 0 : move[0];
|
|
|
|
move[1] = ( g_nScaleHow & SCALE_Y ) ? 0 : move[1];
|
|
|
|
move[2] = ( g_nScaleHow & SCALE_Z ) ? 0 : move[2];
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_pParentWnd->ActiveXY()->RotateMode() || g_bPatchBendMode ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
float fDeg = -move[2];
|
|
|
|
float fAdj = move[2];
|
|
|
|
int nAxis = 0;
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_pParentWnd->ActiveXY()->GetViewType() == XY ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
fDeg = -move[1];
|
|
|
|
fAdj = move[1];
|
|
|
|
nAxis = 2;
|
|
|
|
}
|
2008-06-27 15:09:36 +00:00
|
|
|
else
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_pParentWnd->ActiveXY()->GetViewType() == XZ ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
fDeg = move[2];
|
|
|
|
fAdj = move[2];
|
|
|
|
nAxis = 1;
|
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
else{
|
2007-11-04 03:51:54 +00:00
|
|
|
nAxis = 0;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
g_pParentWnd->ActiveXY()->Rotation()[nAxis] += fAdj;
|
2012-03-17 20:01:54 +00:00
|
|
|
strStatus.Format( "%s x:: %.1f y:: %.1f z:: %.1f", ( g_bPatchBendMode ) ? "Bend angle" : "Rotation", g_pParentWnd->ActiveXY()->Rotation()[0], g_pParentWnd->ActiveXY()->Rotation()[1], g_pParentWnd->ActiveXY()->Rotation()[2] );
|
|
|
|
g_pParentWnd->SetStatusText( 2, strStatus );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_bPatchBendMode ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
Patch_SelectBendNormal();
|
2012-03-17 20:01:54 +00:00
|
|
|
Select_RotateAxis( nAxis, fDeg * 2, false, true );
|
2007-11-04 03:51:54 +00:00
|
|
|
Patch_SelectBendAxis();
|
2012-03-17 20:01:54 +00:00
|
|
|
Select_RotateAxis( nAxis, fDeg, false, true );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
Select_RotateAxis( nAxis, fDeg, false, true );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_pParentWnd->ActiveXY()->ScaleMode() ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
vec3_t v;
|
|
|
|
v[0] = v[1] = v[2] = 1.0f;
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( move[1] > 0 ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
v[0] = 1.1f;
|
|
|
|
v[1] = 1.1f;
|
|
|
|
v[2] = 1.1f;
|
|
|
|
}
|
2008-06-27 15:09:36 +00:00
|
|
|
else
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( move[1] < 0 ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
v[0] = 0.9f;
|
|
|
|
v[1] = 0.9f;
|
|
|
|
v[2] = 0.9f;
|
|
|
|
}
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Select_Scale( ( g_nScaleHow & SCALE_X ) ? 1.0f : v[0],
|
|
|
|
( g_nScaleHow & SCALE_Y ) ? 1.0f : v[1],
|
|
|
|
( g_nScaleHow & SCALE_Z ) ? 1.0f : v[2] );
|
|
|
|
// is that really necessary???
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vec3_t vDistance;
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorSubtract( pressdelta, vPressStart, vDistance );
|
|
|
|
strStatus.Format( "Distance x: %.1f y: %.1f z: %.1f", vDistance[0], vDistance[1], vDistance[2] );
|
|
|
|
g_pParentWnd->SetStatusText( 3, strStatus );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// dragging only a part of the selection
|
|
|
|
//
|
|
|
|
|
|
|
|
// this is fairly crappy way to deal with curvepoint and area selection
|
|
|
|
// but it touches the smallest amount of code this way
|
2008-06-27 15:09:36 +00:00
|
|
|
//
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_num_move_points || g_qeglobals.d_select_mode == sel_vertex || g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
//area selection
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_select_mode == sel_area || g_qeglobals.d_select_mode == sel_areatall ) {
|
|
|
|
VectorAdd( g_qeglobals.d_vAreaBR, move, g_qeglobals.d_vAreaBR );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
//curve point selection
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_select_mode == sel_curvepoint ) {
|
|
|
|
Patch_UpdateSelected( move );
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
//vertex selection
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( g_qeglobals.d_select_mode == sel_vertex && g_PrefsDlg.m_bVertexSplit ) {
|
|
|
|
if ( g_qeglobals.d_num_move_points ) {
|
|
|
|
success = true;
|
|
|
|
for ( b = selected_brushes.next; b != &selected_brushes; b = b->next )
|
|
|
|
{
|
|
|
|
success &= Brush_MoveVertex( b, g_qeglobals.d_move_points[0], move, end, true );
|
|
|
|
}
|
|
|
|
if ( success ) {
|
|
|
|
VectorCopy( end, g_qeglobals.d_move_points[0] );
|
|
|
|
}
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
//all other selection types
|
2012-03-17 20:01:54 +00:00
|
|
|
for ( i = 0 ; i < g_qeglobals.d_num_move_points ; i++ )
|
|
|
|
VectorAdd( g_qeglobals.d_move_points[i], move, g_qeglobals.d_move_points[i] );
|
|
|
|
for ( b = selected_brushes.next; b != &selected_brushes; b = b->next )
|
2007-11-04 03:51:54 +00:00
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
bool bMoved = false;
|
|
|
|
for ( face_t *f = b->brush_faces; !bMoved && f != NULL; f = f->next )
|
|
|
|
for ( int p = 0; !bMoved && p < 3; p++ )
|
|
|
|
for ( i = 0 ; !bMoved && i < g_qeglobals.d_num_move_points ; i++ )
|
|
|
|
if ( f->planepts[p] == g_qeglobals.d_move_points[i] ) {
|
|
|
|
bMoved = true;
|
|
|
|
}
|
|
|
|
if ( !bMoved ) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
VectorCopy( b->maxs, vTemp );
|
|
|
|
VectorSubtract( vTemp, b->mins, vTemp );
|
|
|
|
Brush_Build( b,true,true,false,false ); // don't filter
|
|
|
|
for ( i = 0 ; i < 3 ; i++ )
|
2007-11-04 03:51:54 +00:00
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( b->mins[i] > b->maxs[i]
|
|
|
|
|| b->maxs[i] - b->mins[i] > g_MaxBrushSize ) {
|
|
|
|
break; // dragged backwards or fucked up
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( i != 3 ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
break;
|
2012-03-17 20:01:54 +00:00
|
|
|
}
|
|
|
|
if ( b->patchBrush ) {
|
|
|
|
VectorCopy( b->maxs, vTemp2 );
|
|
|
|
VectorSubtract( vTemp2, b->mins, vTemp2 );
|
|
|
|
VectorSubtract( vTemp2, vTemp, vTemp2 );
|
2007-11-04 03:51:54 +00:00
|
|
|
//if (!Patch_DragScale(b->nPatchID, vTemp2, move))
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( !Patch_DragScale( b->pPatch, vTemp2, move ) ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
b = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if any of the brushes were crushed out of existance
|
|
|
|
// calcel the entire move
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( b != &selected_brushes ) {
|
|
|
|
Sys_Printf( "Brush dragged backwards, move canceled\n" );
|
|
|
|
for ( i = 0 ; i < g_qeglobals.d_num_move_points ; i++ )
|
|
|
|
VectorSubtract( g_qeglobals.d_move_points[i], move, g_qeglobals.d_move_points[i] );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next )
|
|
|
|
Brush_Build( b,true,true,false,false ); // don't filter
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// reset face originals from vertex edit mode
|
|
|
|
// this is dirty, but unfortunately necessary because Brush_Build
|
|
|
|
// can remove windings
|
2012-03-17 20:01:54 +00:00
|
|
|
for ( b = selected_brushes.next; b != &selected_brushes; b = b->next )
|
2007-11-04 03:51:54 +00:00
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
Brush_ResetFaceOriginals( b );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
//
|
|
|
|
// if there are lots of brushes selected, just translate instead
|
|
|
|
// of rebuilding the brushes
|
2012-03-17 20:01:54 +00:00
|
|
|
// NOTE: this is not actually done, but would be a good idea
|
2007-11-04 03:51:54 +00:00
|
|
|
//
|
2012-03-17 20:01:54 +00:00
|
|
|
Select_Move( move );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
===========
|
|
|
|
Drag_MouseMoved
|
|
|
|
===========
|
|
|
|
*/
|
|
|
|
void Drag_MouseMoved( int x, int y, int buttons ){
|
|
|
|
vec3_t move, delta;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if ( !buttons ) {
|
|
|
|
drag_ok = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ( !drag_ok ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// clear along one axis
|
|
|
|
if ( buttons & MK_SHIFT && ( g_PrefsDlg.m_bALTEdge && g_qeglobals.d_select_mode != sel_areatall ) ) {
|
|
|
|
drag_first = false;
|
|
|
|
if ( abs( x - pressx ) > abs( y - pressy ) ) {
|
|
|
|
y = pressy;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
x = pressx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_area && g_nPatchClickedView == W_CAMERA ) {
|
2007-11-04 03:51:54 +00:00
|
|
|
camera_t *m_pCamera = g_pParentWnd->GetCamWnd()->Camera();
|
|
|
|
|
|
|
|
// snap to window
|
2012-03-17 20:01:54 +00:00
|
|
|
if ( y > m_pCamera->height ) {
|
|
|
|
y = m_pCamera->height - 1;
|
|
|
|
}
|
|
|
|
else if ( y < 0 ) {
|
|
|
|
y = 0;
|
|
|
|
}
|
|
|
|
if ( x > m_pCamera->width ) {
|
|
|
|
x = m_pCamera->width - 1;
|
|
|
|
}
|
|
|
|
else if ( x < 0 ) {
|
|
|
|
x = 0;
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorSet( move, x - pressx, y - pressy, 0 );
|
|
|
|
}
|
|
|
|
else
|
2007-11-04 03:51:54 +00:00
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
for ( i = 0 ; i < 3 ; i++ )
|
2007-11-04 03:51:54 +00:00
|
|
|
{
|
2012-03-17 20:01:54 +00:00
|
|
|
move[i] = drag_xvec[i] * ( x - pressx ) + drag_yvec[i] * ( y - pressy );
|
|
|
|
if ( g_PrefsDlg.m_bSnap ) {
|
|
|
|
move[i] = floor( move[i] / g_qeglobals.d_gridsize + 0.5 ) * g_qeglobals.d_gridsize;
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
VectorSubtract( move, pressdelta, delta );
|
|
|
|
VectorCopy( move, pressdelta );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
MoveSelection( delta );
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-17 20:01:54 +00:00
|
|
|
===========
|
|
|
|
Drag_MouseUp
|
|
|
|
===========
|
|
|
|
*/
|
|
|
|
void Drag_MouseUp( int nButtons ){
|
|
|
|
Sys_Status( "Drag completed.", 0 );
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_area ) {
|
|
|
|
Patch_SelectAreaPoints( nButtons & MK_CONTROL ); // adds to selection and/or deselects selected points if ctrl is held
|
|
|
|
g_qeglobals.d_select_mode = sel_curvepoint;
|
|
|
|
Sys_UpdateWindows( W_ALL );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( g_qeglobals.d_select_mode == sel_areatall ) {
|
|
|
|
vec3_t mins, maxs;
|
|
|
|
|
|
|
|
int nDim1 = ( g_pParentWnd->ActiveXY()->GetViewType() == YZ ) ? 1 : 0;
|
|
|
|
int nDim2 = ( g_pParentWnd->ActiveXY()->GetViewType() == XY ) ? 1 : 2;
|
2007-11-04 03:51:54 +00:00
|
|
|
|
|
|
|
// get our rectangle
|
2012-03-17 20:01:54 +00:00
|
|
|
mins[nDim1] = MIN( g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1] );
|
|
|
|
mins[nDim2] = MIN( g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2] );
|
|
|
|
maxs[nDim1] = MAX( g_qeglobals.d_vAreaTL[nDim1], g_qeglobals.d_vAreaBR[nDim1] );
|
|
|
|
maxs[nDim2] = MAX( g_qeglobals.d_vAreaTL[nDim2], g_qeglobals.d_vAreaBR[nDim2] );
|
|
|
|
|
|
|
|
// deselect current selection
|
|
|
|
if ( !( nButtons & ( MK_CONTROL | MK_SHIFT ) ) ) {
|
|
|
|
Select_Deselect();
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
// select new selection
|
|
|
|
Select_RealCompleteTall( mins, maxs );
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
Sys_UpdateWindows( W_ALL );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
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 );
|
|
|
|
}
|
2007-11-04 03:51:54 +00:00
|
|
|
|
2012-03-17 20:01:54 +00:00
|
|
|
/* note: added cleanup here, since an edge drag will leave selected vertices
|
|
|
|
in g_qeglobals.d_num_move_points
|
|
|
|
*/
|
|
|
|
if ( g_qeglobals.d_select_mode != sel_vertex &&
|
|
|
|
g_qeglobals.d_select_mode != sel_curvepoint &&
|
|
|
|
g_qeglobals.d_select_mode != sel_edge ) {
|
|
|
|
g_qeglobals.d_num_move_points = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_pParentWnd->SetStatusText( 3, "" );
|
|
|
|
Undo_EndBrushList( &selected_brushes );
|
|
|
|
Undo_End();
|
|
|
|
UpdateSurfaceDialog();
|
2007-11-04 03:51:54 +00:00
|
|
|
}
|