1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-20 08:27:39 +00:00

scrdist_text removed

This commit is contained in:
Zeno Rogue
2019-04-29 11:16:37 +02:00
parent 5895540ae9
commit 5d77c86658
3 changed files with 2 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ namespace stereo {
ld lr_eyewidth, anaglyph_eyewidth; ld lr_eyewidth, anaglyph_eyewidth;
ld fov, tanfov; ld fov, tanfov;
GLfloat scrdist, scrdist_text; GLfloat scrdist;
} }
bool display_data::in_anaglyph() { return vid.stereo_mode == sAnaglyph; } bool display_data::in_anaglyph() { return vid.stereo_mode == sAnaglyph; }
@@ -252,7 +252,6 @@ void display_data::set_projection(int ed) {
if(DIM == 3 && apply_models) { if(DIM == 3 && apply_models) {
glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, 1)); glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, 1));
glhr::id_modelview(); glhr::id_modelview();
current_display->scrdist_text = 0;
} }
else { else {
glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, abs(current_display->scrdist) + 30000)); glhr::projection_multiply(glhr::ortho(cd->xsize/2, -cd->ysize/2, abs(current_display->scrdist) + 30000));
@@ -280,7 +279,6 @@ void display_data::set_projection(int ed) {
if(pers3) { if(pers3) {
glhr::projection_multiply(glhr::frustum(current_display->tanfov, current_display->tanfov * cd->ysize / cd->xsize)); glhr::projection_multiply(glhr::frustum(current_display->tanfov, current_display->tanfov * cd->ysize / cd->xsize));
glhr::projection_multiply(glhr::scale(1, -1, -1)); glhr::projection_multiply(glhr::scale(1, -1, -1));
current_display->scrdist_text = cd->ysize;
} }
else if(DIM == 3) { else if(DIM == 3) {
glhr::glmatrix M = glhr::ortho(cd->xsize/current_display->radius/2, -cd->ysize/current_display->radius/2, 1); glhr::glmatrix M = glhr::ortho(cd->xsize/current_display->radius/2, -cd->ysize/current_display->radius/2, 1);
@@ -289,13 +287,11 @@ void display_data::set_projection(int ed) {
M[2][2] = 2 / (clip_max - clip_min); M[2][2] = 2 / (clip_max - clip_min);
M[3][2] = (clip_min + clip_max) / (clip_max - clip_min); M[3][2] = (clip_min + clip_max) / (clip_max - clip_min);
glhr::projection_multiply(M); glhr::projection_multiply(M);
current_display->scrdist_text = 0;
} }
else { else {
glhr::projection_multiply(glhr::frustum(cd->xsize / cd->ysize, 1)); glhr::projection_multiply(glhr::frustum(cd->xsize / cd->ysize, 1));
GLfloat sc = current_display->radius / (cd->ysize/2.); GLfloat sc = current_display->radius / (cd->ysize/2.);
glhr::projection_multiply(glhr::scale(sc, -sc, -1)); glhr::projection_multiply(glhr::scale(sc, -sc, -1));
current_display->scrdist_text = cd->ysize * sc / 2;
} }

View File

@@ -6356,7 +6356,6 @@ void calcparam() {
cd->scrdist = vid.xres / 2 / cd->tanfov; cd->scrdist = vid.xres / 2 / cd->tanfov;
else else
cd->scrdist = cd->radius; cd->scrdist = cd->radius;
cd->scrdist_text = cd->scrdist;
callhooks(hooks_calcparam); callhooks(hooks_calcparam);
reset_projection(); reset_projection();

View File

@@ -191,7 +191,7 @@ void glflush() {
glhr::color2(text_color); glhr::color2(text_color);
glhr::set_depthtest(false); glhr::set_depthtest(false);
for(int ed = (current_display->stereo_active() && text_shift)?-1:0; ed<2; ed+=2) { for(int ed = (current_display->stereo_active() && text_shift)?-1:0; ed<2; ed+=2) {
glhr::set_modelview(glhr::translate(-ed*text_shift-current_display->xcenter,-current_display->ycenter, current_display->scrdist_text)); glhr::set_modelview(glhr::translate(-ed*text_shift-current_display->xcenter,-current_display->ycenter, current_display->scrdist));
current_display->set_mask(ed); current_display->set_mask(ed);
glhr::current_vertices = NULL; glhr::current_vertices = NULL;