fix or hack fix various issues | Update FlowView.cpp, Action.cpp, and 8 more files...

This commit is contained in:
Skarn
2022-01-12 18:27:30 +03:00
parent 9e059e1008
commit 75806861d4
10 changed files with 14 additions and 18 deletions

View File

@@ -560,7 +560,7 @@ void FlowView::paintEvent(QPaintEvent *event)
return;
}
QCoreApplication::processEvents();
//QCoreApplication::processEvents();
for(auto& pair : _scene->nodes())
{

View File

@@ -736,7 +736,7 @@ void Noggit::Action::registerChunkShadowChange(MapChunk *chunk)
return;
}
std::array<uint8_t , 64 * 64> data;
std::array<uint8_t, 64 * 64> data;
std::memcpy(data.data(), &chunk->_shadow_map, 64 * 64 * sizeof(std::uint8_t));
_chunk_shadow_map_pre.emplace_back(std::make_pair(chunk, std::move(data)));
}

View File

@@ -50,22 +50,19 @@ namespace Noggit
template<typename... Args>
T* emplace (BlizzardArchive::Listfile::FileKey const& file_key, Noggit::NoggitRenderContext context, Args&&... args)
{
std::scoped_lock const lock(_mutex);
auto pair = std::make_pair(context, file_key);
//LogDebug << "Emplacing " << normalized << " into context" << context << std::endl;
{
std::scoped_lock const lock(_mutex);
if ([&] { return _counts[pair]++; }())
{
return &_elements.at (pair);
}
}
T* const obj ( [&]
{
std::scoped_lock const lock(_mutex);
return &_elements.emplace ( std::piecewise_construct
, std::forward_as_tuple (pair)
, std::forward_as_tuple (file_key.filepath(), context, args...)
@@ -151,7 +148,7 @@ namespace Noggit
}
private:
std::map<std::pair<int, BlizzardArchive::Listfile::FileKey>, T> _elements;
std::unordered_map<std::pair<int, BlizzardArchive::Listfile::FileKey>, T, pair_hash> _elements;
std::unordered_map<std::pair<int, BlizzardArchive::Listfile::FileKey>, std::size_t, pair_hash> _counts;
std::mutex mutable _mutex;
};

View File

@@ -18,7 +18,7 @@ GroundEffectDoodadDB gGroundEffectDoodadDB;
GroundEffectTextureDB gGroundEffectTextureDB;
LiquidTypeDB gLiquidTypeDB;
void OpenDBs(std:: shared_ptr<BlizzardArchive::ClientData> clientData)
void OpenDBs(std::shared_ptr<BlizzardArchive::ClientData> clientData)
{
gAreaDB.open(clientData);
gMapDB.open(clientData);

View File

@@ -211,7 +211,7 @@ MapChunk::MapChunk(MapTile* maintile, BlizzardArchive::ClientFile* f, bool bigAl
}
}
// - MCSH ----------------------------------------------
if(header.ofsShadow && header.sizeShadow)
if((header_flags.flags.has_mcsh) && header.ofsShadow && header.sizeShadow)
{
f->seek(base + header.ofsShadow);
f->read(&fourcc, 4);
@@ -219,14 +219,14 @@ MapChunk::MapChunk(MapTile* maintile, BlizzardArchive::ClientFile* f, bool bigAl
assert(fourcc == 'MCSH');
uint8_t compressed_shadow_map[64 * 64 / 8];
char compressed_shadow_map[64 * 64 / 8];
// shadow map 64 x 64
f->read(compressed_shadow_map, 0x200);
f->read(&compressed_shadow_map, 0x200);
f->seekRelative(-0x200);
uint8_t *p, *c;
uint8_t *p;
char *c;
p = _shadow_map;
c = compressed_shadow_map;
for (int i = 0; i<64 * 8; ++i)

View File

@@ -2815,7 +2815,7 @@ void MapView::saveMinimap(MinimapRenderSettings* settings)
_main_window->statusBar()->addPermanentWidget(cancel_btn);
connect(this, &MapView::updateProgress, progress, &QProgressBar::setValue);
//connect(this, &MapView::updateProgress, progress, &QProgressBar::setValue);
// setup combined image if necessary
if (settings->combined_minimap)

View File

@@ -123,7 +123,7 @@ MapIndex::MapIndex (const std::string &pBasename, int map_id, World* world,
adt_filename << "World\\Maps\\" << basename << "\\" << basename << "_" << i << "_" << j << ".adt";
mTiles[j][i].tile = nullptr;
mTiles[j][i].onDisc = BlizzardArchive::ClientData::existsOnDisk(adt_filename.str());
mTiles[j][i].onDisc = Noggit::Application::NoggitApplication::instance()->clientData()->existsOnDisk(adt_filename.str());
if (mTiles[j][i].onDisc && !(mTiles[j][i].flags & 1))
{

View File

@@ -287,7 +287,7 @@ namespace Noggit::Project
project->ClientDatabase = std::make_shared<BlizzardDatabaseLib::BlizzardDatabase>(
dbcFileDirectory, dbdFileDirectory, clientBuild);
project->ClientData = std::make_shared<BlizzardArchive::ClientData>(
project->ClientPath, clientArchiveVersion, clientArchiveLocale, std::string(""));
project->ClientPath, clientArchiveVersion, clientArchiveLocale, std::string((projectPath / "export").generic_string()));
return std::make_shared<NoggitProject>(project.value());

View File

@@ -65,7 +65,7 @@ void TileRender::draw (OpenGL::Scoped::use_program& mcnk_shader
static constexpr unsigned NUM_SAMPLERS = 11;
if (!_map_tile->finished)
if (!_map_tile->finished.load())
[[unlikely]]
{
return;

View File

@@ -93,7 +93,6 @@ namespace Noggit::Rendering
void updateLightingUniformBlock(bool draw_fog, glm::vec3 const& camera_pos);
void updateLightingUniformBlockMinimap(MinimapRenderSettings* settings);
void setupChunkVAO(OpenGL::Scoped::use_program& mcnk_shader);
void setupLiquidChunkVAO(OpenGL::Scoped::use_program& water_shader);
void setupOccluderBuffers();