debug_tiles improvements: 2 displays more tile information, not displayed in standard except in cheat mode

This commit is contained in:
Zeno Rogue 2022-10-06 11:59:34 +02:00
parent 9004fdeee5
commit 6c88e9b2c3
3 changed files with 29 additions and 5 deletions

View File

@ -1940,7 +1940,7 @@ void celldrawer::check_rotations() {
}
}
EX bool debug_tiles;
EX int debug_tiles;
void celldrawer::bookkeeping() {
bool orig = false;
@ -2034,8 +2034,27 @@ void celldrawer::draw_cellstat() {
queuestr(V, 1 * .2, label, 0xFFFFFFFF, 1);
}
if(debug_tiles) {
string label = its(shvid(c));
if(debug_tiles && mod_allowed()) {
string label;
if(arb::in() && debug_tiles == 2) {
int id = shvid(c);
auto& sh = arb::current.shapes[id];
int oid = sh.orig_id;
label = its(oid);
if(c->master->emeraldval || sh.is_mirrored) label += 'M';
if(arb::current.was_split_for_football) label += "F" + its(sh.football_type);
}
else if(arcm::in() && debug_tiles == 2) {
int id = arcm::id_of(c->master);
int tid = arcm::current.tilegroup[id];
int tid2 = arcm::current.tilegroup[id^1];
bool mirrored = (id&1) && (tid != tid2);
if(tid2 >= 0) tid = min(tid, tid2);
label = its(tid);
if(mirrored) label += "M";
}
else
label = its(shvid(c));
queuestr(V, .5, label, 0xFFFFFFFF, 1);
for(int i=0; i<c->type; i++) {
queuestr(V * rgpushxto0(currentmap->get_corner(c, i, 4)), .2, its(i), 0xFFFFFFFF, 1);

View File

@ -2498,7 +2498,12 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
->set_reaction([] {
if(vid.highdetail > vid.middetail) vid.highdetail = vid.middetail;
});
param_b(debug_tiles, "debug_tiles");
param_i(debug_tiles, "debug_tiles")->editable(0, 2, 1,
"display tile debug values",
"Display cell type IDs, as well as vertex and edge identifiers.\n\n"
"Setting 1 uses the internal shape IDs, while setting 2 in tes files uses "
"the original IDs in case if extra tile types were added to "
"separate mirror images or different football types.", 'd');
addsaver(vid.gp_autoscale_heights, "3D Goldberg autoscaling", true);
addsaver(scorefile, "savefile");
param_b(savefile_selection, "savefile_selection")

View File

@ -436,7 +436,7 @@ EX string ncnames[5] = { "NO", "distance", "type", "debug", "error" };
EX eNumberCoding number_coding = ncDistance;
EX bool mod_allowed() {
return cheater || autocheat || arcm::in() || tour::on;
return cheater || autocheat || arcm::in() || arb::in() || tour::on;
}
EX int curr_dist(cell *c) {