add tiled edges to all heightmap/shadermap import types
This commit is contained in:
@@ -1596,7 +1596,7 @@ void MapView::setupAssistMenu()
|
||||
|
||||
NOGGIT_ACTION_MGR->beginAction(this, Noggit::ActionFlags::eCHUNKS_TERRAIN);
|
||||
_world->importADTHeightmap(_camera.position, adt_import_height_params_multiplier->value(),
|
||||
adt_import_height_params_mode->currentIndex());
|
||||
adt_import_height_params_mode->currentIndex(), adt_import_height_tiled_edges->isChecked());
|
||||
NOGGIT_ACTION_MGR->endAction();
|
||||
}
|
||||
}
|
||||
@@ -1665,7 +1665,7 @@ void MapView::setupAssistMenu()
|
||||
OpenGL::context::scoped_setter const _(::gl, context());
|
||||
|
||||
NOGGIT_ACTION_MGR->beginAction(this, Noggit::ActionFlags::eCHUNKS_VERTEX_COLOR);
|
||||
_world->importADTVertexColorMap(_camera.position, adt_import_vcol_params_mode->currentIndex());
|
||||
_world->importADTVertexColorMap(_camera.position, adt_import_vcol_params_mode->currentIndex(), adt_import_vcol_params_mode_tiled_edges->isChecked());
|
||||
NOGGIT_ACTION_MGR->endAction();
|
||||
}
|
||||
}
|
||||
@@ -1820,7 +1820,7 @@ void MapView::setupAssistMenu()
|
||||
makeCurrent();
|
||||
OpenGL::context::scoped_setter const _(::gl, context());
|
||||
NOGGIT_ACTION_MGR->beginAction(this, Noggit::ActionFlags::eCHUNKS_TEXTURE);
|
||||
_world->importAllADTsHeightmaps(adt_import_height_params_multiplier->value(), adt_import_height_params_mode->currentIndex());
|
||||
_world->importAllADTsHeightmaps(adt_import_height_params_multiplier->value(), adt_import_height_params_mode->currentIndex(), adt_import_height_tiled_edges->isChecked());
|
||||
NOGGIT_ACTION_MGR->endAction();
|
||||
)
|
||||
|
||||
@@ -1839,7 +1839,7 @@ void MapView::setupAssistMenu()
|
||||
makeCurrent();
|
||||
OpenGL::context::scoped_setter const _(::gl, context());
|
||||
NOGGIT_ACTION_MGR->beginAction(this, Noggit::ActionFlags::eCHUNKS_TEXTURE);
|
||||
_world->importAllADTVertexColorMaps(adt_import_vcol_params_mode->currentIndex());
|
||||
_world->importAllADTVertexColorMaps(adt_import_vcol_params_mode->currentIndex(), adt_import_vcol_params_mode_tiled_edges->isChecked());
|
||||
NOGGIT_ACTION_MGR->endAction();
|
||||
)
|
||||
|
||||
|
||||
@@ -1866,7 +1866,7 @@ void World::importADTHeightmap(glm::vec3 const& pos, QImage const& image, float
|
||||
}
|
||||
}
|
||||
|
||||
void World::importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned mode)
|
||||
void World::importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned mode, bool tiledEdges)
|
||||
{
|
||||
ZoneScoped;
|
||||
for_tile_at ( pos
|
||||
@@ -1894,16 +1894,17 @@ void World::importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned
|
||||
QImage img;
|
||||
img.load(filename, "PNG");
|
||||
|
||||
if (img.width() != 257 || img.height() != 257)
|
||||
img = img.scaled(257, 257, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
img = img.scaled(desiredSize, desiredSize, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
|
||||
tile->setHeightmapImage(img, multiplier, mode, false);
|
||||
tile->setHeightmapImage(img, multiplier, mode, tiledEdges);
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void World::importADTVertexColorMap(glm::vec3 const& pos, int mode)
|
||||
void World::importADTVertexColorMap(glm::vec3 const& pos, int mode, bool tiledEdges)
|
||||
{
|
||||
ZoneScoped;
|
||||
for_tile_at ( pos
|
||||
@@ -1931,10 +1932,11 @@ void World::importADTVertexColorMap(glm::vec3 const& pos, int mode)
|
||||
QImage img;
|
||||
img.load(filename, "PNG");
|
||||
|
||||
if (img.width() != 257 || img.height() != 257)
|
||||
img = img.scaled(257, 257, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
img = img.scaled(desiredSize, desiredSize, Qt::AspectRatioMode::IgnoreAspectRatio);
|
||||
|
||||
tile->setVertexColorImage(img, mode, false);
|
||||
tile->setVertexColorImage(img, mode, tiledEdges);
|
||||
|
||||
}
|
||||
);
|
||||
@@ -1972,7 +1974,7 @@ void World::importADTVertexColorMap(glm::vec3 const& pos, QImage const& image, i
|
||||
NOGGIT_CUR_ACTION->registerChunkVertexColorChange(chunk);
|
||||
});
|
||||
|
||||
int desiredDimensions = tiledEdges ? 256 : 257;
|
||||
size_t desiredDimensions = tiledEdges ? 256 : 257;
|
||||
|
||||
if (image.width() != desiredDimensions || image.height() != desiredDimensions)
|
||||
{
|
||||
@@ -2807,7 +2809,7 @@ void World::importAllADTsAlphamaps()
|
||||
}
|
||||
}
|
||||
|
||||
void World::importAllADTsHeightmaps(float multiplier, unsigned int mode)
|
||||
void World::importAllADTsHeightmaps(float multiplier, unsigned int mode, bool tiledEdges)
|
||||
{
|
||||
ZoneScoped;
|
||||
QString path = QString(Noggit::Project::CurrentProject::get()->ProjectPath.c_str());
|
||||
@@ -2839,14 +2841,15 @@ void World::importAllADTsHeightmaps(float multiplier, unsigned int mode)
|
||||
QImage img;
|
||||
img.load(filename, "PNG");
|
||||
|
||||
if (img.width() != 257 || img.height() != 257)
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
{
|
||||
QImage scaled = img.scaled(257, 257, Qt::IgnoreAspectRatio);
|
||||
mTile->setHeightmapImage(scaled, multiplier, mode, false);
|
||||
mTile->setHeightmapImage(scaled, multiplier, mode, tiledEdges);
|
||||
}
|
||||
else
|
||||
{
|
||||
mTile->setHeightmapImage(img, multiplier, mode, false);
|
||||
mTile->setHeightmapImage(img, multiplier, mode, tiledEdges);
|
||||
}
|
||||
|
||||
mTile->saveTile(this);
|
||||
@@ -2862,7 +2865,7 @@ void World::importAllADTsHeightmaps(float multiplier, unsigned int mode)
|
||||
}
|
||||
}
|
||||
|
||||
void World::importAllADTVertexColorMaps(unsigned int mode)
|
||||
void World::importAllADTVertexColorMaps(unsigned int mode, bool tiledEdges)
|
||||
{
|
||||
ZoneScoped;
|
||||
QString path = QString(Noggit::Project::CurrentProject::get()->ProjectPath.c_str());
|
||||
@@ -2894,10 +2897,11 @@ void World::importAllADTVertexColorMaps(unsigned int mode)
|
||||
QImage img;
|
||||
img.load(filename, "PNG");
|
||||
|
||||
if (img.width() != 257 || img.height() != 257)
|
||||
size_t desiredSize = tiledEdges ? 256 : 257;
|
||||
if (img.width() != desiredSize || img.height() != desiredSize)
|
||||
{
|
||||
QImage scaled = img.scaled(257, 257, Qt::IgnoreAspectRatio);
|
||||
mTile->setVertexColorImage(scaled, mode, false);
|
||||
mTile->setVertexColorImage(scaled, mode, tiledEdges);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -236,13 +236,13 @@ public:
|
||||
void importADTAlphamap(glm::vec3 const& pos, QImage const& image, unsigned layer);
|
||||
void importADTAlphamap(glm::vec3 const& pos);
|
||||
void importADTHeightmap(glm::vec3 const& pos, QImage const& image, float multiplier, unsigned mode, bool tiledEdges);
|
||||
void importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned mode);
|
||||
void importADTVertexColorMap(glm::vec3 const& pos, int mode);
|
||||
void importADTHeightmap(glm::vec3 const& pos, float multiplier, unsigned mode, bool tiledEdges);
|
||||
void importADTVertexColorMap(glm::vec3 const& pos, int mode, bool tiledEdges);
|
||||
void importADTVertexColorMap(glm::vec3 const& pos, QImage const& image, int mode, bool tiledEdges);
|
||||
|
||||
void importAllADTsAlphamaps();
|
||||
void importAllADTsHeightmaps(float multiplier, unsigned mode);
|
||||
void importAllADTVertexColorMaps(unsigned mode);
|
||||
void importAllADTsHeightmaps(float multiplier, unsigned mode, bool tiledEdges);
|
||||
void importAllADTVertexColorMaps(unsigned mode, bool tiledEdges);
|
||||
|
||||
void ensureAllTilesetsADT(glm::vec3 const& pos);
|
||||
void ensureAllTilesetsAllADTs();
|
||||
|
||||
Reference in New Issue
Block a user