From f0a98bbc556ba5e8bcd758d429665d95e22106df Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 7 Nov 2020 15:43:09 +0100 Subject: [PATCH] fixed the positioning in TPP --- shaders.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shaders.cpp b/shaders.cpp index c62262c6..6ba1571c 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -496,6 +496,8 @@ void display_data::set_projection(int ed, ld shift) { glhr::id_modelview(); }; + bool u_alpha = false; + if(shader_flags & SF_PIXELS) ortho(cd->xsize/2, -cd->ysize/2); else if(shader_flags & SF_BOX) ortho(cd->xsize/current_display->radius/2, -cd->ysize/current_display->radius/2); else if(shader_flags & SF_ODSBOX) { @@ -531,8 +533,7 @@ void display_data::set_projection(int ed, ld shift) { GLfloat sc = current_display->radius / (cd->ysize/2.); glhr::projection_multiply(glhr::frustum(cd->xsize / cd->ysize, 1)); glhr::projection_multiply(glhr::scale(sc, -sc, -1)); - glhr::projection_multiply(glhr::translate(0, 0, pconf.alpha)); - if(ed) glhr::projection_multiply(glhr::translate(vid.ipd * ed/2, 0, 0)); + u_alpha = true; } if(selected->uRotNil != -1) { @@ -602,6 +603,11 @@ void display_data::set_projection(int ed, ld shift) { glhr::projection_multiply(glhr::as_glmatrix(yzspin)); } + + if(u_alpha) { + glhr::projection_multiply(glhr::translate(0, 0, pconf.alpha)); + if(ed) glhr::projection_multiply(glhr::translate(vid.ipd * ed/2, 0, 0)); + } } EX void add_if(string& shader, const string& seek, const string& function) {