From 9e282099e1ccd122232bfc18c131450681dc03d8 Mon Sep 17 00:00:00 2001 From: epoch Date: Sat, 3 Feb 2018 23:33:36 -0600 Subject: fixed a bit of circle stuff. created draw minimap shape to be used instead of minimap line --- src/graphics_c3.c | 70 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/graphics_c3.c b/src/graphics_c3.c index 256a57c..2a275bb 100644 --- a/src/graphics_c3.c +++ b/src/graphics_c3.c @@ -45,6 +45,7 @@ real distance3(c3_t p1,c3_t p2) { return sqrt(( (p1.x-p2.x)*(p1.x-p2.x) )+( (p1.y-p2.y)*(p1.y-p2.y) )+( (p1.z-p2.z)*(p1.z-p2.z) )); } +/* moved to math.c int between_angles(degrees d,real lower,real upper) { //lower may be higher than upper. //because lower is < 0 which wraps to higher. lower is 270, upper is 90. 270-90 is in front. @@ -57,6 +58,7 @@ int between_angles(degrees d,real lower,real upper) { } return 0; } +*/ /* B (x2,y2) @@ -161,6 +163,21 @@ c2_t c3_to_c2(c3_t p3) { //DO NOT DRAW STUFF IN HERE return p2; } +void draw_minimap_shape(c3_s_t s) {//this should replace the draw_minimap_line and actually do circles. + //hrm... should I have functions for converting c3 points into minimap points? + c2_s_t s2; + s2.len=s.len; + s2.id=s.id; + int i=0; + //if(gra_global.drawminimap == 1) { + for(i=0;i 1) draw_minimap_line(s2.p[i],s2.p[(i+1)%s2.len]);//we shouldn't draw circles in here. +// if(s.len > 1) draw_minimap_line(s2.p[i],s2.p[(i+1)%s2.len]);//we shouldn't draw circles in here. //yeah. we probably should. s3.p[i]=c3_to_c2(s2.p[i]);//we need to convert all points in the shape if we have to draw any parts of it. } + draw_minimap_shape(s2); if(gra_global.draw3d == 1) { set_ansi_color(s.attrib.col%16); draw_c2_shape(s3); @@ -385,6 +405,7 @@ void draw_screen() { global.camera.p.z-=(gra_global.split_flip)*((gra_global.split/gra_global.split_screen)*cos( tmprad.r )); global.camera.p.x-=(gra_global.split_flip)*((gra_global.split/gra_global.split_screen)*sin( tmprad2.r )); } + //return 0;//after this for(cn=0;cn