mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-26 17:06:59 +00:00
3d:: refactored the hide_player function
This commit is contained in:
parent
9f9670fcdb
commit
55c31ec645
@ -14,6 +14,10 @@ bool mmspatial, mmhigh, mmmon, mmitem;
|
|||||||
|
|
||||||
int detaillevel = 0;
|
int detaillevel = 0;
|
||||||
|
|
||||||
|
bool hide_player() {
|
||||||
|
return DIM == 3 && playermoved && vid.yshift == 0 && vid.sspeed > -5;
|
||||||
|
}
|
||||||
|
|
||||||
hookset<bool(int sym, int uni)> *hooks_handleKey;
|
hookset<bool(int sym, int uni)> *hooks_handleKey;
|
||||||
hookset<bool(cell *c, const transmatrix& V)> *hooks_drawcell;
|
hookset<bool(cell *c, const transmatrix& V)> *hooks_drawcell;
|
||||||
purehookset hooks_frame, hooks_markers;
|
purehookset hooks_frame, hooks_markers;
|
||||||
@ -2332,8 +2336,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) {
|
|||||||
drawPlayerEffects(Vs, c, true);
|
drawPlayerEffects(Vs, c, true);
|
||||||
if(!mmmon) return true;
|
if(!mmmon) return true;
|
||||||
|
|
||||||
if(DIM == 3 && playermoved && vid.sspeed > -5 && vid.yshift == 0) {
|
if(hide_player()) {
|
||||||
/* FPP -- do not draw the player */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(isWorm(m)) {
|
else if(isWorm(m)) {
|
||||||
@ -3888,7 +3891,7 @@ int get_darkval(int d) {
|
|||||||
|
|
||||||
void drawBoat(cell *c, const transmatrix* Vboat, transmatrix& Vboat0, transmatrix& V) {
|
void drawBoat(cell *c, const transmatrix* Vboat, transmatrix& Vboat0, transmatrix& V) {
|
||||||
double footphase;
|
double footphase;
|
||||||
if(c == cwt.at && playermoved && vid.sspeed > -5 && vid.yshift == 0) return;
|
if(c == cwt.at && hide_player()) return;
|
||||||
bool magical = items[itOrbWater] && (isPlayerOn(c) || (isFriendly(c) && items[itOrbEmpathy]));
|
bool magical = items[itOrbWater] && (isPlayerOn(c) || (isFriendly(c) && items[itOrbEmpathy]));
|
||||||
int outcol = magical ? watercolor(0) : 0xC06000FF;
|
int outcol = magical ? watercolor(0) : 0xC06000FF;
|
||||||
int incol = magical ? 0x0060C0FF : 0x804000FF;
|
int incol = magical ? 0x0060C0FF : 0x804000FF;
|
||||||
|
1
hyper.h
1
hyper.h
@ -3226,6 +3226,7 @@ bool haveMobileCompass();
|
|||||||
bool handleCompass();
|
bool handleCompass();
|
||||||
|
|
||||||
inline bool sphereflipped() { return sphere && vid.alpha > 1.1 && DIM == 3; }
|
inline bool sphereflipped() { return sphere && vid.alpha > 1.1 && DIM == 3; }
|
||||||
|
bool hide_player();
|
||||||
int cellcolor(cell *c);
|
int cellcolor(cell *c);
|
||||||
transmatrix screenpos(ld x, ld y);
|
transmatrix screenpos(ld x, ld y);
|
||||||
extern ld backbrightness;
|
extern ld backbrightness;
|
||||||
|
@ -3463,12 +3463,14 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans
|
|||||||
switch(m->type) {
|
switch(m->type) {
|
||||||
case moPlayer:
|
case moPlayer:
|
||||||
playerfound = true;
|
playerfound = true;
|
||||||
if(playermoved && DIM == 3 && vid.yshift == 0 && vid.sspeed > -5) continue;
|
|
||||||
cpid = m->pid;
|
cpid = m->pid;
|
||||||
|
|
||||||
|
if(!hide_player()) {
|
||||||
if(DIM == 3) view = view * spin(-M_PI/2);
|
if(DIM == 3) view = view * spin(-M_PI/2);
|
||||||
drawPlayerEffects(view, c, true);
|
drawPlayerEffects(view, c, true);
|
||||||
if(m->inBoat) m->footphase = 0;
|
if(m->inBoat) m->footphase = 0;
|
||||||
if(mapeditor::drawplayer) drawMonsterType(moPlayer, c, view, 0xFFFFFFC0, m->footphase);
|
if(mapeditor::drawplayer) drawMonsterType(moPlayer, c, view, 0xFFFFFFC0, m->footphase);
|
||||||
|
}
|
||||||
|
|
||||||
if(keyresult[cpid]) {
|
if(keyresult[cpid]) {
|
||||||
hyperpoint h = keytarget(cpid);
|
hyperpoint h = keytarget(cpid);
|
||||||
|
Loading…
Reference in New Issue
Block a user