[Quest-ed-checkins] CVS: quest-3b/src/cmd/edit move.c,1.2,1.3
Brought to you by:
alexm
|
From: Alexander M. <al...@us...> - 2002-05-18 18:12:16
|
Update of /cvsroot/quest-ed/quest-3b/src/cmd/edit
In directory usw-pr-cvs1:/tmp/cvs-serv14111/src/cmd/edit
Modified Files:
move.c
Log Message:
Add command that lets you move selected things by dragging them.
Index: move.c
===================================================================
RCS file: /cvsroot/quest-ed/quest-3b/src/cmd/edit/move.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** move.c 24 Aug 2001 16:14:22 -0000 1.2
--- move.c 18 May 2002 18:12:12 -0000 1.3
***************
*** 15,19 ****
--- 15,21 ----
#include "status.h"
#include "transform.h"
+ #include "undo.h"
#include "fe/3d.h"
+ #include "fe/int.h"
#include "fe/message.h"
***************
*** 49,53 ****
};
! static func_t *funcs[]={&F_edit_move};
#include "plugin.h"
--- 51,108 ----
};
!
! /*
! TODO:
! how much should we move? should diffent grid sizes require different amounts
! of mouse movement to move one grid-multiple. zooming? 3d? configurable?
! */
! static void C_edit_move_drag(void)
! {
! s_event_t e;
! int tx,ty;
! int sx,sy,ox,oy;
! vec3_t left,up,delta;
!
! if (!M.sel.vsel && !M.sel.esel && !M.sel.bsel && !M.sel.fsel)
! return;
!
! Move90(S_cur_vport,MOVE_LEFT,&left,cv_edit_snap_size->i);
! Move90(S_cur_vport,MOVE_UP,&up,cv_edit_snap_size->i);
!
! S_I_Setup(&e,S_I_MOTION|S_I_RELEASE,NULL);
! tx=ty=0;
! ox=oy=0;
! while (1)
! {
! S_I_Wait(&e);
! if (e.type==S_I_CLICK || e.type==S_I_RELEASE)
! break;
! if (e.type==S_I_MOTION)
! {
! tx+=e.dx;
! ty+=e.dy;
!
! sx=-tx/4-ox;
! sy=-ty/4-oy;
! delta.x=sx*left.x+sy*up.x;
! delta.y=sx*left.y+sy*up.y;
! delta.z=sx*left.z+sy*up.z;
! ox+=sx;
! oy+=sy;
! TransformMove(delta,&M.sel);
!
! Undo_Update();
! S_UpdateAllViewports();
! }
! }
! S_I_Done();
! }
! static func_t F_edit_move_drag=
! {"edit.move_drag",FUNC_VOID,{fv:C_edit_move_drag},NULL,NULL,0,
! {"Moves the current selection by tracking the mouse."} /* TODO */
! };
!
!
! static func_t *funcs[]={&F_edit_move,&F_edit_move_drag};
#include "plugin.h"
|