comparison Discovery/Src/t4_tetris.c @ 868:db92692c014f Evo_2_23

Introduce speed dependend coloring of depth: The depth value in the will now be colored based on the current ascent speed. The color code matches the one of the bar graph which was already used for visualization of the ascent speed. To keep color code consistent the existing color selection functions have been merged to one common Gfx function (T3/T7 - bar graph and color text)
author Ideenmodellierer
date Mon, 12 Aug 2024 15:14:19 +0200
parents ecb71521d004
children
comparison
equal deleted inserted replaced
867:3311b720a072 868:db92692c014f
34 #include "gfx_fonts.h" 34 #include "gfx_fonts.h"
35 #include "math.h" 35 #include "math.h"
36 #include "tHome.h" 36 #include "tHome.h"
37 #include "timer.h" 37 #include "timer.h"
38 #include "unit.h" 38 #include "unit.h"
39 #include "gfx_engine.h"
39 40
40 /* Exported variables --------------------------------------------------------*/ 41 /* Exported variables --------------------------------------------------------*/
41 42
42 /* Private variables ---------------------------------------------------------*/ 43 /* Private variables ---------------------------------------------------------*/
43 GFX_DrawCfgScreen t4screen; 44 GFX_DrawCfgScreen t4screen;
150 if( depth < 100) 151 if( depth < 100)
151 snprintf(text,TEXTSIZE,"\020%01.1f",depth); 152 snprintf(text,TEXTSIZE,"\020%01.1f",depth);
152 else 153 else
153 snprintf(text,TEXTSIZE,"\020%01.0f",depth); 154 snprintf(text,TEXTSIZE,"\020%01.0f",depth);
154 155
155 t3_basics_colorscheme_mod(text); 156 Gfx_colorsscheme_mod(text,0);
156 GFX_write_string(&FontT144,&t4l1,text,1); 157 GFX_write_string(&FontT144,&t4l1,text,1);
157 158
158 // divetime 159 // divetime
159 SDivetime Divetime = {0,0,0, 0}; 160 SDivetime Divetime = {0,0,0, 0};
160 161
184 185
185 if(Divetime.Minutes < 1000) 186 if(Divetime.Minutes < 1000)
186 snprintf(text,TEXTSIZE,"\020\016%u:%02u",Divetime.Minutes, Divetime.Seconds); 187 snprintf(text,TEXTSIZE,"\020\016%u:%02u",Divetime.Minutes, Divetime.Seconds);
187 else 188 else
188 snprintf(text,TEXTSIZE,"\020\016%u'",Divetime.Minutes); 189 snprintf(text,TEXTSIZE,"\020\016%u'",Divetime.Minutes);
189 t3_basics_colorscheme_mod(text); 190 Gfx_colorsscheme_mod(text,0);
190 GFX_write_string(&FontT105,&t4l2,text,1); 191 GFX_write_string(&FontT105,&t4l2,text,1);
191 } 192 }
192 193
193 194
194 195