From aa423fa53e2a5a1c376203faff0f5b8c75d4b9d8 Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 4 Jan 2017 21:07:33 -0600 Subject: made selected object have its shapes outlined with the default color fixed the selected object to be closest instead of farthest. oops. --- src/graphics.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index e658376..7508fc9 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -172,7 +172,12 @@ void draw_c3_shape(c3_s_t s) {//outlined. needs to be filled? //draw minimap shi //between 0 to 100 // color_based_on_distance();//I don't have the distance in here. :/ //foreground_set(); +//how... I want to draw the outline as one color and the fill as another. draw_cs_filled_shape(ss); + set_color();//resets it to the default color. + if(!strcmp(global.selected_object,ss.id)) { + draw_cs_shape(ss); + } } } @@ -460,10 +465,10 @@ void draw_screen() { } qsort(&zs,i,sizeof(zs[0]),(__compar_fn_t)compar);//sort these zs structs based on d. } - //draw all triangles - if(zs[0].s) { - strcpy(global.selected_object,zs[0].s->id); + if(zs[i-1].s) { + strcpy(global.selected_object,zs[i-1].s->id);//0th is farthest. fixme. } + //draw all triangles for(i=0;global.shape[i];i++) { //now we pick the color of this triangle! if(gra_global.red_and_blue) { -- cgit v1.2.3