From dd212d756b69d5cdc05b0fdb9d96b50f159a75f0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 24 Jun 2019 12:57:00 +0200 Subject: [PATCH] fixed the monster color in the minimap for Dragons etc --- config.cpp | 2 +- graph.cpp | 36 ++++++++++++++++++------------------ hud.cpp | 2 +- hyper.h | 4 +++- mapeditor.cpp | 4 ++-- racing.cpp | 6 +++--- shmup.cpp | 4 ++-- 7 files changed, 30 insertions(+), 28 deletions(-) diff --git a/config.cpp b/config.cpp index 6247a774..829c9b81 100644 --- a/config.cpp +++ b/config.cpp @@ -1598,7 +1598,7 @@ void showCustomizeChar() { double alpha = atan2(mousex - vid.xres/2, mousey - firsty) - M_PI/2; V = V * spin(alpha); - drawMonsterType(moPlayer, NULL, V, 0, cc_footphase / scale); + drawMonsterType(moPlayer, NULL, V, 0, cc_footphase / scale, NOCOLOR); quickqueue(); keyhandler = [] (int sym, int uni) { diff --git a/graph.cpp b/graph.cpp index 2a30e656..11fa2bbd 100644 --- a/graph.cpp +++ b/graph.cpp @@ -869,7 +869,7 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int pti if(!mmitem && it) return true; else if(it == itSavedPrincess) { - drawMonsterType(moPrincess, c, V, icol, 0); + drawMonsterType(moPrincess, c, V, icol, 0, icol); return false; } @@ -1316,11 +1316,11 @@ void drawMimic(eMonster m, cell *where, const transmatrix& V, color_t col, doubl } } -bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t col, double footphase) { +bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t col, double footphase, color_t asciicol) { #if MAXMDIM >= 4 - if(DIM == 3 && m != moPlayer) - addradar(V1, minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF); + if(DIM == 3 && m != moPlayer && asciicol != NOCOLOR) + addradar(V1, minf[m].glyph, asciicol, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF); #endif #if CAP_SHAPES @@ -2254,13 +2254,13 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V1, color_t col #endif } -bool drawMonsterTypeDH(eMonster m, cell *where, const transmatrix& V, color_t col, bool dh, ld footphase) { +bool drawMonsterTypeDH(eMonster m, cell *where, const transmatrix& V, color_t col, bool dh, ld footphase, color_t asciicol) { dynamicval p(poly_outline, poly_outline); if(dh) { poly_outline = OUTLINE_DEAD; darken++; } - bool b = drawMonsterType(m,where,V,col, footphase); + bool b = drawMonsterType(m,where,V,col, footphase, asciicol); if(dh) { darken--; } @@ -2381,7 +2381,7 @@ void drawWormSegments() { bool dont_face_pc = false; -bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool mirrored) { +bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool mirrored, color_t asciicol) { #if CAP_SHAPES bool darkhistory = conformal::includeHistory && conformal::inkillhistory.count(c); @@ -2424,7 +2424,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m if(isDragon(c->monst) && c->stuntime == 0) col = 0xFF6000; if(DIM == 3) - addradar(Vparam, minf[m].glyph, col, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF); + addradar(Vparam, minf[m].glyph, asciicol, isFriendly(m) ? 0x00FF00FF : 0xFF0000FF); transmatrix Vb0 = Vb; if(c->mondir != NODIR && DIM == 3 && isAnyIvy(c)) { @@ -2659,7 +2659,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m } if(!nospins && flipplayer) Vs = Vs * pispin; if(mmmon) { - drawMonsterType(moMimic, c, Vs, col, footphase); + drawMonsterType(moMimic, c, Vs, col, footphase, asciicol); drawPlayerEffects(Vs, c, false); } } @@ -2673,7 +2673,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m else if(c->monst == moIllusion) { multi::cpid = 0; if(c->monmirror) Vs = Vs * Mirror; - drawMonsterType(c->monst, c, Vs, col, footphase); + drawMonsterType(c->monst, c, Vs, col, footphase, asciicol); drawPlayerEffects(Vs, c, false); } @@ -2690,7 +2690,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m Vs = Vs * ddspin(c, d, 0); } if(c->monmirror) Vs = Vs * Mirror; - return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase); + return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase, asciicol); } else if(c->monst == moKrakenT) { @@ -2713,7 +2713,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m // if(ctof(c) && !masterless) Vb = Vb * xpush(hexhexdist - hcrossf); // return (!BITRUNCATED) ? tessf * gp::scale : (c->type == 6 && (i&1)) ? hexhexdist : cgi.crossf; - return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase); + return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase, asciicol); } // golems, knights, and hyperbugs don't face the player (mondir-controlled) @@ -2725,7 +2725,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m if(c->monst == moPair) Vs = Vs * xpush(-.12); if(c->monmirror) Vs = Vs * Mirror; if(isFriendly(c)) drawPlayerEffects(Vs, c, false); - return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase); + return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase, asciicol); } else { @@ -2751,7 +2751,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, bool m if(c->monst == moShadow) multi::cpid = c->hitpoints; - return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase); + return drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase, asciicol); } for(int i=0; imonst) onradar = false; #if CAP_SHAPES diff --git a/hud.cpp b/hud.cpp index 993a3c6a..c9da3a01 100644 --- a/hud.cpp +++ b/hud.cpp @@ -193,7 +193,7 @@ bool displayglyph(int cx, int cy, int buttonsize, char glyph, color_t color, int V[i][i] /= cgi.wormscale; int mcol = color; mcol -= (color & 0xFCFCFC) >> 2; - drawMonsterType(m, NULL, V, mcol, glyphphase[id]/500.0); + drawMonsterType(m, NULL, V, mcol, glyphphase[id]/500.0, NOCOLOR); } else { eItem it = eItem(id); diff --git a/hyper.h b/hyper.h index 3f49e9e9..49b4acf8 100644 --- a/hyper.h +++ b/hyper.h @@ -2095,7 +2095,7 @@ extern bool ivoryz; transmatrix face_the_player(const transmatrix V); void addradar(const transmatrix& V, char ch, color_t col, color_t outline); -bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase); +bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase, color_t asciicol); void drawPlayerEffects(const transmatrix& V, cell *c, bool onPlayer); @@ -5547,4 +5547,6 @@ void apply_memory_reserve(); void show_memory_menu(); static const int PSEUDOKEY_MEMORY = 16397; +static const color_t NOCOLOR = 0; + } \ No newline at end of file diff --git a/mapeditor.cpp b/mapeditor.cpp index f7128942..3fb3ad41 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1436,10 +1436,10 @@ namespace mapeditor { dynamicval ws(mmspatial, false); if(sg == 0) { - multi::cpid = id, drawMonsterType(moPlayer, drawcell, Id, 0xC0C0C0, 0); + multi::cpid = id, drawMonsterType(moPlayer, drawcell, Id, 0xC0C0C0, 0, 0xC0C0C0); } else if(sg == 1) { - drawMonsterType(eMonster(id), drawcell, Id, minf[id].color, 0); + drawMonsterType(eMonster(id), drawcell, Id, minf[id].color, 0, minf[id].color); } else if(sg == 2) { drawItemType(eItem(id), drawcell, Id, iinf[id].color, 0, false); diff --git a/racing.cpp b/racing.cpp index 3c3fb534..94d6df81 100644 --- a/racing.cpp +++ b/racing.cpp @@ -1207,11 +1207,11 @@ void draw_ghost_at(ghost& ghost, cell *w, const transmatrix& V, ghostmoment& p) dynamicval x(getcs(), ghost.cs); if(ghost.cs.charid == -1) { dynamicval pc(peace::on, true); - drawMonsterType(eMonster(ghost.cs.uicolor), w, V, ghost.cs.dresscolor, uchar_to_frac(p.footphase)); + drawMonsterType(eMonster(ghost.cs.uicolor), w, V, ghost.cs.dresscolor, uchar_to_frac(p.footphase), NOCOLOR); return; } - drawMonsterType(moPlayer, w, V, 0, uchar_to_frac(p.footphase)); + drawMonsterType(moPlayer, w, V, 0, uchar_to_frac(p.footphase), NOCOLOR); } bool ghost_finished(ghost& ghost) { @@ -1273,7 +1273,7 @@ void drawStats() { for(int i=0; i d(multi::cpid, i); - drawMonsterType(moPlayer, shmup::pc[i]->base, racerel(race_finish_tick[i] ? 100 : get_percentage(i)), 0xFFFFFFC0, shmup::pc[i]->footphase); + drawMonsterType(moPlayer, shmup::pc[i]->base, racerel(race_finish_tick[i] ? 100 : get_percentage(i)), 0xFFFFFFC0, shmup::pc[i]->footphase, NOCOLOR); } quickqueue(); diff --git a/shmup.cpp b/shmup.cpp index f92cf503..25d58384 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -3649,7 +3649,7 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans drawPlayerEffects(view, c, true); if(WDIM == 3) view = view * spin(-M_PI/2) * cspin(0, 2, -M_PI/2); 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, 0xFFFFFFC0); } if(ths && h) first_cell_to_draw = false; @@ -3751,7 +3751,7 @@ bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, trans /* else if(DIM == 3) drawMonsterType(m->type, c, view * cspin(0, 2, M_PI/2), col, m->footphase); */ /* else */ - drawMonsterType(m->type, c, view, col, m->footphase); + drawMonsterType(m->type, c, view, col, m->footphase, col); if(m->type == moTortoise) tortoise::emap.erase(c); break; }