1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

fixed the positioning in TPP

This commit is contained in:
Zeno Rogue 2020-11-07 15:43:09 +01:00
parent 1198c4467c
commit f0a98bbc55

View File

@ -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) {