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

3D:: fixed the radar in 3D to use the 3D version

This commit is contained in:
Zeno Rogue 2019-05-13 13:19:58 +02:00
parent 653e0cd442
commit 8858b137b5

View File

@ -353,6 +353,8 @@ bool nofps = false;
void draw_radar(bool cornermode) {
bool d3 = WDIM == 3;
dynamicval<eGeometry> g(geometry, gEuclid);
dynamicval<eModel> pm(pmodel, mdUnchanged);
dynamicval<bool> ga(geom3::always3, false);
@ -366,7 +368,7 @@ void draw_radar(bool cornermode) {
curvepoint(atscreenpos(cx-cos(i * degree)*rad, cy-sin(i*degree)*rad, 1) * C0);
queuecurve(0xFFFFFFFF, 0x000000FF, PPR::ZERO);
if(WDIM == 3) {
if(d3) {
for(int i=0; i<360; i++)
curvepoint(atscreenpos(cx-cos(i * degree)*rad, cy-sin(i*degree)*rad/3, 1) * C0);
queuecurve(0xFF0000FF, 0x200000FF, PPR::ZERO);
@ -377,7 +379,7 @@ void draw_radar(bool cornermode) {
queuecurve(0xFF8000FF, 0, PPR::ZERO);
}
if(WDIM == 3) for(auto& r: radarpoints) {
if(d3) for(auto& r: radarpoints) {
queueline(atscreenpos(cx+rad * r.h[0], cy - rad * r.h[2]/3 + rad * r.h[1]*2/3, 0)*C0, atscreenpos(cx+rad*r.h[0], cy - rad*r.h[2]/3, 0)*C0, r.line, -1);
}
@ -385,7 +387,7 @@ void draw_radar(bool cornermode) {
glflush();
for(auto& r: radarpoints)
if(WDIM == 3) displaychr(int(cx + rad * r.h[0]), int(cy - rad * r.h[2]/3 + rad * r.h[1]*2/3), 0, 8, r.glyph, r.color);
if(d3) displaychr(int(cx + rad * r.h[0]), int(cy - rad * r.h[2]/3 + rad * r.h[1]*2/3), 0, 8, r.glyph, r.color);
else {
int siz = 1/(1+r.h[3]) * scalefactor * current_display->radius / (inHighQual ? 10 : 6);
displaychr(int(cx + rad * r.h[0]), int(cy - rad * r.h[1]), 0, siz, r.glyph, r.color);