From e5fb06e6cd62390b6a4c23fbd45ee9a258359af6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 19 Aug 2019 09:39:19 +0200 Subject: [PATCH] product:: HUD items displayed correctly --- basegraph.cpp | 4 ++-- config.cpp | 3 ++- drawing.cpp | 4 ++-- hud.cpp | 3 ++- hypgraph.cpp | 2 ++ inventory.cpp | 3 ++- racing.cpp | 3 ++- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/basegraph.cpp b/basegraph.cpp index 53b01ddd..30d7e9fc 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -282,7 +282,7 @@ void display_data::set_projection(int ed) { shaderside_projection = false; glhr::new_shader_projection = glhr::shader_projection::standard; - if(vid.consider_shader_projection && pmodel == mdDisk && !spherespecial && !(hyperbolic && vid.alpha <= -1) && GDIM == 2) + if(vid.consider_shader_projection && pmodel == mdDisk && !spherespecial && !(hyperbolic && vid.alpha <= -1) && MDIM == 3) shaderside_projection = true; else if(vid.consider_shader_projection && !glhr::noshaders) { if(pmodel == mdDisk && !spherespecial && !(hyperbolic && vid.alpha <= -1) && GDIM == 3 && apply_models) @@ -410,7 +410,7 @@ void display_data::set_projection(int ed) { glhr::projection_multiply(glhr::tmtogl_transpose(nisot::local_perspective)); } } - else if(GDIM == 3) { + else if(MDIM == 4) { glhr::glmatrix M = glhr::ortho(cd->xsize/current_display->radius/2, -cd->ysize/current_display->radius/2, 1); using models::clip_max; using models::clip_min; diff --git a/config.cpp b/config.cpp index 26b56ed8..9d063911 100644 --- a/config.cpp +++ b/config.cpp @@ -1759,7 +1759,8 @@ EX void showCustomizeChar() { int firsty = dialog::items[0].position / 2; int scale = firsty - 2 * vid.fsize; - dynamicval pm(pmodel, GDIM == 3 ? mdFlatten : mdDisk); + dynamicval pm(pmodel, flat_model()); + glClear(GL_DEPTH_BUFFER_BIT); dynamicval va(vid.alpha, 1); dynamicval vs(vid.scale, 1); dynamicval vc(vid.camera_angle, 0); diff --git a/drawing.cpp b/drawing.cpp index 97cafae2..3d565eb3 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -505,8 +505,8 @@ void glapplymatrix(const transmatrix& V) { glhr::set_modelview(glhr::as_glmatrix(mat)); return; } - - if(GDIM == 3) { + + if(MDIM == 4) { for(int y=0; y<4; y++) for(int x=0; x<4; x++) mat[id++] = V[x][y]; } diff --git a/hud.cpp b/hud.cpp index 3005975e..c291a477 100644 --- a/hud.cpp +++ b/hud.cpp @@ -480,7 +480,8 @@ EX void drawStats() { bool h = hide_player(); { - dynamicval pm(pmodel, GDIM == 3 ? mdFlatten : mdDisk); + dynamicval pm(pmodel, flat_model()); + glClear(GL_DEPTH_BUFFER_BIT); // dynamicval v(vid, vid); // vid.alpha = vid.scale = 1; dynamicval va(vid.alpha, 1); diff --git a/hypgraph.cpp b/hypgraph.cpp index dc669230..566316bf 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1509,6 +1509,8 @@ transmatrix screenpos(ld x, ld y) { return V; } +EX eModel flat_model() { return MDIM == 4 ? mdFlatten : mdDisk; } + EX transmatrix atscreenpos(ld x, ld y, ld size) { transmatrix V = Id; diff --git a/inventory.cpp b/inventory.cpp index 8c5b4c84..0d8293ce 100644 --- a/inventory.cpp +++ b/inventory.cpp @@ -480,7 +480,8 @@ EX namespace inv { int j = 0, oc = 6; if(1) { - dynamicval pm(pmodel, GDIM == 3 ? mdFlatten : mdDisk); + dynamicval pm(pmodel, flat_model()); + glClear(GL_DEPTH_BUFFER_BIT); // dynamicval v(vid, vid); // vid.alpha = vid.scale = 1; dynamicval va(vid.alpha, 1); diff --git a/racing.cpp b/racing.cpp index c1b0d470..1f4950ff 100644 --- a/racing.cpp +++ b/racing.cpp @@ -1289,7 +1289,8 @@ void drawStats() { if(!racing::on) return; - dynamicval pm(pmodel, GDIM == 3 ? mdFlatten : mdDisk); + dynamicval pm(pmodel, flat_model()); + glClear(GL_DEPTH_BUFFER_BIT); initquickqueue(); int bsize = vid.fsize * 2;