From 4b7e0d3c56f37981373ea988f24a2cd04ea604ae Mon Sep 17 00:00:00 2001 From: JapaMala Date: Wed, 26 Dec 2018 00:11:08 -0600 Subject: [PATCH] Convert unicode to escaped characters, and some formatting niceness --- .../remotefortressreader.cpp | 274 +++++++++--------- 1 file changed, 137 insertions(+), 137 deletions(-) diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 83856ba7d..45f6a1846 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -258,19 +258,19 @@ command_result dump_bp_mods(color_ostream &out, vector & parameters) command_result Dump_Trees(color_ostream &out, vector ¶meters) { char filename[255]; - for(int columnIndex = 0; columnIndex < world->map.map_block_columns.size(); columnIndex++) + for (int columnIndex = 0; columnIndex < world->map.map_block_columns.size(); columnIndex++) { auto column = world->map.map_block_columns[columnIndex]; - if(!column) + if (!column) continue; - if(column->plants.size() == 0) + if (column->plants.size() == 0) continue; - for(int plantIndex = 0; plantIndex < column->plants.size(); plantIndex++) + for (int plantIndex = 0; plantIndex < column->plants.size(); plantIndex++) { auto plant = column->plants[plantIndex]; - if(!plant) + if (!plant) continue; - if(!plant->tree_info) + if (!plant->tree_info) continue; sprintf(filename, "plant_%03d,%03d,%03d.txt", plant->pos.z, plant->pos.y, plant->pos.x); remove(filename); @@ -280,11 +280,11 @@ command_result Dump_Trees(color_ostream &out, vector ¶meters) output << "Material: " << plant->material << endl; output << "Grow Counter: " << plant->grow_counter << endl; output << "Damage Flags: "; - if(plant->damage_flags.bits.is_burning) + if (plant->damage_flags.bits.is_burning) output << "is_burning, "; - if(plant->damage_flags.bits.is_drowning) + if (plant->damage_flags.bits.is_drowning) output << "is_drowning, "; - if(plant->damage_flags.bits.anon_1) + if (plant->damage_flags.bits.anon_1) output << "anon_1, "; output << endl; output << "HP: " << plant->hitpoints << endl; @@ -295,192 +295,192 @@ command_result Dump_Trees(color_ostream &out, vector ¶meters) output << "Dim X: " << treeInfo->dim_x << endl; output << "Dim Y: " << treeInfo->dim_y << endl; output << "Dim Z: " << treeInfo->body_height << endl; - for(int z = 0; z < treeInfo->body_height; z++) + for (int z = 0; z < treeInfo->body_height; z++) { - for(int y = -1; y < treeInfo->dim_y; y++) + for (int y = -1; y < treeInfo->dim_y; y++) { - for(int x = -1; x < treeInfo->dim_x; x++) + for (int x = -1; x < treeInfo->dim_x; x++) { - if(x < 0) + if (x < 0) { - if(y < 0) + if (y < 0) { output << " "; continue; } - output << y%9; + output << y % 9; continue; } - if(y < 0) + if (y < 0) { - output << x%9; + output << x % 9; continue; } auto tile = treeInfo->body[z][x + treeInfo->dim_x*y]; - if(tile.bits.blocked) + if (tile.bits.blocked) output << "x"; - else if(tile.bits.twigs) - output << "░"; - else if(tile.bits.branches) + else if (tile.bits.twigs) + output << "\u2591"; + else if (tile.bits.branches) { - if(tile.bits.connection_east)// East Connection + if (tile.bits.connection_east)// East Connection { - if(tile.bits.connection_south) // South Connection + if (tile.bits.connection_south) // South Connection { - if(tile.bits.connection_west) // West Connection + if (tile.bits.connection_west) // West Connection { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╬"; - else - output << "┼"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u256c"; + else + output << "\u253c"; + } else - { - if(tile.bits.trunk) - output << "╦"; - else - output << "┬"; - } + { + if (tile.bits.trunk) + output << "\u2566"; + else + output << "\u252c"; + } } else { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╠"; - else - output << "├"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u2560"; + else + output << "\u251c"; + } else - { - if(tile.bits.trunk) - output << "╔"; - else - output << "┌"; - } + { + if (tile.bits.trunk) + output << "\u2554"; + else + output << "\u250c"; + } } } else { - if(tile.bits.connection_west) // West Connection + if (tile.bits.connection_west) // West Connection { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╩"; - else - output << "┴"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u2569"; + else + output << "\u2534"; + } else - { - if(tile.bits.trunk) - output << "═"; - else - output << "─"; - } + { + if (tile.bits.trunk) + output << "\u2550"; + else + output << "\u2500"; + } } else { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╚"; - else - output << "└"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u255a"; + else + output << "\u2514"; + } else - { - if(tile.bits.trunk) - output << "╞"; - else - output << ">"; - } + { + if (tile.bits.trunk) + output << "\u255e"; + else + output << ">"; + } } } } else { - if(tile.bits.connection_south) // South Connection + if (tile.bits.connection_south) // South Connection { - if(tile.bits.connection_west) // West Connection + if (tile.bits.connection_west) // West Connection { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╣"; - else - output << "┤"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u2563"; + else + output << "\u2524"; + } else - { - if(tile.bits.trunk) - output << "╗"; - else - output << "┐"; - } + { + if (tile.bits.trunk) + output << "\u2557"; + else + output << "\u2510"; + } } else { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "║"; - else - output << "│"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u2551"; + else + output << "\u2502"; + } else - { - if(tile.bits.trunk) - output << "╥"; - else - output << "v"; - } + { + if (tile.bits.trunk) + output << "\u2565"; + else + output << "v"; + } } } else { - if(tile.bits.connection_west) // West Connection + if (tile.bits.connection_west) // West Connection { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╝"; - else - output << "┘"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u255d"; + else + output << "\u2518"; + } else - { - if(tile.bits.trunk) - output << "╡"; - else - output << "<"; - } + { + if (tile.bits.trunk) + output << "\u2561"; + else + output << "<"; + } } else { - if(tile.bits.connection_north) // North Connection - { - if(tile.bits.trunk) - output << "╨"; - else - output << "^"; - } + if (tile.bits.connection_north) // North Connection + { + if (tile.bits.trunk) + output << "\u2568"; + else + output << "^"; + } else - { - if(tile.bits.trunk) - output << "o"; - else - output << "▒"; - } + { + if (tile.bits.trunk) + output << "o"; + else + output << "\u2592"; + } } } } } - else if(tile.bits.trunk) + else if (tile.bits.trunk) output << "O"; - else if(tile.whole > 0) + else if (tile.whole > 0) output << +tile.whole; else output << " "; @@ -519,13 +519,13 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector flows.size() > 0) nonAir = true; if (nonAir || firstBlock)