[Quest-ed-checkins] CVS: quest-3b/src/cmd cam.c,1.3,1.4
Brought to you by:
alexm
|
From: Alexander M. <al...@us...> - 2002-05-19 20:43:02
|
Update of /cvsroot/quest-ed/quest-3b/src/cmd
In directory usw-pr-cvs1:/tmp/cvs-serv17576/src/cmd
Modified Files:
cam.c
Log Message:
Add cvar:s for inverting mouse movement in camera.move_drag.
Index: cam.c
===================================================================
RCS file: /cvsroot/quest-ed/quest-3b/src/cmd/cam.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** cam.c 18 May 2002 18:38:09 -0000 1.3
--- cam.c 19 May 2002 20:42:57 -0000 1.4
***************
*** 22,25 ****
--- 22,30 ----
+ static config_var_t
+ *cv_camera_move_drag_invert_x,
+ *cv_camera_move_drag_invert_y;
+
+
/* Camera commands */
***************
*** 169,172 ****
--- 174,181 ----
int tx,ty;
int sx,sy,ox,oy;
+ int inv_x,inv_y;
+
+ inv_x=cv_camera_move_drag_invert_x->i?1:-1;
+ inv_y=cv_camera_move_drag_invert_y->i?1:-1;
S_I_Setup(&e,S_I_MOTION|S_I_RELEASE,NULL);
***************
*** 188,191 ****
--- 197,203 ----
oy+=sy;
+ sx*=inv_x;
+ sy*=inv_y;
+
while (sx>0) Camera_Move(S_cur_vport,MOVE_LEFT),sx--;
while (sx<0) Camera_Move(S_cur_vport,MOVE_RIGHT),sx++;
***************
*** 237,240 ****
{{Init},{"camera","Fundamental camera commands (moving around, rotating, zooming)."}};
! PLUGIN_FOOT_FUNCS
--- 249,268 ----
{{Init},{"camera","Fundamental camera commands (moving around, rotating, zooming)."}};
! static int Init(void)
! {
! cv_camera_move_drag_invert_x=Cfg_DefVar(plugin.cfg,
! "camera.move_drag.invert_x",
! "0",
! "Invert x movement when dragging camera (camera.move_drag).");
! cv_camera_move_drag_invert_y=Cfg_DefVar(plugin.cfg,
! "camera.move_drag.invert_y",
! "0",
! "Invert y movement when dragging camera (camera.move_drag).");
!
! Func_Register(&plugin,funcs,sizeof(funcs));
!
! return 1;
! }
!
! PLUGIN_FOOT
|