summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2018-02-03 23:35:22 -0600
committerepoch <epoch@hacking.allowed.org>2018-02-03 23:35:22 -0600
commit212970b34f03cf8f65ef6e140c8b8d8752a3b21d (patch)
tree04b95cbeaf79c2490fa43d5af4cfa9dc7449ece8 /src
parentd6a28f65ab720ab7c811f344a10b2d6d2653a7df (diff)
downloadhackvr-212970b34f03cf8f65ef6e140c8b8d8752a3b21d.tar.gz
hackvr-212970b34f03cf8f65ef6e140c8b8d8752a3b21d.zip
fixed a typo that broke circles. removed global initializations that are better placed in a more generic place.
Diffstat (limited to 'src')
-rw-r--r--src/graphics_cs_x11.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/graphics_cs_x11.c b/src/graphics_cs_x11.c
index 595c524..1e55899 100644
--- a/src/graphics_cs_x11.c
+++ b/src/graphics_cs_x11.c
@@ -88,8 +88,8 @@ void draw_cs_shape(cs_s_t s) {//this is implemented as draw_cs_line... hrm. it c
int i;//all cs shapes can have 1, 2, or 3+ points. guess I gotta do that logic here too.
switch(s.len) {
case 1:
- //cicle
- h=max(s.p[0].y,s.p[1].y)-min(s.p[0].y,s.p[1].y);
+ //circle
+ h=max(s.p[0].x,s.p[1].x)-min(s.p[0].x,s.p[1].x);
XDrawArc(x11_global.dpy,x11_global.backbuffer,x11_global.backgc,s.p[0].x-h,s.p[0].y-h,h*2,h*2,0,360*64);
break;
default:
@@ -137,6 +137,7 @@ void draw_cs_filled_shape(cs_s_t s) {
switch(s.len) {
case 1:
h=max(s.p[0].y,s.p[1].y)-min(s.p[0].y,s.p[1].y);
+ h=max(s.p[0].x,s.p[1].x)-min(s.p[0].x,s.p[0].x);
XFillArc(x11_global.dpy,x11_global.backbuffer,x11_global.backgc,s.p[0].x-h,s.p[0].y-h,h*2,h*2,0,360*64);
break;
default:
@@ -418,10 +419,6 @@ int graphics_sub_init() {
}
XMapWindow(x11_global.dpy,x11_global.w);
XStoreName(x11_global.dpy,x11_global.w,"hackvr");
- global.shape[0]=0;//we'll allocate as we need more.
- global.camera.id=global.user;
- global.group_rot[0]=&global.camera;
- global.group_rot[1]=0;
x11_global.gc=XCreateGC(x11_global.dpy,x11_global.w, 0, 0);
x11_global.backbuffer=XCreatePixmap(x11_global.dpy,x11_global.w,MAXWIDTH,MAXHEIGHT,DefaultDepth(x11_global.dpy,DefaultScreen(x11_global.dpy)));
x11_global.cleanbackbuffer=XCreatePixmap(x11_global.dpy,x11_global.w,MAXWIDTH,MAXHEIGHT,DefaultDepth(x11_global.dpy,DefaultScreen(x11_global.dpy)));