|
|
@ -477,7 +477,7 @@ static void ui_draw_vision_maxspeed(UIState *s) { |
|
|
|
|
|
|
|
|
|
|
|
// Draw "MAX" Text
|
|
|
|
// Draw "MAX" Text
|
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
nvgFontFace(s->vg, "sans-regular"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_regular); |
|
|
|
nvgFontSize(s->vg, 26*2.5); |
|
|
|
nvgFontSize(s->vg, 26*2.5); |
|
|
|
if (is_cruise_set) { |
|
|
|
if (is_cruise_set) { |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); |
|
|
@ -487,14 +487,14 @@ static void ui_draw_vision_maxspeed(UIState *s) { |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 148, "MAX", NULL); |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 148, "MAX", NULL); |
|
|
|
|
|
|
|
|
|
|
|
// Draw Speed Text
|
|
|
|
// Draw Speed Text
|
|
|
|
nvgFontFace(s->vg, "sans-bold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_bold); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
if (is_cruise_set) { |
|
|
|
if (is_cruise_set) { |
|
|
|
snprintf(maxspeed_str, sizeof(maxspeed_str), "%d", maxspeed_calc); |
|
|
|
snprintf(maxspeed_str, sizeof(maxspeed_str), "%d", maxspeed_calc); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, maxspeed_str, NULL); |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, maxspeed_str, NULL); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
nvgFontFace(s->vg, "sans-semibold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_semibold); |
|
|
|
nvgFontSize(s->vg, 42*2.5); |
|
|
|
nvgFontSize(s->vg, 42*2.5); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 100)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 100)); |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, "N/A", NULL); |
|
|
|
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, "N/A", NULL); |
|
|
@ -560,7 +560,7 @@ static void ui_draw_vision_speedlimit(UIState *s) { |
|
|
|
|
|
|
|
|
|
|
|
// Draw "Speed Limit" Text
|
|
|
|
// Draw "Speed Limit" Text
|
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
nvgFontFace(s->vg, "sans-semibold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_semibold); |
|
|
|
nvgFontSize(s->vg, 50); |
|
|
|
nvgFontSize(s->vg, 50); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(0, 0, 0, 255)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(0, 0, 0, 255)); |
|
|
|
if (is_speedlim_valid && s->is_ego_over_limit) { |
|
|
|
if (is_speedlim_valid && s->is_ego_over_limit) { |
|
|
@ -570,7 +570,7 @@ static void ui_draw_vision_speedlimit(UIState *s) { |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2 + (is_speedlim_valid ? 6 : 0), viz_speedlim_y + (is_speedlim_valid ? 90 : 85), "SPEED", NULL); |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2 + (is_speedlim_valid ? 6 : 0), viz_speedlim_y + (is_speedlim_valid ? 90 : 85), "SPEED", NULL); |
|
|
|
|
|
|
|
|
|
|
|
// Draw Speed Text
|
|
|
|
// Draw Speed Text
|
|
|
|
nvgFontFace(s->vg, "sans-bold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_bold); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
if (s->is_ego_over_limit) { |
|
|
|
if (s->is_ego_over_limit) { |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
@ -581,7 +581,7 @@ static void ui_draw_vision_speedlimit(UIState *s) { |
|
|
|
snprintf(speedlim_str, sizeof(speedlim_str), "%d", speedlim_calc); |
|
|
|
snprintf(speedlim_str, sizeof(speedlim_str), "%d", speedlim_calc); |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), speedlim_str, NULL); |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), speedlim_str, NULL); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
nvgFontFace(s->vg, "sans-semibold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_semibold); |
|
|
|
nvgFontSize(s->vg, 42*2.5); |
|
|
|
nvgFontSize(s->vg, 42*2.5); |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), "N/A", NULL); |
|
|
|
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), "N/A", NULL); |
|
|
|
} |
|
|
|
} |
|
|
@ -606,12 +606,12 @@ static void ui_draw_vision_speed(UIState *s) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
snprintf(speed_str, sizeof(speed_str), "%d", (int)(speed * 2.2369363 + 0.5)); |
|
|
|
snprintf(speed_str, sizeof(speed_str), "%d", (int)(speed * 2.2369363 + 0.5)); |
|
|
|
} |
|
|
|
} |
|
|
|
nvgFontFace(s->vg, "sans-bold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_bold); |
|
|
|
nvgFontSize(s->vg, 96*2.5); |
|
|
|
nvgFontSize(s->vg, 96*2.5); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); |
|
|
|
nvgText(s->vg, viz_speed_x+viz_speed_w/2, 240, speed_str, NULL); |
|
|
|
nvgText(s->vg, viz_speed_x+viz_speed_w/2, 240, speed_str, NULL); |
|
|
|
|
|
|
|
|
|
|
|
nvgFontFace(s->vg, "sans-regular"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_regular); |
|
|
|
nvgFontSize(s->vg, 36*2.5); |
|
|
|
nvgFontSize(s->vg, 36*2.5); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); |
|
|
|
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 200)); |
|
|
|
|
|
|
|
|
|
|
@ -798,23 +798,23 @@ void ui_draw_vision_alert(UIState *s, int va_size, int va_color, |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); |
|
|
|
|
|
|
|
|
|
|
|
if (va_size == ALERTSIZE_SMALL) { |
|
|
|
if (va_size == ALERTSIZE_SMALL) { |
|
|
|
nvgFontFace(s->vg, "sans-semibold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_semibold); |
|
|
|
nvgFontSize(s->vg, 40*2.5); |
|
|
|
nvgFontSize(s->vg, 40*2.5); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+15, va_text1, NULL); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+15, va_text1, NULL); |
|
|
|
} else if (va_size== ALERTSIZE_MID) { |
|
|
|
} else if (va_size== ALERTSIZE_MID) { |
|
|
|
nvgFontFace(s->vg, "sans-bold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_bold); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2-45, va_text1, NULL); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2-45, va_text1, NULL); |
|
|
|
nvgFontFace(s->vg, "sans-regular"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_regular); |
|
|
|
nvgFontSize(s->vg, 36*2.5); |
|
|
|
nvgFontSize(s->vg, 36*2.5); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+75, va_text2, NULL); |
|
|
|
nvgText(s->vg, alr_x+alr_w/2, alr_y+alr_h/2+75, va_text2, NULL); |
|
|
|
} else if (va_size== ALERTSIZE_FULL) { |
|
|
|
} else if (va_size== ALERTSIZE_FULL) { |
|
|
|
nvgFontSize(s->vg, (longAlert1?72:96)*2.5); |
|
|
|
nvgFontSize(s->vg, (longAlert1?72:96)*2.5); |
|
|
|
nvgFontFace(s->vg, "sans-bold"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_bold); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE); |
|
|
|
nvgTextBox(s->vg, alr_x, alr_y+(longAlert1?360:420), alr_w-60, va_text1, NULL); |
|
|
|
nvgTextBox(s->vg, alr_x, alr_y+(longAlert1?360:420), alr_w-60, va_text1, NULL); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgFontSize(s->vg, 48*2.5); |
|
|
|
nvgFontFace(s->vg, "sans-regular"); |
|
|
|
nvgFontFaceId(s->vg, s->font_sans_regular); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM); |
|
|
|
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM); |
|
|
|
nvgTextBox(s->vg, alr_x, alr_h-(longAlert1?300:360), alr_w-60, va_text2, NULL); |
|
|
|
nvgTextBox(s->vg, alr_x, alr_h-(longAlert1?300:360), alr_w-60, va_text2, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|