summaryrefslogtreecommitdiff
path: root/plugins/mapexport
diff options
context:
space:
mode:
authorMike Stewart2012-02-12 18:39:43 -0800
committerMike Stewart2012-02-12 18:39:43 -0800
commit1b3d517a6199816dbc23da2238d9261f65d12326 (patch)
tree15e5a0209623307d2caaa63f0da30a5a459356aa /plugins/mapexport
parente39852ff2e74b0157d34a7db98d5d6b17b09d9e1 (diff)
downloaddfhack-1b3d517a6199816dbc23da2238d9261f65d12326.tar.gz
dfhack-1b3d517a6199816dbc23da2238d9261f65d12326.tar.bz2
dfhack-1b3d517a6199816dbc23da2238d9261f65d12326.tar.xz
Fixed material output -- material_type and material_index were being used backwards.
Diffstat (limited to 'plugins/mapexport')
-rw-r--r--plugins/mapexport/mapexport.cpp24
-rw-r--r--plugins/mapexport/proto/Material.proto2
-rw-r--r--plugins/mapexport/proto/Tile.proto6
3 files changed, 16 insertions, 16 deletions
diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp
index 5053a3a6..c0c5f43e 100644
--- a/plugins/mapexport/mapexport.cpp
+++ b/plugins/mapexport/mapexport.cpp
@@ -119,14 +119,14 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
for (size_t i = 0; i < world->raws.inorganics.size(); i++)
{
dfproto::Material *protomaterial = protomap.add_inorganic_material();
- protomaterial->set_type(i);
+ protomaterial->set_index(i);
protomaterial->set_name(world->raws.inorganics[i]->id);
}
for (size_t i = 0; i < world->raws.plants.all.size(); i++)
{
dfproto::Material *protomaterial = protomap.add_organic_material();
- protomaterial->set_type(i);
+ protomaterial->set_index(i);
protomaterial->set_name(world->raws.plants.all[i]->id);
}
@@ -210,7 +210,7 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
const DFHack::TileRow *info = DFHack::getTileRow(type);
prototile->set_type((dfproto::Tile::TileType)info->shape);
- prototile->set_material_type((dfproto::Tile::MaterialType)info->material);
+ prototile->set_tile_material((dfproto::Tile::TileMaterialType)info->material);
df::coord map_pos = df::coord(b_x*16+x,b_y*16+y,z);
@@ -218,12 +218,12 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
{
case DFHack::SOIL:
case DFHack::STONE:
- prototile->set_material_index(0);
- prototile->set_material(b->baseMaterialAt(coord));
+ prototile->set_material_type(0);
+ prototile->set_material_index(b->baseMaterialAt(coord));
break;
case DFHack::VEIN:
- prototile->set_material_index(0);
- prototile->set_material(b->veinMaterialAt(coord));
+ prototile->set_material_type(0);
+ prototile->set_material_index(b->veinMaterialAt(coord));
break;
case DFHack::FEATSTONE:
if (blockFeatureLocal.type != -1 && des.bits.feature_local)
@@ -231,15 +231,15 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
if (blockFeatureLocal.type == df::feature_type::deep_special_tube
&& blockFeatureLocal.main_material == 0) // stone
{
- prototile->set_material_index(0);
- prototile->set_material(blockFeatureLocal.sub_material);
+ prototile->set_material_type(0);
+ prototile->set_material_index(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_index(0);
- prototile->set_material(blockFeatureGlobal.sub_material);
+ prototile->set_material_type(0);
+ prototile->set_material_index(blockFeatureGlobal.sub_material);
}
}
break;
@@ -247,7 +247,7 @@ DFhackCExport command_result mapexport (Core * c, std::vector <std::string> & pa
if (constructionMaterials.find(map_pos) != constructionMaterials.end())
{
prototile->set_material_index(constructionMaterials[map_pos].first);
- prototile->set_material(constructionMaterials[map_pos].second);
+ prototile->set_material_type(constructionMaterials[map_pos].second);
}
break;
}
diff --git a/plugins/mapexport/proto/Material.proto b/plugins/mapexport/proto/Material.proto
index af8ebcd4..526f379b 100644
--- a/plugins/mapexport/proto/Material.proto
+++ b/plugins/mapexport/proto/Material.proto
@@ -3,6 +3,6 @@ option optimize_for = LITE_RUNTIME;
message Material
{
- required uint32 type = 1;
+ required uint32 index= 1;
required string name = 2;
} \ No newline at end of file
diff --git a/plugins/mapexport/proto/Tile.proto b/plugins/mapexport/proto/Tile.proto
index 51ffcc0e..09ab931e 100644
--- a/plugins/mapexport/proto/Tile.proto
+++ b/plugins/mapexport/proto/Tile.proto
@@ -34,7 +34,7 @@ message Tile
WATER = 0;
MAGMA = 1;
}
- enum MaterialType
+ enum TileMaterialType
{
AIR = 0;
SOIL = 1;
@@ -59,9 +59,9 @@ message Tile
required uint32 x = 1;
required uint32 y = 2;
required TileType type = 3;
- optional MaterialType material_type = 4;
+ optional TileMaterialType tile_material = 4;
optional uint32 material_index = 5;
- optional uint32 material = 6;
+ optional uint32 material_type = 6;
optional LiquidType liquid_type = 7;
optional uint32 flow_size = 8;
}