mirror of
https://github.com/minetest/minetestmapper.git
synced 2025-02-20 14:00:27 +01:00
Make --noemptyimage more fine-grained
This commit is contained in:
parent
6947c5c4e4
commit
b4d4632212
@ -153,6 +153,8 @@ TileGenerator::TileGenerator():
|
||||
TileGenerator::~TileGenerator()
|
||||
{
|
||||
closeDatabase();
|
||||
delete m_image;
|
||||
m_image = nullptr;
|
||||
}
|
||||
|
||||
void TileGenerator::setBgColor(const std::string &bgColor)
|
||||
@ -293,19 +295,24 @@ void TileGenerator::dumpBlock(const std::string &input_path, BlockPos pos)
|
||||
|
||||
void TileGenerator::generate(const std::string &input_path, const std::string &output)
|
||||
{
|
||||
if (m_dontWriteEmpty) // FIXME: possible too, just needs to be done differently
|
||||
setExhaustiveSearch(EXH_NEVER);
|
||||
openDb(input_path);
|
||||
loadBlocks();
|
||||
|
||||
if (m_dontWriteEmpty && m_positions.empty())
|
||||
{
|
||||
closeDatabase();
|
||||
// If we needed to load positions and there are none, that means the
|
||||
// result will be empty.
|
||||
if (m_dontWriteEmpty && (m_exhaustiveSearch == EXH_NEVER ||
|
||||
m_exhaustiveSearch == EXH_Y) && m_positions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
createImage();
|
||||
renderMap();
|
||||
|
||||
if (m_dontWriteEmpty && !m_renderedAny) {
|
||||
printUnknown();
|
||||
return;
|
||||
}
|
||||
|
||||
closeDatabase();
|
||||
if (m_drawScale) {
|
||||
renderScale();
|
||||
|
Loading…
x
Reference in New Issue
Block a user