From 29bfb82af2eaf9c505afb52cdd3e09ac9215876d Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 00:28:49 +0100 Subject: [PATCH 1/6] WIP: cant draw properly an angle range... --- include/cg_draw.h | 1 + src/CMakeLists.txt | 1 + src/cg_draw.c | 38 +++++++++ src/cg_hud.c | 4 + src/dynamic_pitch.c | 202 ++++++++++++++++++++++++++++++++++++++++++++ src/dynamic_pitch.h | 10 +++ 6 files changed, 256 insertions(+) create mode 100644 src/dynamic_pitch.c create mode 100644 src/dynamic_pitch.h diff --git a/include/cg_draw.h b/include/cg_draw.h index 7e89781..f349afb 100644 --- a/include/cg_draw.h +++ b/include/cg_draw.h @@ -52,6 +52,7 @@ void CG_Draw3DModel( void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_t const color); +void CG_FillAnglePitch(float start, float end, float pitch, float x, float w, vec4_t const color); void CG_FillAngleYaw(float start, float end, float yaw, float y, float h, vec4_t const color); void CG_DrawLineYaw(float angle, float yaw, float y, float w, float h, vec4_t const color); void CG_DrawCharYaw(float angle, float yaw, float y, float w, float h, uint8_t ch, vec4_t const color); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7aa2d2b..a4f45a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,6 +28,7 @@ add_library(cgame_obj OBJECT g_weapon.c help.c pitch.c + dynamic_pitch.c q_math.c q_shared.c ) diff --git a/src/cg_draw.c b/src/cg_draw.c index e5e67a0..5d2285d 100644 --- a/src/cg_draw.c +++ b/src/cg_draw.c @@ -332,6 +332,30 @@ static inline range_t AnglesToRange(float start, float end, float yaw) return ret; } +static inline range_t PitchAnglesToRange(float start, float end, float pitch) +{ + if (fabsf(end - start) > 2 * (float)M_PI) + { + range_t const ret = { 0, cgs.screenHeight, qfalse }; + return ret; + } + + qboolean split = end > start; + start = AngleNormalizePI(start - pitch); + end = AngleNormalizePI(end - pitch); + + if (end > start) + { + split = !split; + float const tmp = start; + start = end; + end = tmp; + } + + range_t const ret = { ProjectionY(start), ProjectionY(end), split }; + return ret; +} + void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_t const color) { angle = AngleNormalizePI(angle - pitch); @@ -341,6 +365,20 @@ void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_ CG_FillRect(x, y - h / 2, w, h, color); } +void CG_FillAnglePitch(float start, float end, float pitch, float x, float w, vec4_t const color) +{ + range_t const range = PitchAnglesToRange(start, end, pitch); + if (!range.split) + { + CG_FillRect(x, range.x1, w, range.x2 - range.x1, color); + } + else + { + CG_FillRect(x, 0, w, range.x1, color); + CG_FillRect(x, range.x2, w, cgs.screenHeight - range.x2, color); + } +} + void CG_FillAngleYaw(float start, float end, float yaw, float y, float h, vec4_t const color) { range_t const range = AnglesToRange(start, end, yaw); diff --git a/src/cg_hud.c b/src/cg_hud.c index 0c5730e..3504867 100644 --- a/src/cg_hud.c +++ b/src/cg_hud.c @@ -32,6 +32,7 @@ #include "cg_snap.h" #include "cg_timer.h" #include "compass.h" +#include "dynamic_pitch.h" #include "help.h" #include "pitch.h" #include "version.h" @@ -61,6 +62,7 @@ void init_hud(void) init_gl(); init_jump(); init_pitch(); + init_dynamic_pitch(); init_rl(); init_snap(); init_timer(); @@ -85,6 +87,7 @@ void update_hud(void) update_gl(); update_jump(); update_pitch(); + update_dynamic_pitch(); update_rl(); update_snap(); update_timer(); @@ -101,6 +104,7 @@ void draw_hud(void) draw_cgaz(); draw_snap(); draw_pitch(); + draw_dynamic_pitch(); draw_ammo(); draw_jump(); diff --git a/src/dynamic_pitch.c b/src/dynamic_pitch.c new file mode 100644 index 0000000..fab16c2 --- /dev/null +++ b/src/dynamic_pitch.c @@ -0,0 +1,202 @@ +#include "dynamic_pitch.h" + +#include "cg_cvar.h" +#include "cg_draw.h" +#include "cg_utils.h" +#include "help.h" + +#include + +static vmCvar_t dynamic_pitch; +static vmCvar_t dynamic_pitch_xw; +static vmCvar_t dynamic_pitch_rgba; + +static cvarTable_t dynamic_pitch_cvars[] = { + { &dynamic_pitch, "mdd_dynamic_pitch", "0b00", CVAR_ARCHIVE_ND }, + { &dynamic_pitch_xw, "mdd_dynamic_pitch_xw", "316 8", CVAR_ARCHIVE_ND }, + { &dynamic_pitch_rgba, "mdd_dynamic_pitch_rgba", ".4 .4 .8 .6", CVAR_ARCHIVE_ND } +}; + +static help_t dynamic_pitch_help[] = { + { + dynamic_pitch_cvars + 0, + BINARY_LITERAL, + { + "mdd_dynamic_pitch 0bXX", + " ||", + " |+- enable dynamic_pitch", + " +--- halves alpha when in sub optimal origin/angle", + }, + }, +#define DYNAMIC_PITCH_ENABLED 1 +#define DYNAMIC_PITCH_SCALE_ALPHA 2 + { + dynamic_pitch_cvars + 1, + X | W, + { + "mdd_dynamic_pitch_xw X X ", + }, + }, + { + dynamic_pitch_cvars + 2, + RGBA, + { + "mdd_dynamic_pitch_rgba X X X X", + }, + }, +}; + +void init_dynamic_pitch(void) +{ + init_cvars(dynamic_pitch_cvars, ARRAY_LEN(dynamic_pitch_cvars)); + init_help(dynamic_pitch_help, ARRAY_LEN(dynamic_pitch_help)); +} + +void update_dynamic_pitch(void) +{ + update_cvars(dynamic_pitch_cvars, ARRAY_LEN(dynamic_pitch_cvars)); +} + +typedef struct +{ + vec3_t graph_xw; + vec4_t graph_rgba; + + playerState_t pm_ps; +} dynamic_pitch_t; + +static dynamic_pitch_t s; + +void draw_dynamic_pitch(void) +{ + if (!dynamic_pitch.integer) return; + + ParseVec(dynamic_pitch_xw.string, s.graph_xw, 2); + ParseVec(dynamic_pitch_rgba.string, s.graph_rgba, 4); + + s.pm_ps = *getPs(); + + float const yaw = s.pm_ps.viewangles[YAW]; + + // find the optimal vertical climbing angle, this depends on two things: + // 1. the player's origin + // 2. the player's view direction + // angle indexes + // 1 -> 70.2 - 72.6 (1476u, 1487u) + // 2 -> 71.7 - 72.6 (1475u, 1487u) + // 3 -> 73.4 - 74.0 (1475u, 1487u) + // 4 -> 73.4 - 74.0 (1112u, this is the bad one) + int optimal_angle; + if (s.pm_ps.origin[0] >= 0 && s.pm_ps.origin[1] >= 0) + { + // NE + if (yaw >= -45.0f && yaw < 45.0f) + { + optimal_angle = 2; + } + else if (yaw >= 45.0f && yaw < 135.0f) + { + optimal_angle = 2; + } + else if (yaw >= 135.0f || yaw < -135.0f) + { + optimal_angle = 3; + } + else + { + optimal_angle = 3; + } + } + else if (s.pm_ps.origin[0] < 0 && s.pm_ps.origin[1] >= 0) + { + // NW + if (yaw >= -45.0f && yaw < 45.0f) + { + optimal_angle = 4; + } + else if (yaw >= 45.0f && yaw < 135.0f) + { + optimal_angle = 2; + } + else if (yaw >= 135.0f || yaw < -135.0f) + { + optimal_angle = 1; + } + else + { + optimal_angle = 3; + } + } + else if (s.pm_ps.origin[0] < 0 && s.pm_ps.origin[1] < 0) + { + // SW + if (yaw >= -45.0f && yaw < 45.0f) + { + optimal_angle = 4; + } + else if (yaw >= 45.0f && yaw < 135.0f) + { + optimal_angle = 4; + } + else if (yaw >= 135.0f || yaw < -135.0f) + { + optimal_angle = 1; + } + else + { + optimal_angle = 1; + } + } + else + { + // SE + if (yaw >= -45.0f && yaw < 45.0f) + { + optimal_angle = 2; + } + else if (yaw >= 45.0f && yaw < 135.0f) + { + optimal_angle = 4; + } + else if (yaw >= 135.0f || yaw < -135.0f) + { + optimal_angle = 3; + } + else + { + optimal_angle = 1; + } + } + + float min_optimal_angle; + float max_optimal_angle; + + // vec4_t graph_rgba = *s.graph_rgba; + if (optimal_angle == 1) + { + min_optimal_angle = 70.2f; + max_optimal_angle = 72.6f; + } + else if (optimal_angle == 2) + { + min_optimal_angle = 71.7f; + max_optimal_angle = 72.6f; + } + else if (optimal_angle == 3) + { + min_optimal_angle = 73.4f; + max_optimal_angle = 74.0f; + } + else + { + min_optimal_angle = 73.4f; + max_optimal_angle = 74.0f; + // graph_rgba = vec4_t{ s.graph_rgba[0], s.graph_rgba[1], s.graph_rgba[2], s.graph_rgba[3] * 0.5f }; + } + + float const x = s.graph_xw[0]; + float const w = s.graph_xw[1]; + + float const pitch = s.pm_ps.viewangles[PITCH]; + CG_FillAnglePitch(DEG2RAD(min_optimal_angle), DEG2RAD(max_optimal_angle), DEG2RAD(pitch), x, w, s.graph_rgba); +} diff --git a/src/dynamic_pitch.h b/src/dynamic_pitch.h new file mode 100644 index 0000000..55f1a79 --- /dev/null +++ b/src/dynamic_pitch.h @@ -0,0 +1,10 @@ +#ifndef DYNAMIC_PITCH_H +#define DYNAMIC_PITCH_H + +void init_dynamic_pitch(void); + +void update_dynamic_pitch(void); + +void draw_dynamic_pitch(void); + +#endif // DYNAMIC_PITCH_H From 3016a39bf40adc887767313238bf2ce529b1c95a Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 07:36:07 +0100 Subject: [PATCH 2/6] In a working state, ish. seperated color variables into max, submax and badmax. badmax means that this quadrant/face is just a bad combination and plasma climbs are affected. submax is almost as good as the optimal angle. max is the optimal angle, and different to badmax it is the best we can do in quake. Still some gaps between the submax and max pitch angles. --- src/cg_draw.c | 18 +++---- src/dynamic_pitch.c | 125 +++++++++++++++++++++++++++++++------------- 2 files changed, 98 insertions(+), 45 deletions(-) diff --git a/src/cg_draw.c b/src/cg_draw.c index 5d2285d..2f51c3d 100644 --- a/src/cg_draw.c +++ b/src/cg_draw.c @@ -365,18 +365,16 @@ void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_ CG_FillRect(x, y - h / 2, w, h, color); } +// this function probably breaks in some cases, splits aren't handled like in FillAngleYaw +// Attempts to make it the same way, only for pitch were unsuccessful. void CG_FillAnglePitch(float start, float end, float pitch, float x, float w, vec4_t const color) { - range_t const range = PitchAnglesToRange(start, end, pitch); - if (!range.split) - { - CG_FillRect(x, range.x1, w, range.x2 - range.x1, color); - } - else - { - CG_FillRect(x, 0, w, range.x1, color); - CG_FillRect(x, range.x2, w, cgs.screenHeight - range.x2, color); - } + float start_angle = AngleNormalizePI(start - pitch); + float start_test = ProjectionY(start_angle); + + float end_angle = AngleNormalizePI(end - pitch); + float end_test = ProjectionY(end_angle); + CG_FillRect(x, start_test, w, end_test - start_test, color); } void CG_FillAngleYaw(float start, float end, float yaw, float y, float h, vec4_t const color) diff --git a/src/dynamic_pitch.c b/src/dynamic_pitch.c index fab16c2..397efd2 100644 --- a/src/dynamic_pitch.c +++ b/src/dynamic_pitch.c @@ -9,27 +9,19 @@ static vmCvar_t dynamic_pitch; static vmCvar_t dynamic_pitch_xw; -static vmCvar_t dynamic_pitch_rgba; +static vmCvar_t dynamic_pitch_max_rgba; +static vmCvar_t dynamic_pitch_submax_rgba; +static vmCvar_t dynamic_pitch_badmax_rgba; static cvarTable_t dynamic_pitch_cvars[] = { - { &dynamic_pitch, "mdd_dynamic_pitch", "0b00", CVAR_ARCHIVE_ND }, + { &dynamic_pitch, "mdd_dynamic_pitch", "0", CVAR_ARCHIVE_ND }, { &dynamic_pitch_xw, "mdd_dynamic_pitch_xw", "316 8", CVAR_ARCHIVE_ND }, - { &dynamic_pitch_rgba, "mdd_dynamic_pitch_rgba", ".4 .4 .8 .6", CVAR_ARCHIVE_ND } + { &dynamic_pitch_max_rgba, "mdd_dynamic_pitch_max_rgba", ".2 .8 .2 .9", CVAR_ARCHIVE_ND }, + { &dynamic_pitch_submax_rgba, "mdd_dynamic_pitch_submax_rgba", ".8 .6 .2 .7", CVAR_ARCHIVE_ND }, + { &dynamic_pitch_badmax_rgba, "mdd_dynamic_pitch_badmax_rgba", ".9 .2 .2 .6", CVAR_ARCHIVE_ND }, }; static help_t dynamic_pitch_help[] = { - { - dynamic_pitch_cvars + 0, - BINARY_LITERAL, - { - "mdd_dynamic_pitch 0bXX", - " ||", - " |+- enable dynamic_pitch", - " +--- halves alpha when in sub optimal origin/angle", - }, - }, -#define DYNAMIC_PITCH_ENABLED 1 -#define DYNAMIC_PITCH_SCALE_ALPHA 2 { dynamic_pitch_cvars + 1, X | W, @@ -41,7 +33,21 @@ static help_t dynamic_pitch_help[] = { dynamic_pitch_cvars + 2, RGBA, { - "mdd_dynamic_pitch_rgba X X X X", + "mdd_dynamic_pitch_max_rgba X X X X", + }, + }, + { + dynamic_pitch_cvars + 3, + RGBA, + { + "mdd_dynamic_pitch_submax_rgba X X X X", + }, + }, + { + dynamic_pitch_cvars + 4, + RGBA, + { + "mdd_dynamic_pitch_badmax_rgba X X X X", }, }, }; @@ -60,7 +66,9 @@ void update_dynamic_pitch(void) typedef struct { vec3_t graph_xw; - vec4_t graph_rgba; + vec4_t max_graph_rgba; + vec4_t submax_graph_rgba; + vec4_t badmax_graph_rgba; playerState_t pm_ps; } dynamic_pitch_t; @@ -72,7 +80,9 @@ void draw_dynamic_pitch(void) if (!dynamic_pitch.integer) return; ParseVec(dynamic_pitch_xw.string, s.graph_xw, 2); - ParseVec(dynamic_pitch_rgba.string, s.graph_rgba, 4); + ParseVec(dynamic_pitch_max_rgba.string, s.max_graph_rgba, 4); + ParseVec(dynamic_pitch_submax_rgba.string, s.submax_graph_rgba, 4); + ParseVec(dynamic_pitch_badmax_rgba.string, s.badmax_graph_rgba, 4); s.pm_ps = *getPs(); @@ -82,10 +92,13 @@ void draw_dynamic_pitch(void) // 1. the player's origin // 2. the player's view direction // angle indexes - // 1 -> 70.2 - 72.6 (1476u, 1487u) - // 2 -> 71.7 - 72.6 (1475u, 1487u) - // 3 -> 73.4 - 74.0 (1475u, 1487u) - // 4 -> 73.4 - 74.0 (1112u, this is the bad one) + // 1 -> 70.2 - 70.6 (1476u, submax) + // 70.7 - 72.6 (1487u, max) + // 2 -> 71.7 - 72.1 (1475u, submax) + // 72.2 - 72.6 (1487u, max) + // 3 -> 73.4 - 73.5 (1475u, submax) + // 73.6 - 74.0 (1487u, max) + // 4 -> 73.4 - 74.0 (1112u, badmax this is the bad one) int optimal_angle; if (s.pm_ps.origin[0] >= 0 && s.pm_ps.origin[1] >= 0) { @@ -168,35 +181,77 @@ void draw_dynamic_pitch(void) } } - float min_optimal_angle; - float max_optimal_angle; + float submax_optimal_angle_min; + float submax_optimal_angle_max; + qboolean submax_set = FALSE; + + float max_optimal_angle_min; + float max_optimal_angle_max; + qboolean max_set = FALSE; + + float badmax_optimal_angle_min; + float badmax_optimal_angle_max; + qboolean badmax_set = FALSE; - // vec4_t graph_rgba = *s.graph_rgba; if (optimal_angle == 1) { - min_optimal_angle = 70.2f; - max_optimal_angle = 72.6f; + submax_optimal_angle_min = 70.2f; + submax_optimal_angle_max = 70.6f; + + max_optimal_angle_min = 70.7f; + max_optimal_angle_max = 72.6f; + + submax_set = TRUE; + max_set = TRUE; } else if (optimal_angle == 2) { - min_optimal_angle = 71.7f; - max_optimal_angle = 72.6f; + submax_optimal_angle_min = 71.7f; + submax_optimal_angle_max = 72.1f; + + max_optimal_angle_min = 72.2f; + max_optimal_angle_max = 72.6f; + + submax_set = TRUE; + max_set = TRUE; } else if (optimal_angle == 3) { - min_optimal_angle = 73.4f; - max_optimal_angle = 74.0f; + submax_optimal_angle_min = 73.4f; + submax_optimal_angle_max = 73.5f; + + max_optimal_angle_min = 73.6f; + max_optimal_angle_max = 74.0f; + + submax_set = TRUE; + max_set = TRUE; } else { - min_optimal_angle = 73.4f; - max_optimal_angle = 74.0f; - // graph_rgba = vec4_t{ s.graph_rgba[0], s.graph_rgba[1], s.graph_rgba[2], s.graph_rgba[3] * 0.5f }; + badmax_optimal_angle_min = 73.4f; + badmax_optimal_angle_max = 74.0f; + + badmax_set = TRUE; } float const x = s.graph_xw[0]; float const w = s.graph_xw[1]; float const pitch = s.pm_ps.viewangles[PITCH]; - CG_FillAnglePitch(DEG2RAD(min_optimal_angle), DEG2RAD(max_optimal_angle), DEG2RAD(pitch), x, w, s.graph_rgba); + + if (submax_set) + { + CG_FillAnglePitch( + DEG2RAD(submax_optimal_angle_min), DEG2RAD(submax_optimal_angle_max), DEG2RAD(pitch), x, w, s.submax_graph_rgba); + } + if (max_set) + { + CG_FillAnglePitch( + DEG2RAD(max_optimal_angle_min), DEG2RAD(max_optimal_angle_max), DEG2RAD(pitch), x, w, s.max_graph_rgba); + } + if (badmax_set) + { + CG_FillAnglePitch( + DEG2RAD(badmax_optimal_angle_min), DEG2RAD(badmax_optimal_angle_max), DEG2RAD(pitch), x, w, s.badmax_graph_rgba); + } } From 78fc0f0027d9c2da5f7b0af4adaa562a6bd2c684 Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 07:46:01 +0100 Subject: [PATCH 3/6] removes unused pitch angles to range function --- src/cg_draw.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/cg_draw.c b/src/cg_draw.c index 2f51c3d..3900452 100644 --- a/src/cg_draw.c +++ b/src/cg_draw.c @@ -332,30 +332,6 @@ static inline range_t AnglesToRange(float start, float end, float yaw) return ret; } -static inline range_t PitchAnglesToRange(float start, float end, float pitch) -{ - if (fabsf(end - start) > 2 * (float)M_PI) - { - range_t const ret = { 0, cgs.screenHeight, qfalse }; - return ret; - } - - qboolean split = end > start; - start = AngleNormalizePI(start - pitch); - end = AngleNormalizePI(end - pitch); - - if (end > start) - { - split = !split; - float const tmp = start; - start = end; - end = tmp; - } - - range_t const ret = { ProjectionY(start), ProjectionY(end), split }; - return ret; -} - void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_t const color) { angle = AngleNormalizePI(angle - pitch); From 3dcaae2f59df143bb2358ff78906cf5f98868f2f Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 11:24:33 +0100 Subject: [PATCH 4/6] cleaning up a bit --- src/cg_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cg_draw.c b/src/cg_draw.c index 3900452..a2168fa 100644 --- a/src/cg_draw.c +++ b/src/cg_draw.c @@ -346,11 +346,11 @@ void CG_DrawLinePitch(float angle, float pitch, float x, float w, float h, vec4_ void CG_FillAnglePitch(float start, float end, float pitch, float x, float w, vec4_t const color) { float start_angle = AngleNormalizePI(start - pitch); - float start_test = ProjectionY(start_angle); + float start_y = ProjectionY(start_angle); float end_angle = AngleNormalizePI(end - pitch); - float end_test = ProjectionY(end_angle); - CG_FillRect(x, start_test, w, end_test - start_test, color); + float end_y = ProjectionY(end_angle); + CG_FillRect(x, start_y, w, start_y - end_y, color); } void CG_FillAngleYaw(float start, float end, float yaw, float y, float h, vec4_t const color) From 7a505808b6c8443bac7c6ed0b1555506f03a688d Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 14:20:45 +0100 Subject: [PATCH 5/6] use qboolean qtrue qfalse --- src/dynamic_pitch.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dynamic_pitch.c b/src/dynamic_pitch.c index 397efd2..59518bc 100644 --- a/src/dynamic_pitch.c +++ b/src/dynamic_pitch.c @@ -183,15 +183,15 @@ void draw_dynamic_pitch(void) float submax_optimal_angle_min; float submax_optimal_angle_max; - qboolean submax_set = FALSE; + qboolean submax_set = qfalse; float max_optimal_angle_min; float max_optimal_angle_max; - qboolean max_set = FALSE; + qboolean max_set = qfalse; float badmax_optimal_angle_min; float badmax_optimal_angle_max; - qboolean badmax_set = FALSE; + qboolean badmax_set = qfalse; if (optimal_angle == 1) { @@ -201,8 +201,8 @@ void draw_dynamic_pitch(void) max_optimal_angle_min = 70.7f; max_optimal_angle_max = 72.6f; - submax_set = TRUE; - max_set = TRUE; + submax_set = qtrue; + max_set = qtrue; } else if (optimal_angle == 2) { @@ -212,8 +212,8 @@ void draw_dynamic_pitch(void) max_optimal_angle_min = 72.2f; max_optimal_angle_max = 72.6f; - submax_set = TRUE; - max_set = TRUE; + submax_set = qtrue; + max_set = qtrue; } else if (optimal_angle == 3) { @@ -223,15 +223,15 @@ void draw_dynamic_pitch(void) max_optimal_angle_min = 73.6f; max_optimal_angle_max = 74.0f; - submax_set = TRUE; - max_set = TRUE; + submax_set = qtrue; + max_set = qtrue; } else { badmax_optimal_angle_min = 73.4f; badmax_optimal_angle_max = 74.0f; - badmax_set = TRUE; + badmax_set = qtrue; } float const x = s.graph_xw[0]; From e29c4754869818660e00fc4a7808dcdf4cb370e6 Mon Sep 17 00:00:00 2001 From: Halvor GB Date: Sun, 6 Feb 2022 14:27:09 +0100 Subject: [PATCH 6/6] reverts accidental subtraction flip when renaming --- src/cg_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cg_draw.c b/src/cg_draw.c index a2168fa..0c0eae9 100644 --- a/src/cg_draw.c +++ b/src/cg_draw.c @@ -350,7 +350,7 @@ void CG_FillAnglePitch(float start, float end, float pitch, float x, float w, ve float end_angle = AngleNormalizePI(end - pitch); float end_y = ProjectionY(end_angle); - CG_FillRect(x, start_y, w, start_y - end_y, color); + CG_FillRect(x, start_y, w, end_y - start_y, color); } void CG_FillAngleYaw(float start, float end, float yaw, float y, float h, vec4_t const color)