Changed liquids to use an enum.

develop
Japa 2013-04-04 14:28:43 +05:30
parent 33f0f0d3f3
commit 541e4f0947
4 changed files with 16 additions and 6 deletions

@ -1 +1 @@
Subproject commit 889e95e26e56bbab836d3f6582a3d4d318735f76
Subproject commit 3b06d1cf27a9d74010731492186f3d2b2cfbd88f

@ -267,15 +267,15 @@ bool gather_embark_tile_layer(int EmbX, int EmbY, int EmbZ, EmbarkTileLayer * ti
//make a new fake material at the given index
if(tileMaterial(tile_type) == tiletype_material::FROZEN_LIQUID) { //Ice.
tile->set_mat_type_table(array_index, BasicMaterial::LIQUID); //Ice is totally a liquid, shut up.
tile->set_mat_subtype_table(array_index, 0);
tile->set_mat_subtype_table(array_index, LiquidType::ICE);
num_valid_blocks++;
}
else if(designation.bits.flow_size) { //Contains either water or lava.
tile->set_mat_type_table(array_index, BasicMaterial::LIQUID);
if(designation.bits.liquid_type) //Magma
tile->set_mat_subtype_table(array_index, 2);
tile->set_mat_subtype_table(array_index, LiquidType::MAGMA);
else //water
tile->set_mat_subtype_table(array_index, 1);
tile->set_mat_subtype_table(array_index, LiquidType::WATER);
num_valid_blocks++;
}
else if(tileShapeBasic(tileShape(tile_type)) != tiletype_shape_basic::Open) {
@ -283,7 +283,11 @@ bool gather_embark_tile_layer(int EmbX, int EmbY, int EmbZ, EmbarkTileLayer * ti
tile->set_mat_type_table(array_index, BasicMaterial::INORGANIC);
tile->set_mat_subtype_table(array_index, actual_mat.mat_index);
}
else if(actual_mat.mat_type >= 419) { //Wooden constructions. Different from growing plants.
else if(actual_mat.mat_type == 419) { //Growing plants
tile->set_mat_type_table(array_index, BasicMaterial::PLANT);
tile->set_mat_subtype_table(array_index, actual_mat.mat_index);
}
else if(actual_mat.mat_type >= 420) { //Wooden constructions. Different from growing plants.
tile->set_mat_type_table(array_index, BasicMaterial::WOOD);
tile->set_mat_subtype_table(array_index, actual_mat.mat_index);
}

@ -12,6 +12,12 @@ enum BasicMaterial {
WOOD = 5;
};
enum LiquidType {
ICE = 0;
WATER = 1;
MAGMA = 2;
}
message EmbarkTileLayer {
repeated BasicMaterial mat_type_table = 4 [packed=true];
repeated int32 mat_subtype_table = 5 [packed=true];

@ -1 +1 @@
Subproject commit bbbda97c1cdd3d2456097eca799cfc7cf3410aaf
Subproject commit 670b4ff6300e8134dc6402336474626e548d0a07