1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 04:37:10 +00:00

realradius

This commit is contained in:
Zeno Rogue
2017-11-07 13:40:56 +01:00
parent d467b060bd
commit 800a37f646
4 changed files with 15 additions and 8 deletions

View File

@@ -773,8 +773,16 @@ int colormix(int a, int b, int c) {
int rhypot(int a, int b) { return (int) sqrt(a*a - b*b); }
ld realradius() {
ld vradius = vid.radius;
if(sphere && vid.alphax > 1) vradius /= sqrt(vid.alphax*vid.alphax - 1);
if(sphere && vid.alphax <= 1) vradius = 1e12; // use the following
vradius = min<ld>(vradius, min(vid.xres, vid.yres) / 2);
return vradius;
}
void drawmessage(const string& s, int& y, int col) {
int rrad = min(vid.radius, min(vid.xres, vid.yres) / 2);
int rrad = (int) realradius();
int space;
if(y > vid.ycenter + rrad)
space = vid.xres;