diff --git a/cubiomes b/cubiomes
index 0cd6e81..fa3ed2a 160000
--- a/cubiomes
+++ b/cubiomes
@@ -1 +1 @@
-Subproject commit 0cd6e8134a0d257685867f8a77f5cd6c01ab8353
+Subproject commit fa3ed2af5961d6129aceb15974e05402a2db06d8
diff --git a/src/aboutdialog.h b/src/aboutdialog.h
index 093cb6b..b1e8cdc 100644
--- a/src/aboutdialog.h
+++ b/src/aboutdialog.h
@@ -5,7 +5,7 @@
#define VERS_MAJOR 1
#define VERS_MINOR 11
-#define VERS_PATCH 2 // negative patch number designates a development version
+#define VERS_PATCH 3 // negative patch number designates a development version
// returns +1 if newer, -1 if older and 0 if equal
inline int cmpVers(int major, int minor, int patch)
diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui
index 212cd4e..f665bec 100644
--- a/src/aboutdialog.ui
+++ b/src/aboutdialog.ui
@@ -6,8 +6,8 @@
0
0
- 589
- 340
+ 609
+ 343
@@ -43,24 +43,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:16pt; font-weight:600;">Cubiomes-Viewer _MAJOR_._MINOR_._PATCH_</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">Built: _DATE_</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">URL: </span><a href="https://github.com/Cubitect/cubiomes-viewer"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/Cubitect/cubiomes-viewer</span></a></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">License: </span><a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><span style=" text-decoration: underline; color:#0057ae;">GPLv3</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:12pt; font-weight:600;">Components and Legal Information</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:12pt; font-weight:600;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Minecraft biome and structure generation from </span><a href="https://github.com/Cubitect/cubiomes/"><span style=" text-decoration: underline; color:#0057ae;">cubiomes</span></a><span style=" font-family:'Sans';">, licensed under </span><a href="https://mit-license.org/"><span style=" text-decoration: underline; color:#0057ae;">MIT</span></a><span style=" font-family:'Sans';">.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Cross platform GUI toolkit: Qt _QT_MAJOR_._QT_MINOR_, available under </span><a href="https://www.qt.io/licensing/"><span style=" text-decoration: underline; color:#0057ae;">(L)GPLv3</span></a><span style=" font-family:'Sans';">.</span></p>
+</style></head><body style=" font-family:'Sans'; font-size:10pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Cubiomes-Viewer _MAJOR_._MINOR_._PATCH_</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Dark Qt theme derived from </span><a href="https://github.com/ColinDuquesnoy/QDarkStyleSheet"><span style=" text-decoration: underline; color:#0057ae;">QDarkStyleSheet</span></a><span style=" font-family:'Sans';">, licensed under MIT.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">— Colors and icons are in part modified from </span><a href="https://github.com/toolbox4minecraft/amidst"><span style=" text-decoration: underline; color:#0057ae;">Amidst</span></a><span style=" font-family:'Sans';">, licensed under GPLv3.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">NOT APPROVED BY OR ASSOCIATED WITH MOJANG.</p></body></html>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Built: _DATE_</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">URL: <a href="https://github.com/Cubitect/cubiomes-viewer"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">https://github.com/Cubitect/cubiomes-viewer</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">License: <a href="https://www.gnu.org/licenses/gpl-3.0.en.html"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">GPLv3</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Components and Legal Information</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Minecraft biome and structure generation from <a href="https://github.com/Cubitect/cubiomes/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">cubiomes</span></a>, licensed under <a href="https://mit-license.org/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">MIT</span></a>.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Cross platform GUI toolkit: Qt _QT_MAJOR_._QT_MINOR_, available under <a href="https://www.qt.io/licensing/"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">(L)GPLv3</span></a>.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Dark Qt theme derived from <a href="https://github.com/ColinDuquesnoy/QDarkStyleSheet"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">QDarkStyleSheet</span></a>, licensed under MIT.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">— Colors and icons are inspired by <a href="https://github.com/toolbox4minecraft/amidst"><span style=" font-family:'Sans Serif'; text-decoration: underline; color:#0057ae;">Amidst</span></a>, licensed under GPLv3.</p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">NOT APPROVED BY OR ASSOCIATED WITH MOJANG.</span></p></body></html>
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
index 1b366f0..2402f59 100644
--- a/src/configdialog.cpp
+++ b/src/configdialog.cpp
@@ -1,13 +1,21 @@
#include "configdialog.h"
#include "ui_configdialog.h"
+#include "cutil.h"
#include
+#include
+#include
ConfigDialog::ConfigDialog(QWidget *parent, Config *config) :
QDialog(parent),
ui(new Ui::ConfigDialog)
{
ui->setupUi(this);
+
+ QFont mono = QFont("Monospace", 9);
+ mono.setStyleHint(QFont::TypeWriter);
+ ui->buttonBiomeColor->setFont(mono);
+
ui->lineQueueSize->setValidator(new QIntValidator(1, 9999, ui->lineQueueSize));
ui->lineMatching->setValidator(new QIntValidator(1, 99999999, ui->lineMatching));
for (int i = 0; i < 16; i++)
@@ -32,6 +40,8 @@ void ConfigDialog::initSettings(Config *config)
ui->cboxItemSize->setCurrentText(QString::number(config->seedsPerItem));
ui->lineQueueSize->setText(QString::number(config->queueSize));
ui->lineMatching->setText(QString::number(config->maxMatching));
+
+ setBiomeColorPath(config->biomeColorPath);
}
Config ConfigDialog::getSettings()
@@ -52,6 +62,51 @@ Config ConfigDialog::getSettings()
return conf;
}
+void ConfigDialog::setBiomeColorPath(QString path)
+{
+ unsigned char cols[256][3];
+ initBiomeColors(cols);
+ QPalette pal = this->palette();
+
+ conf.biomeColorPath = path;
+
+ if (path.isEmpty())
+ {
+ ui->buttonBiomeColor->setText("...");
+ }
+ else
+ {
+ QFileInfo finfo(path);
+ QFile file(path);
+ int n = -1;
+
+ if (file.open(QIODevice::ReadOnly))
+ {
+ char buf[32*1024];
+ qint64 siz = file.read(buf, sizeof(buf)-1);
+ file.close();
+ if (siz >= 0)
+ {
+ buf[siz] = 0;
+ n = parseBiomeColors(cols, buf);
+ }
+ }
+
+ if (n >= 0)
+ {
+ QString txt = QString::asprintf("[%d biomes] ", n) + finfo.baseName();
+ ui->buttonBiomeColor->setText(txt);
+ }
+ else
+ {
+ ui->buttonBiomeColor->setText(finfo.baseName());
+ pal.setColor(QPalette::ButtonText, QColor(Qt::red));
+ }
+ }
+
+ ui->buttonBiomeColor->setPalette(pal);
+}
+
void ConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
{
if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::ResetRole)
@@ -60,3 +115,20 @@ void ConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
initSettings(&conf);
}
}
+
+void ConfigDialog::on_buttonBiomeColor_clicked()
+{
+ QFileInfo finfo(conf.biomeColorPath);
+ QString fnam = QFileDialog::getOpenFileName(this, "Load biome color map", finfo.absolutePath(), "Text files (*.txt);;Any files (*)");
+ if (!fnam.isNull())
+ {
+ conf.biomeColorPath = fnam;
+ setBiomeColorPath(fnam);
+ }
+}
+
+void ConfigDialog::on_buttonClear_clicked()
+{
+ conf.biomeColorPath.clear();
+ setBiomeColorPath("");
+}
diff --git a/src/configdialog.h b/src/configdialog.h
index 0476703..54e2888 100644
--- a/src/configdialog.h
+++ b/src/configdialog.h
@@ -24,9 +24,15 @@ public:
Config getSettings();
+ void setBiomeColorPath(QString path);
+
private slots:
void on_buttonBox_clicked(QAbstractButton *button);
+ void on_buttonBiomeColor_clicked();
+
+ void on_buttonClear_clicked();
+
private:
Ui::ConfigDialog *ui;
Config conf;
diff --git a/src/configdialog.ui b/src/configdialog.ui
index 917f1bc..116c75c 100644
--- a/src/configdialog.ui
+++ b/src/configdialog.ui
@@ -2,6 +2,14 @@
ConfigDialog
+
+
+ 0
+ 0
+ 433
+ 435
+
+
Preferences
@@ -10,11 +18,132 @@
:/icons/map.png:/icons/map.png
- -
-
-
- Maximum number of matching seeds:
+
-
+
+
+ Search
+
+
-
+
+
+ Size of search item queue:
+(limits usable threads)
+
+
+
+ -
+
+
+ Seeds per thread search item:
+
+
+
+ -
+
+
+ Maximum number of matching seeds:
+
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 16
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+ Interface
+
+
+
-
+
+
+ [none]
+
+
+
+ -
+
+
+
+ 0
+ 16
+
+
+
-
+
+ System
+
+
+ -
+
+ Dark
+
+
+
+
+ -
+
+
+ Outline known bounding boxes
+
+
+
+ -
+
+
+ GUI style:
+
+
+
+ -
+
+
+ Simulate innertia for the map view
+
+
+ Smooth map motion
+
+
+
+ -
+
+
+ Biome color customization:
+
+
+
+ -
+
+
+
+ 20
+ 16777215
+
+
+
+
+ :/icons/clear.png:/icons/clear.png
+
+
+
+
-
@@ -27,109 +156,43 @@
- -
-
-
- Size of search item queue:
-(limits usable threads)
-
-
-
- -
-
-
- Seeds per thread search item:
-
-
-
- -
-
-
- Simulate innertia for the map view
-
-
- Smooth map motion
-
-
-
- -
-
-
- -
-
-
-
- 0
- 16
-
-
-
-
- -
-
-
- -
-
-
- Autosave every:
-
-
-
- -
-
-
- min
-
-
- 1
-
-
- 120
-
-
- 10
-
-
-
- -
-
-
- GUI style:
-
-
-
- -
-
-
-
- 0
- 16
-
-
-
-
-
- System
-
-
- -
-
- Dark
-
-
-
-
- -
-
-
- Outline known bounding boxes
-
-
-
- -
-
-
- Restore previous session at launch
+
-
+
+
+ Session
+
+
-
+
+
+ Restore previous session at launch
+
+
+
+ -
+
+
+ Autosave every:
+
+
+
+ -
+
+
+ min
+
+
+ 1
+
+
+ 120
+
+
+ 10
+
+
+
+
diff --git a/src/cutil.h b/src/cutil.h
index 5c87776..899d40e 100644
--- a/src/cutil.h
+++ b/src/cutil.h
@@ -18,7 +18,7 @@ inline const char* struct2str(int stype)
switch (stype)
{
case Desert_Pyramid: return "desert_pyramid";
- case Jungle_Pyramid: return "jungle_pyramid";
+ case Jungle_Temple: return "jungle_temple";
case Swamp_Hut: return "swamp_hut";
case Igloo: return "igloo";
case Village: return "village";
diff --git a/src/filterdialog.cpp b/src/filterdialog.cpp
index 4cd81d7..19e3eb8 100644
--- a/src/filterdialog.cpp
+++ b/src/filterdialog.cpp
@@ -15,7 +15,7 @@
#define SETUP_BIOME_CHECKBOX(B) do {\
- biomecboxes[B] = new QCheckBox(#B);\
+ biomecboxes[B] = new QCheckBox(biome2str(mc, B));\
ui->gridLayoutBiomes->addWidget(biomecboxes[B], (B) % 128, (B) / 128);\
biomecboxes[B]->setTristate(true);\
} while (0)
@@ -35,10 +35,10 @@ static QString getTip(int mc, int layer, int id)
QString tip = "Generates any of:";
for (int j = 0; j < 64; j++)
if (mL & (1ULL << j))
- tip += QString("\n") + biome2str(j);
+ tip += QString("\n") + biome2str(mc, j);
for (int j = 0; j < 64; j++)
if (mM & (1ULL << j))
- tip += QString("\n") + biome2str(128+j);
+ tip += QString("\n") + biome2str(mc, 128+j);
return tip;
}
@@ -490,12 +490,12 @@ void FilterDialog::updateBiomeSelection()
for (int j = 0; j < 64; j++)
{
if (mL & (1ULL << j))
- tip += QString("\n") + biome2str(j);
+ tip += QString("\n") + biome2str(mc, j);
}
for (int j = 0; j < 64; j++)
{
if (mM & (1ULL << j))
- tip += QString("\n") + biome2str(j+128);
+ tip += QString("\n") + biome2str(mc, j+128);
}
cb->setToolTip(tip);
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 24c9f8b..6953be2 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -312,6 +312,7 @@ void MainWindow::saveSettings()
settings.setValue("config/seedsPerItem", config.seedsPerItem);
settings.setValue("config/queueSize", config.queueSize);
settings.setValue("config/maxMatching", config.maxMatching);
+ settings.setValue("config/biomeColorPath", config.biomeColorPath);
settings.setValue("world/saltOverride", g_extgen.saltOverride);
for (int st = 0; st < FEATURE_NUM; st++)
@@ -382,6 +383,10 @@ void MainWindow::loadSettings()
config.seedsPerItem = settings.value("config/seedsPerItem", config.seedsPerItem).toInt();
config.queueSize = settings.value("config/queueSize", config.queueSize).toInt();
config.maxMatching = settings.value("config/maxMatching", config.maxMatching).toInt();
+ config.biomeColorPath = settings.value("config/biomeColorPath", config.biomeColorPath).toString();
+
+ if (!config.biomeColorPath.isEmpty())
+ onBiomeColorChange();
ui->mapView->setShowBB(config.showBBoxes);
ui->mapView->setSmoothMotion(config.smoothMotion);
@@ -725,9 +730,36 @@ void MainWindow::on_actionPreferences_triggered()
{
autosaveTimer.stop();
}
+
+ if (!config.biomeColorPath.isEmpty() || !oldConfig.biomeColorPath.isEmpty())
+ {
+ onBiomeColorChange();
+ }
}
}
+void MainWindow::onBiomeColorChange()
+{
+ QFile file(config.biomeColorPath);
+ if (file.open(QIODevice::ReadOnly))
+ {
+ char buf[32*1024];
+ qint64 siz = file.read(buf, sizeof(buf)-1);
+ file.close();
+ if (siz >= 0)
+ {
+ buf[siz] = 0;
+ initBiomeColors(biomeColors);
+ parseBiomeColors(biomeColors, buf);
+ }
+ }
+ else
+ {
+ initBiomeColors(biomeColors);
+ }
+ ui->mapView->refresh();
+}
+
void MainWindow::on_actionGo_to_triggered()
{
GotoDialog *dialog = new GotoDialog(this, ui->mapView->getX(), ui->mapView->getZ(), ui->mapView->getScale());
@@ -972,7 +1004,7 @@ void MainWindow::on_buttonAnalysis_clicked()
if (cnt <= 0)
continue;
const char *s;
- if (!(s = biome2str(id)))
+ if (!(s = biome2str(wi.mc, id)))
continue;
QTreeWidgetItem* item =
new QTreeWidgetItem(item_cat, QTreeWidgetItem::UserType + id);
diff --git a/src/mainwindow.h b/src/mainwindow.h
index cc8ca96..67ebb88 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -104,6 +104,7 @@ private slots:
void onSelectedSeedChanged(uint64_t seed);
void onSearchStatusChanged(bool running);
void onStyleChanged(int style);
+ void onBiomeColorChange();
void copyCoord();
void copyTeleportCommand();
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index 3b0cd1f..b4be99a 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -818,7 +818,7 @@ QToolButton:checked {
- World settings...
+ Advanced world settings...
diff --git a/src/mapview.cpp b/src/mapview.cpp
index 8ca741c..99ab2f5 100644
--- a/src/mapview.cpp
+++ b/src/mapview.cpp
@@ -22,8 +22,6 @@ bool MapOverlay::event(QEvent *e)
void MapOverlay::paintEvent(QPaintEvent *)
{
QPainter painter(this);
-
- const char *bname = biome2str(id);
if (bname)
{
QString s = QString::asprintf("%s [%d,%d]", bname, pos.x, pos.z);
@@ -78,6 +76,17 @@ void MapView::deleteWorld()
world = NULL;
}
+void MapView::refresh()
+{
+ if (world)
+ {
+ WorldInfo wi = world->wi;
+ int dim = world->dim;
+ delete world;
+ world = new QWorld(wi, dim);
+ }
+}
+
void MapView::setSeed(WorldInfo wi, int dim)
{
prevx = focusx = getX();
@@ -203,7 +212,7 @@ void MapView::paintEvent(QPaintEvent *)
qreal bz = (cur.y() - height()/2.0) / blocks2pix + fz;
Pos p = {(int)bx, (int)bz};
overlay->pos = p;
- overlay->id = world->getBiome(p);
+ overlay->bname = biome2str(world->wi.mc, world->getBiome(p));
if (QThreadPool::globalInstance()->activeThreadCount() > 0 || velx || velz)
updatecounter = 2;
diff --git a/src/mapview.h b/src/mapview.h
index 7cb888d..d97a333 100644
--- a/src/mapview.h
+++ b/src/mapview.h
@@ -12,7 +12,7 @@ class MapOverlay : public QWidget
public:
explicit MapOverlay(QWidget *parent = nullptr)
- : QWidget(parent),pos{},id(-1) {}
+ : QWidget(parent),pos{},bname(nullptr) {}
~MapOverlay() {}
public slots:
@@ -21,7 +21,7 @@ public slots:
public:
Pos pos;
- int id;
+ const char *bname;
};
class MapView : public QWidget
@@ -37,6 +37,7 @@ public:
qreal getScale() const { return 1.0 / blocks2pix; }
void deleteWorld();
+ void refresh();
void setSeed(WorldInfo wi, int dim);
void setView(qreal x, qreal z, qreal scale = 0);
diff --git a/src/search.cpp b/src/search.cpp
index 28d5abd..129565f 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -459,27 +459,24 @@ L_qm_any:
continue;
if (pc.x < x1 || pc.x > x2 || pc.z < z1 || pc.z > z2)
continue;
- if (pass < PASS_FULL_48 || (pass == PASS_FAST_48 && finfo.dim == 0))
+ if (pass == PASS_FULL_64 || (pass == PASS_FULL_48 && !finfo.dep64))
{
- xt += pc.x;
- zt += pc.z;
- n++;
- continue;
- }
- gen->init4Dim(finfo.dim);
- if (!isViableStructurePos(st, &gen->g, pc.x, pc.z, 0))
- continue;
- if (st == End_City)
- {
- gen->setSurfaceNoise();
- if (!isViableEndCityTerrain(
- &gen->g.en, &gen->sn, pc.x, pc.z))
- continue;
- }
- else if (gen->mc >= MC_1_18)
- {
- if (!isViableStructureTerrain(st, &gen->g, pc.x, pc.z))
+ if (*abort) return COND_FAILED;
+ gen->init4Dim(finfo.dim);
+ if (!isViableStructurePos(st, &gen->g, pc.x, pc.z, 0))
continue;
+ if (st == End_City)
+ {
+ gen->setSurfaceNoise();
+ if (!isViableEndCityTerrain(
+ &gen->g.en, &gen->sn, pc.x, pc.z))
+ continue;
+ }
+ else if (gen->mc >= MC_1_18)
+ {
+ if (!isViableStructureTerrain(st, &gen->g, pc.x, pc.z))
+ continue;
+ }
}
xt += pc.x;
zt += pc.z;
@@ -492,14 +489,13 @@ L_qm_any:
cent->x = xt / n;
cent->z = zt / n;
- if (pass != PASS_FULL_64 && finfo.dep64)
- { // some non-exhaustive structure clusters do not
- // have known center positions with 48-bit seeds
- if (cond->count != (1+rx2-rx1) * (1+rz2-rz1))
- return COND_MAYBE_POS_INVAL;
- return COND_MAYBE_POS_VALID;
- }
- return COND_OK;
+ if (pass == PASS_FULL_64 || (pass == PASS_FULL_48 && !finfo.dep64))
+ return COND_OK;
+ // some non-exhaustive structure clusters do not
+ // have known center positions with 48-bit seeds
+ if (cond->count != (1+rx2-rx1) * (1+rz2-rz1))
+ return COND_MAYBE_POS_INVAL;
+ return COND_MAYBE_POS_VALID;
}
return COND_FAILED;
@@ -741,11 +737,8 @@ L_noise_biome:
return COND_MAYBE_POS_VALID;
// the Nether and End require only the 48-bit seed
// (except voronoi uses the full 64-bits)
- if (pass == PASS_FULL_48)
- {
- if (s == 0 || finfo.dim == 0)
- return COND_MAYBE_POS_VALID;
- }
+ if (pass == PASS_FULL_48 && finfo.dep64)
+ return COND_MAYBE_POS_VALID;
rx1 = ((cond->x1 << s) + at.x) >> s;
rz1 = ((cond->z1 << s) + at.z) >> s;
rx2 = ((cond->x2 << s) + at.x) >> s;
diff --git a/src/settings.h b/src/settings.h
index 76ff310..07b6c6a 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -58,6 +58,7 @@ struct Config
int seedsPerItem;
int queueSize;
int maxMatching;
+ QString biomeColorPath;
Config() { reset(); }
@@ -71,6 +72,7 @@ struct Config
seedsPerItem = 64;
queueSize = QThread::idealThreadCount();
maxMatching = 65536;
+ biomeColorPath = "";
}
};