From 612f65d12428ed83c486505d1accac4a0954dcde Mon Sep 17 00:00:00 2001 From: epoch Date: Sat, 3 Aug 2019 07:46:19 -0500 Subject: added new redraw() which will work using libidc. also added an action on empty space of the mouse x and y --- src/graphics_c3.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/graphics_c3.c b/src/graphics_c3.c index 3013a82..38918ab 100644 --- a/src/graphics_c3.c +++ b/src/graphics_c3.c @@ -23,7 +23,7 @@ #define SKYW (WIDTH*5) #define SKYH (HEIGHT/2) -extern struct global global; +extern struct hvr_global global; struct gra_global gra_global; #ifdef GRAPHICAL @@ -459,6 +459,11 @@ void draw_screen() { draw_c3_shape(*(zs[i].s)); //} } + //we check here to see if the mouse button is still down + if(gra_global.mousemap[0]==-1) { + printf("%s action %f %f\n",global.user,gra_global.mouse.x,gra_global.mouse.y); + gra_global.mousemap[0]=0; + } /* if(gra_global.drawminimap == 1) { set_color(); @@ -490,6 +495,13 @@ void draw_screen() { flipscreen(); } +void redraw() {//something is requesting a redraw. + if(gra_global.force_redraw == 0) { + gra_global.force_redraw=1;//this is to prevent drawing way too often. + write(gra_global.redraw[1],"redraw plzkthx!\n",16); + } +} + int graphics_init() { //some of these values set global.zoom=25.0l;//I think if this is set to 1, then 1 3d unit is 1 2d unit? -- cgit v1.2.3