1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-18 14:35:47 +00:00

improved rogueviz image scaling

This commit is contained in:
Zeno Rogue 2024-08-01 12:47:31 +02:00
parent a6870750dc
commit b49266cbce

View File

@ -119,13 +119,8 @@ colorpair parse(string s) {
y -= 8; y -= 8;
x /= 16.; x /= 16.;
y /= 16.; y /= 16.;
ld r = max(abs(x), abs(y)) / hypot(x, y);
if(x || y) {
x *= r;
y *= r;
}
i.tinf.tvertices.push_back(glhr::makevertex(x + .5, y + .5, 0)); i.tinf.tvertices.push_back(glhr::makevertex(x + .5, y + .5, 0));
i.vertices.push_back(hpxy(x * .4, y * .4)); i.vertices.push_back(hpxy(x * .5 * cgi.scalefactor, y * .5 * cgi.scalefactor));
}; };
addv(x, y); addv(x, y);
addv(x, y+1); addv(x, y+1);