summaryrefslogtreecommitdiff
path: root/plugins/probe.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-04-19 19:17:07 +0400
committerKelly Martin2012-04-26 12:21:59 -0500
commitb4a8bcd8d02f0277d21e1da2c26201a48ccd559b (patch)
treeb95bc9a14bef44a65520aff99872e4ff00628a35 /plugins/probe.cpp
parent5f5152f4498722d61e7c9c7f207ef3b5dfbda84c (diff)
downloaddfhack-b4a8bcd8d02f0277d21e1da2c26201a48ccd559b.tar.gz
dfhack-b4a8bcd8d02f0277d21e1da2c26201a48ccd559b.tar.bz2
dfhack-b4a8bcd8d02f0277d21e1da2c26201a48ccd559b.tar.xz
Refactor MapCache: make it parse everything that is known re tiles & mats.
Conflicts: library/xml
Diffstat (limited to 'plugins/probe.cpp')
-rw-r--r--plugins/probe.cpp58
1 files changed, 37 insertions, 21 deletions
diff --git a/plugins/probe.cpp b/plugins/probe.cpp
index 06b1f968..f7430af2 100644
--- a/plugins/probe.cpp
+++ b/plugins/probe.cpp
@@ -103,6 +103,30 @@ command_result df_cprobe (color_ostream &out, vector <string> & parameters)
return CR_OK;
}
+void describeTile(color_ostream &out, df::tiletype tiletype)
+{
+ out.print("%d", tiletype);
+ if(tileName(tiletype))
+ out.print(" = %s",tileName(tiletype));
+ out.print("\n");
+
+ df::tiletype_shape shape = tileShape(tiletype);
+ df::tiletype_material material = tileMaterial(tiletype);
+ df::tiletype_special special = tileSpecial(tiletype);
+ df::tiletype_variant variant = tileVariant(tiletype);
+ out.print("%-10s: %4d %s\n","Class" ,shape,
+ ENUM_KEY_STR(tiletype_shape, shape).c_str());
+ out.print("%-10s: %4d %s\n","Material" ,
+ material, ENUM_KEY_STR(tiletype_material, material).c_str());
+ out.print("%-10s: %4d %s\n","Special" ,
+ special, ENUM_KEY_STR(tiletype_special, special).c_str());
+ out.print("%-10s: %4d %s\n" ,"Variant" ,
+ variant, ENUM_KEY_STR(tiletype_variant, variant).c_str());
+ out.print("%-10s: %s\n" ,"Direction",
+ tileDirection(tiletype).getStr());
+ out.print("\n");
+}
+
command_result df_probe (color_ostream &out, vector <string> & parameters)
{
//bool showBlock, showDesig, showOccup, showTile, showMisc;
@@ -186,26 +210,12 @@ command_result df_probe (color_ostream &out, vector <string> & parameters)
*/
// tiletype
- out.print("tiletype: %d", tiletype);
- if(tileName(tiletype))
- out.print(" = %s",tileName(tiletype));
- out.print("\n");
-
- df::tiletype_shape shape = tileShape(tiletype);
- df::tiletype_material material = tileMaterial(tiletype);
- df::tiletype_special special = tileSpecial(tiletype);
- df::tiletype_variant variant = tileVariant(tiletype);
- out.print("%-10s: %4d %s\n","Class" ,shape,
- ENUM_KEY_STR(tiletype_shape, shape).c_str());
- out.print("%-10s: %4d %s\n","Material" ,
- material, ENUM_KEY_STR(tiletype_material, material).c_str());
- out.print("%-10s: %4d %s\n","Special" ,
- special, ENUM_KEY_STR(tiletype_special, special).c_str());
- out.print("%-10s: %4d %s\n" ,"Variant" ,
- variant, ENUM_KEY_STR(tiletype_variant, variant).c_str());
- out.print("%-10s: %s\n" ,"Direction",
- tileDirection(tiletype).getStr());
- out.print("\n");
+ out.print("tiletype: ");
+ describeTile(out, tiletype);
+ out.print("static: ");
+ describeTile(out, mc.staticTiletypeAt(cursor));
+ out.print("base: ");
+ describeTile(out, mc.baseTiletypeAt(cursor));
out.print("temperature1: %d U\n",mc.temperature1At(cursor));
out.print("temperature2: %d U\n",mc.temperature2At(cursor));
@@ -232,7 +242,7 @@ command_result df_probe (color_ostream &out, vector <string> & parameters)
"evilness " << biome->evilness << ")" << std::endl;
out << "geolayer: " << des.bits.geolayer_index
<< std::endl;
- int16_t base_rock = mc.baseMaterialAt(cursor);
+ int16_t base_rock = mc.layerMaterialAt(cursor);
if(base_rock != -1)
{
out << "Layer material: " << dec << base_rock;
@@ -256,6 +266,12 @@ command_result df_probe (color_ostream &out, vector <string> & parameters)
else
out << endl;
}
+ MaterialInfo minfo(mc.baseMaterialAt(cursor));
+ if (minfo.isValid())
+ out << "Base material: " << minfo.getToken() << " / " << minfo.toString() << endl;
+ minfo.decode(mc.staticMaterialAt(cursor));
+ if (minfo.isValid())
+ out << "Static material: " << minfo.getToken() << " / " << minfo.toString() << endl;
// liquids
if(des.bits.flow_size)
{