labels are no longer displayed behind the sphere

This commit is contained in:
Zeno Rogue 2018-04-22 11:11:47 +02:00
parent b5a84e9a4b
commit ff9051426a
3 changed files with 6 additions and 3 deletions

View File

@ -3668,7 +3668,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
queuestr(V, 1 * .2, label, 0xFFFFFFFF, 1);
}
if(viewdists) {
if(viewdists && !behindsphere(V)) {
int cd = (cwt.c == currentmap->gamestart() && numplayers() == 1) ? celldist(c) : celldistance(c, cwt.c);
string label = its(cd);
// string label = its(fieldpattern::getriverdistleft(c)) + its(fieldpattern::getriverdistright(c));

View File

@ -434,12 +434,14 @@ double zgrad0(double l1, double l2, int nom, int den) {
bool behindsphere(const hyperpoint& h) {
if(!sphere) return false;
if(mdBandAny()) return false;
if(vid.alpha > 1) {
if(h[2] > -1/vid.alpha) return true;
}
if(vid.alpha <= 1) {
if(h[2] < -.8) return true;
if(h[2] < .2-vid.alpha) return true;
}
return false;

View File

@ -1135,7 +1135,8 @@ void drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
hyperpoint h = tC0(V * m->at);
transmatrix V2 = rgpushxto0(h) * ypush(nonbitrunc ? .3 : .2);
if(doshow) queuestr(V2, (svg::in ? .28 : .2) * crossf / hcrossf, vd.name, backcolor ? 0x000000 : 0xFFFF00, svg::in ? 0 : 1);
if(doshow && !behindsphere(V2))
queuestr(V2, (svg::in ? .28 : .2) * crossf / hcrossf, vd.name, backcolor ? 0x000000 : 0xFFFF00, svg::in ? 0 : 1);
lastptd().info = vd.info;
}