texture replace tool : fix ui bug and net setting to replace entire tile
This commit is contained in:
@@ -112,7 +112,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool _need_recalc_extents = true;
|
bool _need_recalc_extents = true;
|
||||||
bool _need_gpu_transform_update = true;
|
bool _need_gpu_transform_update = true;
|
||||||
std::uint32_t _gpu_transform_uid;
|
std::uint32_t _gpu_transform_uid = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
std::string mWmoFilename;
|
std::string mWmoFilename;
|
||||||
ENTRY_MODF mWmoEntry;
|
ENTRY_MODF mWmoEntry;
|
||||||
|
|
||||||
unsigned int getMapID();
|
unsigned int getMapID() const;
|
||||||
|
|
||||||
// Time of the day.
|
// Time of the day.
|
||||||
float animtime;
|
float animtime;
|
||||||
@@ -180,7 +180,7 @@ public:
|
|||||||
bool GetVertex(float x, float z, glm::vec3 *V) const;
|
bool GetVertex(float x, float z, glm::vec3 *V) const;
|
||||||
|
|
||||||
// check if the cursor is under map or in an unloaded tile
|
// check if the cursor is under map or in an unloaded tile
|
||||||
bool isUnderMap(glm::vec3 const& pos);
|
bool isUnderMap(glm::vec3 const& pos) const;
|
||||||
|
|
||||||
template<typename Fun>
|
template<typename Fun>
|
||||||
bool for_all_chunks_in_range ( glm::vec3 const& pos
|
bool for_all_chunks_in_range ( glm::vec3 const& pos
|
||||||
@@ -236,7 +236,7 @@ public:
|
|||||||
bool paintTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, scoped_blp_texture_reference texture);
|
bool paintTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, scoped_blp_texture_reference texture);
|
||||||
bool stampTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, scoped_blp_texture_reference texture, QImage* img, bool paint);
|
bool stampTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, scoped_blp_texture_reference texture, QImage* img, bool paint);
|
||||||
bool sprayTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, float spraySize, float sprayPressure, scoped_blp_texture_reference texture);
|
bool sprayTexture(glm::vec3 const& pos, Brush *brush, float strength, float pressure, float spraySize, float sprayPressure, scoped_blp_texture_reference texture);
|
||||||
bool replaceTexture(glm::vec3 const& pos, float radius, scoped_blp_texture_reference const& old_texture, scoped_blp_texture_reference new_texture, bool entire_chunk = false);
|
bool replaceTexture(glm::vec3 const& pos, float radius, scoped_blp_texture_reference const& old_texture, scoped_blp_texture_reference new_texture, bool entire_chunk = false, bool entire_tile = false);
|
||||||
|
|
||||||
void eraseTextures(glm::vec3 const& pos);
|
void eraseTextures(glm::vec3 const& pos);
|
||||||
void overwriteTextureAtCurrentChunk(glm::vec3 const& pos, scoped_blp_texture_reference const& oldTexture, scoped_blp_texture_reference newTexture);
|
void overwriteTextureAtCurrentChunk(glm::vec3 const& pos, scoped_blp_texture_reference const& oldTexture, scoped_blp_texture_reference newTexture);
|
||||||
@@ -428,10 +428,10 @@ protected:
|
|||||||
Noggit::Rendering::WorldRender _renderer;
|
Noggit::Rendering::WorldRender _renderer;
|
||||||
|
|
||||||
// Debug metrics
|
// Debug metrics
|
||||||
unsigned _n_loaded_tiles;
|
unsigned _n_loaded_tiles = 0;
|
||||||
unsigned _n_rendered_tiles;
|
unsigned _n_rendered_tiles = 0;;
|
||||||
|
|
||||||
// unsigned _n_loaded_objects; // done from instance storage size currently
|
// unsigned _n_loaded_objects; // done from instance storage size currently
|
||||||
unsigned _n_rendered_objects;
|
unsigned _n_rendered_objects = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ private:
|
|||||||
bool onDisc;
|
bool onDisc;
|
||||||
|
|
||||||
|
|
||||||
MapTileEntry() : flags(0), tile(nullptr) {}
|
MapTileEntry() : flags(0), tile(nullptr), onDisc(false) {}
|
||||||
|
|
||||||
friend class MapIndex;
|
friend class MapIndex;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -283,6 +283,8 @@ namespace Noggit::Project
|
|||||||
|
|
||||||
project->ClientDatabase = std::make_shared<BlizzardDatabaseLib::BlizzardDatabase>(dbd_file_directory, client_build);
|
project->ClientDatabase = std::make_shared<BlizzardDatabaseLib::BlizzardDatabase>(dbd_file_directory, client_build);
|
||||||
|
|
||||||
|
Log << "Loading Client Path : " << project->ClientPath << std::endl;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
project->ClientData = std::make_shared<BlizzardArchive::ClientData>(
|
project->ClientData = std::make_shared<BlizzardArchive::ClientData>(
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ bool TextureSet::replace_texture( float xbase
|
|||||||
{
|
{
|
||||||
float dist = misc::getShortestDist(x, z, xbase, zbase, CHUNKSIZE);
|
float dist = misc::getShortestDist(x, z, xbase, zbase, CHUNKSIZE);
|
||||||
|
|
||||||
if (dist > radius)
|
if (!entire_chunk && dist > radius)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,27 +46,35 @@ namespace Noggit
|
|||||||
layout->addRow(swap_global);
|
layout->addRow(swap_global);
|
||||||
layout->addRow(remove_text_adt);
|
layout->addRow(remove_text_adt);
|
||||||
|
|
||||||
_brush_mode_group = new QGroupBox("Brush mode", this);
|
auto brush_widget (new QWidget(this));
|
||||||
|
auto brush_layout (new QFormLayout(brush_widget));
|
||||||
|
|
||||||
|
_brush_mode_group = new QGroupBox("Brush mode", brush_widget);
|
||||||
|
// _brush_mode_group->setAlignment(Qt::AlignLeft);
|
||||||
_brush_mode_group->setCheckable(true);
|
_brush_mode_group->setCheckable(true);
|
||||||
_brush_mode_group->setChecked(false);
|
_brush_mode_group->setChecked(false);
|
||||||
layout->addRow(_brush_mode_group);
|
|
||||||
|
|
||||||
auto brush_content (new QWidget(_brush_mode_group));
|
layout->addRow(_brush_mode_group);
|
||||||
auto brush_layout (new QFormLayout(brush_content));
|
|
||||||
_brush_mode_group->setLayout(brush_layout);
|
_brush_mode_group->setLayout(brush_layout);
|
||||||
|
|
||||||
_swap_entire_chunk = new QCheckBox(brush_content);
|
|
||||||
|
_swap_entire_chunk = new QCheckBox(_brush_mode_group);
|
||||||
_swap_entire_chunk->setText(tr("Entire chunk"));
|
_swap_entire_chunk->setText(tr("Entire chunk"));
|
||||||
_swap_entire_chunk->setCheckState(Qt::CheckState::Unchecked);
|
_swap_entire_chunk->setCheckState(Qt::CheckState::Unchecked);
|
||||||
brush_layout->addRow(_swap_entire_chunk);
|
brush_layout->addRow(_swap_entire_chunk);
|
||||||
|
|
||||||
_radius_spin = new QDoubleSpinBox(brush_content);
|
_swap_entire_tile = new QCheckBox(_brush_mode_group);
|
||||||
|
_swap_entire_tile->setText(tr("Entire tile"));
|
||||||
|
_swap_entire_tile->setCheckState(Qt::CheckState::Unchecked);
|
||||||
|
brush_layout->addRow(_swap_entire_tile);
|
||||||
|
|
||||||
|
_radius_spin = new QDoubleSpinBox(_brush_mode_group);
|
||||||
_radius_spin->setRange (0.f, 100.f);
|
_radius_spin->setRange (0.f, 100.f);
|
||||||
_radius_spin->setDecimals (2);
|
_radius_spin->setDecimals (2);
|
||||||
_radius_spin->setValue (_radius);
|
_radius_spin->setValue (_radius);
|
||||||
brush_layout->addRow ("Radius:", _radius_spin);
|
brush_layout->addRow ("Radius:", _radius_spin);
|
||||||
|
|
||||||
_radius_slider = new QSlider (Qt::Orientation::Horizontal, brush_content);
|
_radius_slider = new QSlider (Qt::Orientation::Horizontal, _brush_mode_group);
|
||||||
_radius_slider->setRange (0, 100);
|
_radius_slider->setRange (0, 100);
|
||||||
_radius_slider->setSliderPosition (_radius);
|
_radius_slider->setSliderPosition (_radius);
|
||||||
brush_layout->addRow (_radius_slider);
|
brush_layout->addRow (_radius_slider);
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ namespace Noggit
|
|||||||
return _swap_entire_chunk->isChecked();
|
return _swap_entire_chunk->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool entireTile() const
|
||||||
|
{
|
||||||
|
return _swap_entire_tile->isChecked();
|
||||||
|
}
|
||||||
|
|
||||||
void change_radius(float change);
|
void change_radius(float change);
|
||||||
|
|
||||||
bool brush_mode() const
|
bool brush_mode() const
|
||||||
@@ -67,6 +72,7 @@ namespace Noggit
|
|||||||
QGroupBox* _brush_mode_group;
|
QGroupBox* _brush_mode_group;
|
||||||
QSlider* _radius_slider;
|
QSlider* _radius_slider;
|
||||||
QCheckBox* _swap_entire_chunk;
|
QCheckBox* _swap_entire_chunk;
|
||||||
|
QCheckBox* _swap_entire_tile;
|
||||||
QDoubleSpinBox* _radius_spin;
|
QDoubleSpinBox* _radius_spin;
|
||||||
World* _world;
|
World* _world;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ namespace Noggit
|
|||||||
if (_texture_switcher->brush_mode())
|
if (_texture_switcher->brush_mode())
|
||||||
{
|
{
|
||||||
std::cout << _texture_switcher->radius() << std::endl;
|
std::cout << _texture_switcher->radius() << std::endl;
|
||||||
world->replaceTexture(pos, _texture_switcher->radius(), to_swap.value(), texture, _texture_switcher->entireChunk());
|
world->replaceTexture(pos, _texture_switcher->radius(), to_swap.value(), texture, _texture_switcher->entireChunk(), _texture_switcher->entireTile());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user