From b459d3c8c98e5ca7b62a1a5677e5594b146ff84d Mon Sep 17 00:00:00 2001 From: epoch Date: Tue, 14 Apr 2020 06:09:59 -0500 Subject: now draw a cursor at the mouse location. useful in the fb version --- src/graphics_c3.c | 11 ++++++++--- src/graphics_c3.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/graphics_c3.c b/src/graphics_c3.c index 98c2c25..2af58d7 100644 --- a/src/graphics_c3.c +++ b/src/graphics_c3.c @@ -483,11 +483,16 @@ void draw_screen() { //this should be minimap shit //draw a line from the center to 80 away from the center in the angle of what should point at the mouse. - /*draw_c2_line((c2_t){0,0},gra_global.mouse); + //draw_c2_line((c2_t){0,0},gra_global.mouse); + set_color(); + draw_c2_line(c2_add(gra_global.mouse,(c2_t){0,1}) , c2_add(gra_global.mouse,(c2_t){0,5}) ); + draw_c2_line(c2_add(gra_global.mouse,(c2_t){0,-1}) , c2_add(gra_global.mouse,(c2_t){0,-5}) ); + draw_c2_line(c2_add(gra_global.mouse,(c2_t){1,0}) , c2_add(gra_global.mouse,(c2_t){5,0}) ); + draw_c2_line(c2_add(gra_global.mouse,(c2_t){-1,0}) , c2_add(gra_global.mouse,(c2_t){-5,0}) ); set_color(); //if(points_on_same_side_of_line(gra_global.mouse,(c2_t){80,80},(c2_t){0,0},(c2_t){0,80})) { - draw_c2_line((c2_t){0,0},rotate_c2((c2_t){80,0},(c2_t){0,0},points_to_angle((c2_t){0,0},gra_global.mouse))); - //}*/ + //draw_c2_line((c2_t){0,0},rotate_c2((c2_t){80,0},(c2_t){0,0},points_to_angle((c2_t){0,0},gra_global.mouse))); + //} flipscreen(); } diff --git a/src/graphics_c3.h b/src/graphics_c3.h index 3f9fb78..7ea5c74 100644 --- a/src/graphics_c3.h +++ b/src/graphics_c3.h @@ -2,6 +2,7 @@ #define _HACKVR_GRAPHICS_H_ #include +#include "common.h" struct gra_global { unsigned int width; -- cgit v1.2.3