summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2017-11-19 01:49:56 -0600
committerepoch <epoch@hacking.allowed.org>2017-11-19 01:49:56 -0600
commit9deee5b1917b6f644261d040a1832a14369a567f (patch)
treec2abc292691254d295360d4ebd9ec3140b34aa5c /src
parenteee6279b3737e2037b5b6bfb84ca83fd8bbc6359 (diff)
downloadhackvr-9deee5b1917b6f644261d040a1832a14369a567f.tar.gz
hackvr-9deee5b1917b6f644261d040a1832a14369a567f.zip
fixed the angle of movement when there is more than 1 camera and made some pixmaps get generated based on MAX sizes instead of current size which also means the default size is now small instead of huge.
Diffstat (limited to 'src')
-rw-r--r--src/config.h6
-rw-r--r--src/graphics_c3.c10
-rw-r--r--src/graphics_cs_x11.c4
3 files changed, 11 insertions, 9 deletions
diff --git a/src/config.h b/src/config.h
index cae9a3f..94688c6 100644
--- a/src/config.h
+++ b/src/config.h
@@ -13,8 +13,10 @@
#define RED_AND_BLUE 0
#define SHAPES 16386
#define MAX_SIDES 8
-#define WIDTH 4000
-#define HEIGHT 3000
+#define MAXWIDTH 4000
+#define WIDTH 320
+#define MAXHEIGHT 3000
+#define HEIGHT 240
#define DEFAULT_MINIMAP 0
#define FORCE_REDRAW 1
#define MAXSHAPES 30000
diff --git a/src/graphics_c3.c b/src/graphics_c3.c
index 805d062..a66cebb 100644
--- a/src/graphics_c3.c
+++ b/src/graphics_c3.c
@@ -133,7 +133,7 @@ c3_t c3_subtract(c3_t p1,c3_t p2) {
return (c3_t){p1.x-p2.x,p1.y-p2.y,p1.z-p2.z};
}
-#define MAGIC(x) (1.0l-(1.0l/powl(1.01l,(x)))) //??? might want to have some changables in here
+#define MAGIC(x) (1.0l-(1.0l/powl(1.1l,(x)))) //??? might want to have some changables in here
real magic(real x) {
return MAGIC(x);
@@ -341,8 +341,8 @@ void draw_screen() {
if(gra_global.split_screen > 1) {
//oh... this will need to be a couple more lines... of what? I forgot. -Sep 2017
- radians tmprad=d2r((degrees){global.camera.r.y.d+180});
- radians tmprad2=d2r((degrees){global.camera.r.y.d+180});
+ radians tmprad=d2r((degrees){global.camera.r.y.d+90});
+ radians tmprad2=d2r((degrees){global.camera.r.y.d+90});
global.camera.p.z-=(gra_global.split_flip)*((gra_global.split/gra_global.split_screen)*cosl( tmprad.r ));
global.camera.p.x-=(gra_global.split_flip)*((gra_global.split/gra_global.split_screen)*sinl( tmprad2.r ));
}
@@ -440,8 +440,8 @@ void draw_screen() {
}
// XSetForeground(global.dpy, global.backgc, global.green.pixel);
- radians tmprad=d2r((degrees){global.camera.r.y.d+180});
- radians tmprad2=d2r((degrees){global.camera.r.y.d+180});
+ radians tmprad=d2r((degrees){global.camera.r.y.d+90});
+ radians tmprad2=d2r((degrees){global.camera.r.y.d+90});
global.camera.p.z+=(gra_global.split_flip)*(gra_global.split*cosl( tmprad.r ));
global.camera.p.x+=(gra_global.split_flip)*(gra_global.split*sinl( tmprad2.r ));
}
diff --git a/src/graphics_cs_x11.c b/src/graphics_cs_x11.c
index 9a18738..fea54a5 100644
--- a/src/graphics_cs_x11.c
+++ b/src/graphics_cs_x11.c
@@ -353,8 +353,8 @@ int graphics_sub_init() {
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,gra_global.width,gra_global.height,DefaultDepth(x11_global.dpy,DefaultScreen(x11_global.dpy)));
- x11_global.cleanbackbuffer=XCreatePixmap(x11_global.dpy,x11_global.w,gra_global.width,gra_global.height,DefaultDepth(x11_global.dpy,DefaultScreen(x11_global.dpy)));
+ 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)));
//backbuffer is uninitialized
x11_global.backgc=XCreateGC(x11_global.dpy,x11_global.backbuffer,0,0);