From fab99221e68f2f494ea3c7a46858d427c6d9c9f8 Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 4 Jan 2017 16:38:30 -0600 Subject: added a function for drawing a filled cs shape. re-added flat shading based on distance. moved draw3d check into graphics.c instead of graphics lib specific file. --- src/graphics_x11.c | 91 ++++++++++++++---------------------------------------- 1 file changed, 24 insertions(+), 67 deletions(-) (limited to 'src/graphics_x11.c') diff --git a/src/graphics_x11.c b/src/graphics_x11.c index 1b31664..aea7dff 100644 --- a/src/graphics_x11.c +++ b/src/graphics_x11.c @@ -39,6 +39,11 @@ struct x11_global x11_global; #ifdef GRAPHICAL +void set_color_based_on_distance(real d) { + int i=100-((int)((d+100.0) * 16.0) % 100); + XSetForeground(x11_global.dpy,x11_global.backgc,x11_global.colors[i].pixel); +} + void draw_cs_line(cs_t p1,cs_t p2) { XDrawLine(x11_global.dpy,x11_global.backbuffer,x11_global.backgc,p1.x,p1.y,p2.x,p2.y); } @@ -54,86 +59,39 @@ void draw_cs_text(cs_t p,char *text) { } void draw_cs_shape(cs_s_t s) {//this is implemented as draw_cs_line... hrm. it could be moved up to graphics.c? probl no. - int i; - if(gra_global.draw3d == 1) { //wireframe - for(i=0;imax_aspect.x=AR_W*(gra_global.split_screen / (gra_global.red_and_blue ? gra_global.split_screen : 1)); hints->max_aspect.y=AR_H; hints->flags=PAspect; - XSetWMNormalHints(x11_global.dpy,x11_global.w,hints); } -- cgit v1.2.3