|
|
@ -86,6 +86,7 @@ void help( color_ostream & out, std::vector<std::string> &commands, int start, i
|
|
|
|
<< " run / (empty) : paint!" << std::endl
|
|
|
|
<< " run / (empty) : paint!" << std::endl
|
|
|
|
<< std::endl
|
|
|
|
<< std::endl
|
|
|
|
<< "Filter/paint options:" << std::endl
|
|
|
|
<< "Filter/paint options:" << std::endl
|
|
|
|
|
|
|
|
<< " Any: reset to default (no filter/paint)" << std::endl
|
|
|
|
<< " Shape / sh / s: set tile shape information" << std::endl
|
|
|
|
<< " Shape / sh / s: set tile shape information" << std::endl
|
|
|
|
<< " Material / mat / m: set tile material information" << std::endl
|
|
|
|
<< " Material / mat / m: set tile material information" << std::endl
|
|
|
|
<< " Special / sp: set special tile information" << std::endl
|
|
|
|
<< " Special / sp: set special tile information" << std::endl
|
|
|
@ -96,6 +97,7 @@ void help( color_ostream & out, std::vector<std::string> &commands, int start, i
|
|
|
|
<< " Light / l: set light flag" << std::endl
|
|
|
|
<< " Light / l: set light flag" << std::endl
|
|
|
|
<< " Subterranean / st: set subterranean flag" << std::endl
|
|
|
|
<< " Subterranean / st: set subterranean flag" << std::endl
|
|
|
|
<< " Skyview / sv: set skyview flag" << std::endl
|
|
|
|
<< " Skyview / sv: set skyview flag" << std::endl
|
|
|
|
|
|
|
|
<< " Aquifer / aqua: set aquifer flag" << std::endl
|
|
|
|
<< "See help [option] for more information" << std::endl;
|
|
|
|
<< "See help [option] for more information" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (option == "shape" || option == "s" ||option == "sh")
|
|
|
|
else if (option == "shape" || option == "s" ||option == "sh")
|
|
|
@ -159,6 +161,11 @@ void help( color_ostream & out, std::vector<std::string> &commands, int start, i
|
|
|
|
out << "Available skyview flags:" << std::endl
|
|
|
|
out << "Available skyview flags:" << std::endl
|
|
|
|
<< " ANY, 0, 1" << std::endl;
|
|
|
|
<< " ANY, 0, 1" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (option == "aquifer" || option == "aqua")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
out << "Available aquifer flags:" << std::endl
|
|
|
|
|
|
|
|
<< " ANY, 0, 1" << std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct TileType
|
|
|
|
struct TileType
|
|
|
@ -172,8 +179,14 @@ struct TileType
|
|
|
|
int light;
|
|
|
|
int light;
|
|
|
|
int subterranean;
|
|
|
|
int subterranean;
|
|
|
|
int skyview;
|
|
|
|
int skyview;
|
|
|
|
|
|
|
|
int aquifer;
|
|
|
|
|
|
|
|
|
|
|
|
TileType()
|
|
|
|
TileType()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
shape = tiletype_shape::NONE;
|
|
|
|
shape = tiletype_shape::NONE;
|
|
|
|
material = tiletype_material::NONE;
|
|
|
|
material = tiletype_material::NONE;
|
|
|
@ -184,13 +197,31 @@ struct TileType
|
|
|
|
light = -1;
|
|
|
|
light = -1;
|
|
|
|
subterranean = -1;
|
|
|
|
subterranean = -1;
|
|
|
|
skyview = -1;
|
|
|
|
skyview = -1;
|
|
|
|
|
|
|
|
aquifer = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool empty()
|
|
|
|
bool empty()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return shape == -1 && material == -1 && special == -1 && variant == -1
|
|
|
|
return shape == -1 && material == -1 && special == -1 && variant == -1
|
|
|
|
&& hidden == -1 && light == -1 && subterranean == -1 && skyview == -1
|
|
|
|
&& dig == -1 && hidden == -1 && light == -1 && subterranean == -1
|
|
|
|
&& dig == -1;
|
|
|
|
&& skyview == -1 && aquifer == -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline bool matches(const df::tiletype source,
|
|
|
|
|
|
|
|
const df::tile_designation des)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool rv = true;
|
|
|
|
|
|
|
|
rv &= (shape == -1 || shape == tileShape(source));
|
|
|
|
|
|
|
|
rv &= (material == -1 || material == tileMaterial(source));
|
|
|
|
|
|
|
|
rv &= (special == -1 || special == tileSpecial(source));
|
|
|
|
|
|
|
|
rv &= (variant == -1 || variant == tileVariant(source));
|
|
|
|
|
|
|
|
rv &= (dig == -1 || (dig != 0) == (des.bits.dig != tile_dig_designation::No));
|
|
|
|
|
|
|
|
rv &= (hidden == -1 || (hidden != 0) == des.bits.hidden);
|
|
|
|
|
|
|
|
rv &= (light == -1 || (light != 0) == des.bits.light);
|
|
|
|
|
|
|
|
rv &= (subterranean == -1 || (subterranean != 0) == des.bits.subterranean);
|
|
|
|
|
|
|
|
rv &= (skyview == -1 || (skyview != 0) == des.bits.outside);
|
|
|
|
|
|
|
|
rv &= (aquifer == -1 || (aquifer != 0) == des.bits.water_table);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -310,6 +341,19 @@ std::ostream &operator<<(std::ostream &stream, const TileType &paint)
|
|
|
|
needSpace = true;
|
|
|
|
needSpace = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (paint.aquifer >= 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (needSpace)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
stream << " ";
|
|
|
|
|
|
|
|
needSpace = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stream << (paint.aquifer ? "AQUIFER" : "NO AQUIFER");
|
|
|
|
|
|
|
|
used = true;
|
|
|
|
|
|
|
|
needSpace = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!used)
|
|
|
|
if (!used)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
stream << "any";
|
|
|
|
stream << "any";
|
|
|
@ -437,7 +481,11 @@ bool processTileType(color_ostream & out, TileType &paint, std::vector<std::stri
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool found = false;
|
|
|
|
bool found = false;
|
|
|
|
|
|
|
|
|
|
|
|
if (option == "shape" || option == "sh" || option == "s")
|
|
|
|
if (option == "any")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
paint.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (option == "shape" || option == "sh" || option == "s")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (is_valid_enum_item((df::tiletype_shape)valInt))
|
|
|
|
if (is_valid_enum_item((df::tiletype_shape)valInt))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -619,14 +667,9 @@ command_result executePaintJob(color_ostream &out)
|
|
|
|
const df::tiletype source = map.tiletypeAt(*iter);
|
|
|
|
const df::tiletype source = map.tiletypeAt(*iter);
|
|
|
|
df::tile_designation des = map.designationAt(*iter);
|
|
|
|
df::tile_designation des = map.designationAt(*iter);
|
|
|
|
|
|
|
|
|
|
|
|
if ((filter.shape > -1 && filter.shape != tileShape(source))
|
|
|
|
if (!filter.matches(source, des))
|
|
|
|
|| (filter.material > -1 && filter.material != tileMaterial(source))
|
|
|
|
|
|
|
|
|| (filter.special > -1 && filter.special != tileSpecial(source))
|
|
|
|
|
|
|
|
|| (filter.variant > -1 && filter.variant != tileVariant(source))
|
|
|
|
|
|
|
|
|| (filter.dig > -1 && (filter.dig != 0) != (des.bits.dig != tile_dig_designation::No))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return CR_OK;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
df::tiletype_shape shape = paint.shape;
|
|
|
|
df::tiletype_shape shape = paint.shape;
|
|
|
@ -707,6 +750,11 @@ command_result executePaintJob(color_ostream &out)
|
|
|
|
des.bits.outside = paint.skyview;
|
|
|
|
des.bits.outside = paint.skyview;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (paint.aquifer > -1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
des.bits.water_table = paint.aquifer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove liquid from walls, etc
|
|
|
|
// Remove liquid from walls, etc
|
|
|
|
if (type != -1 && !DFHack::FlowPassable(type))
|
|
|
|
if (type != -1 && !DFHack::FlowPassable(type))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -782,6 +830,9 @@ command_result processCommand(color_ostream &out, std::vector<std::string> &comm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (width < 1 || height < 1) {
|
|
|
|
if (width < 1 || height < 1) {
|
|
|
|
|
|
|
|
width = width < 1? 1 : width;
|
|
|
|
|
|
|
|
height = height < 1? 1 : height;
|
|
|
|
|
|
|
|
z_levels = z_levels < 1? 1 : z_levels;
|
|
|
|
if (hasConsole) {
|
|
|
|
if (hasConsole) {
|
|
|
|
Console &con = static_cast<Console&>(out);
|
|
|
|
Console &con = static_cast<Console&>(out);
|
|
|
|
CommandHistory hist;
|
|
|
|
CommandHistory hist;
|
|
|
@ -804,9 +855,9 @@ command_result processCommand(color_ostream &out, std::vector<std::string> &comm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (width < 1) width = 1;
|
|
|
|
width = width < 1? 1 : width;
|
|
|
|
if (height < 1) height = 1;
|
|
|
|
height = height < 1? 1 : height;
|
|
|
|
if (z_levels < 1) z_levels = 1;
|
|
|
|
z_levels = z_levels < 1? 1 : z_levels;
|
|
|
|
|
|
|
|
|
|
|
|
delete brush;
|
|
|
|
delete brush;
|
|
|
|
brush = new RectangleBrush(width, height, z_levels, 0, 0, 0);
|
|
|
|
brush = new RectangleBrush(width, height, z_levels, 0, 0, 0);
|
|
|
|