summaryrefslogtreecommitdiff
path: root/plugins/mapexport
diff options
context:
space:
mode:
authorMike Stewart2012-01-30 21:12:35 -0800
committerMike Stewart2012-01-30 21:12:35 -0800
commit5c550b9e2f61851121233cbf7d1d22a40d117917 (patch)
treede52f4f8eb276b73f3135aa6f83823b8e07b2e22 /plugins/mapexport
parentdcc02506b76ac9fa5523a4ca360d2fba6e046e56 (diff)
downloaddfhack-5c550b9e2f61851121233cbf7d1d22a40d117917.tar.gz
dfhack-5c550b9e2f61851121233cbf7d1d22a40d117917.tar.bz2
dfhack-5c550b9e2f61851121233cbf7d1d22a40d117917.tar.xz
Made mapexport put out some (but certainly not all) tile materials.
Diffstat (limited to 'plugins/mapexport')
-rw-r--r--plugins/mapexport/mapexport.cpp27
-rw-r--r--plugins/mapexport/proto/Tile.proto29
2 files changed, 53 insertions, 3 deletions
diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp
index 6d82735f..67778d24 100644
--- a/plugins/mapexport/mapexport.cpp
+++ b/plugins/mapexport/mapexport.cpp
@@ -161,6 +161,33 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
uint16_t type = b->TileTypeAt(coord);
const DFHack::TileRow *info = DFHack::getTileRow(type);
prototile->set_type((dfproto::Tile::TileType)info->shape);
+
+ prototile->set_material_type((dfproto::Tile::MaterialType)info->material);
+ switch (info->material)
+ {
+ case DFHack::SOIL:
+ case DFHack::STONE:
+ prototile->set_material(b->baseMaterialAt(coord));
+ break;
+ case DFHack::VEIN:
+ prototile->set_material(b->veinMaterialAt(coord));
+ break;
+ case DFHack::FEATSTONE:
+ if (blockFeatureLocal.type != -1 && des.bits.feature_local)
+ {
+ if (blockFeatureLocal.type == df::feature_type::deep_special_tube
+ && blockFeatureLocal.main_material == 0) // stone
+ {
+ prototile->set_material(blockFeatureLocal.sub_material);
+ }
+ if (blockFeatureGlobal.type != -1 && des.bits.feature_global
+ && blockFeatureGlobal.type == df::feature_type::feature_underworld_from_layer
+ && blockFeatureGlobal.main_material == 0) // stone
+ {
+ prototile->set_material(blockFeatureGlobal.sub_material);
+ }
+ }
+ }
}
}
coded_output->WriteVarint32(protoblock.ByteSize());
diff --git a/plugins/mapexport/proto/Tile.proto b/plugins/mapexport/proto/Tile.proto
index b2de1c3a..082896c2 100644
--- a/plugins/mapexport/proto/Tile.proto
+++ b/plugins/mapexport/proto/Tile.proto
@@ -34,10 +34,33 @@ message Tile
WATER = 0;
MAGMA = 1;
}
+ enum MaterialType
+ {
+ AIR = 0;
+ SOIL = 1;
+ STONE = 2;
+ FEATSTONE = 3;
+ OBSIDIAN = 4;
+ VEIN = 5;
+ ICE = 6;
+ GRASS = 7;
+ GRASS2 = 8;
+ GRASS_DEAD = 9;
+ GRASS_DRY = 10;
+ DRIFTWOOD = 11;
+ HFS = 12;
+ MAGMA_TYPE = 13;
+ CAMPFIRE = 14;
+ FIRE = 15;
+ ASHES = 16;
+ CONSTRUCTED = 17;
+ CYAN_GLOW = 18;
+ }
required uint32 x = 1;
required uint32 y = 2;
required TileType type = 3;
- optional uint32 material = 4;
- optional LiquidType liquid_type = 5;
- optional uint32 flow_size = 6;
+ optional MaterialType material_type = 4;
+ optional uint32 material = 5;
+ optional LiquidType liquid_type = 6;
+ optional uint32 flow_size = 7;
}