From a1cbf8c90638655c0dde0335ffdcc777ece89016 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 6 Oct 2022 13:47:00 +0200 Subject: [PATCH] minecolors and distcolors now accept less/more colors in table --- celldrawer.cpp | 26 +++++++++----------------- expansion.cpp | 3 --- graph.cpp | 4 ++-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/celldrawer.cpp b/celldrawer.cpp index 017e5e2f..2771e2e0 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -1615,14 +1615,14 @@ void celldrawer::draw_features() { if(numerical_minefield) { if(mines) { string label = its(mines); - queuestr(V, mines >= 10 ? .5 : 1, label, darkened(minecolors[mines%10]), 8); + queuestr(V, mines >= 10 ? .5 : 1, label, darkened(minecolors[mines]), 8); } } else { - if(mines >= 10) - queuepoly(V, cgi.shBigMineMark[ct6], darkena(minecolors[(mines/10) % 10], 0, 0xFF)); + if(mines >= isize(minecolors)) + queuepoly(V, cgi.shBigMineMark[ct6], darkena(minecolors[mines/isize(minecolors)], 0, 0xFF)); if(mines) - queuepoly(V, cgi.shMineMark[ct6], darkena(minecolors[mines%10], 0, 0xFF)); + queuepoly(V, cgi.shMineMark[ct6], darkena(minecolors[mines], 0, 0xFF)); } break; } @@ -1833,9 +1833,9 @@ void celldrawer::draw_features_and_walls_3d() { } else { int mines = countMinesAround(c); - if(mines >= 10) - queuepoly(face_the_player(V), cgi.shBigMineMark[0], darkena(minecolors[(mines/10)%10], 0, 0xFF)); - queuepoly(face_the_player(V), cgi.shMineMark[0], darkena(minecolors[mines%10], 0, 0xFF)); + if(mines >= isize(minecolors)) + queuepoly(face_the_player(V), cgi.shBigMineMark[0], darkena(minecolors[mines/isize(minecolors)], 0, 0xFF)); + queuepoly(face_the_player(V), cgi.shMineMark[0], darkena(minecolors[mines], 0, 0xFF)); } } @@ -2326,10 +2326,10 @@ void celldrawer::draw_wall_full() { int mines = countMinesAround(c); if(asciichar == '.') { if(mines == 0) asciichar = ' '; - else asciichar = '0' + mines, asciicol = minecolors[mines%10]; + else asciichar = '0' + mines, asciicol = minecolors[mines]; } else if(asciichar == '@') { - asciicol = minecolors[mines%10]; + asciicol = minecolors[mines]; } } if(wmascii && !((c->item && !itemHiddenFromSight(c)) || c->monst || c->cpdist == 0)) error = true; @@ -2740,15 +2740,7 @@ void celldrawer::draw() { return; } - // color_t col = 0xFFFFFF - 0x20 * c->maxdist - 0x2000 * c->cpdist; - if(!buggyGeneration && c->mpdist > 8 && !cheater && !autocheat) return; // not yet generated - /* if(!buggyGeneration && c->mpdist > 7 && !cheater) { - int cd = c->mpdist; - string label = its(cd); - int dc = distcolors[cd&7]; - queuestr(V, (cd > 9 ? .6 : 1) * .2, label, 0xFF000000 + dc, 1); - } */ #if CAP_SHAPES ct6 = ctof(c); diff --git a/expansion.cpp b/expansion.cpp index b398f176..bbad8efe 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -625,9 +625,6 @@ void celldrawer::do_viewdist() { if(!dist_label_colored) dc = dist_label_color; - // string label = its(fieldpattern::getriverdistleft(c)) + its(fieldpattern::getriverdistright(c)); - /* queuepolyat(V, shFloor[ct6], darkena(gradient(0, distcolors[cd&7], 0, .25, 1), fd, 0xC0), - PPR::TEXT); */ if(label != "") queuestr(V, (isize(label) > 1 ? .6 : 1), label, 0xFF000000 + dc, 1); } diff --git a/graph.cpp b/graph.cpp index e442d566..a2fa3772 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5783,7 +5783,7 @@ EX void drawscreen() { if((minefieldNearby || tmines) && !items[itOrbAether] && !last_gravity_state && darken == 0 && normal) { string s; if(tmines > 9) tmines = 9; - color_t col = minecolors[tmines%10]; + color_t col = minecolors[tmines]; if(tmines == 7) seenSevenMines = true; @@ -5791,7 +5791,7 @@ EX void drawscreen() { displayfr(vid.xres * (p+.5) / numplayers(), current_display->ycenter - current_display->radius * 3/4, 2, vid.fsize, - mines[p] > 7 ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]%10], 8); + mines[p] > 7 ? its(mines[p]) : XLAT(minetexts[mines[p]]), minecolors[mines[p]], 8); if(minefieldNearby && !shmup::on && cwt.at->land != laMinefield && cwt.peek()->land != laMinefield && !dont_display_minecount) { displayfr(vid.xres/2, current_display->ycenter - current_display->radius * 3/4 - vid.fsize*3/2, 2,