-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: hackvr
action: commit
revision:
path_from:
revision_from: cd860515cd91c07b6cd88fab8a9c23acd5dbb46d:
path_to:
revision_to:

git.thebackupbox.net

hackvr

git://git.thebackupbox.net/hackvr

commit cd860515cd91c07b6cd88fab8a9c23acd5dbb46d
Author: epoch <epoch@hacking.allowed.org>
Date:   Thu Feb 13 18:26:38 2020 -0600

    ignore the comment. going to set camera angle directly from mouse_x11.c for now. will move to generic place later.

diff --git a/src/mouse_x11.c b/src/mouse_x11.c

index 0c4f1e994299a0cf98ff3ce70a1e092203b18ce9..

index ..244295327e375d752b3ce7f6c1a85d0ca10540d1 100644

--- a/src/mouse_x11.c
+++ b/src/mouse_x11.c
@@ -1,3 +1,4 @@
+#include <stdio.h>//for fprintf stderr. remove me later.
 #include "mouse_x11.h"
 #include "common.h"
 #include "graphics_c3.h"
@@ -48,7 +49,8 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu
     }
   }
   if(motion_notify) {
-    //mouse.x and mouse.y are shorts. this function expects ints. why are these shorts?
+    //mouse.x and mouse.y are both ints now...
+    //fprintf(stderr,"# mouse.x: %f mouse.y: %f\n# width: %u height: %u\n",gra_global.mouse.x,gra_global.mouse.y,gra_global.width,gra_global.height);
     XQueryPointer(x11_global.dpy,x11_global.w,&root,&child,&rmouse.x,&rmouse.y,&mouse.x,&mouse.y,&mask);
     gra_global.mouse=cs_to_c2(mouse);
     //return 1;
@@ -57,8 +59,10 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu
     //self-command myself to rotate myself?
     //snprintf(cmd,sizeof(cmd),"%s rotate +%d +%d +%d\n",global.user,3,11,1);
     //selfcommand(cmd);
-    //global.camera.r.x.d=((gra_global.height/2) - gra_global.mouse.y);
-    //global.camera.r.y.d=(gra_global.mouse.x - (gra_global.width/2));
+    //global.camera.r.x.d=(gra_global.height - gra_global.mouse.y);//up and down camera controls backwards
+    //fprintf(stderr,"# mouse.x: %f mouse.y: %f\n# width: %u height: %u\n",gra_global.mouse.x,gra_global.mouse.y,gra_global.width,gra_global.height);
+    global.camera.r.x.d=(gra_global.mouse.y);
+    global.camera.r.y.d=(gra_global.mouse.x);
   }
   if(redrawplzkthx) {
     redraw();

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 18:55:16 2024