Merge branch 'noggit-shadowlands' of https://gitlab.com/prophecy-rp/noggit-red into noggit-shadowlands

This commit is contained in:
Alister
2021-12-13 22:51:54 +00:00
9 changed files with 13 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
// This file is part of Noggit3, licensed under GNU General Public License (version 3).
#include <noggit/alphamap.hpp>
#include <noggit/Alphamap.hpp>
#include <opengl/context.hpp>
#include <opengl/context.inl>
#include <ClientFile.hpp>

View File

@@ -19,9 +19,12 @@ public:
void setAlpha(size_t offset, unsigned char value);
void setAlpha(unsigned char *pAmap);
[[nodiscard]]
unsigned char getAlpha(size_t offset) const;
const unsigned char *getAlpha();
[[nodiscard]]
std::vector<uint8_t> compress() const;
private:

View File

@@ -21,7 +21,7 @@ struct pair_hash
std::size_t operator() (const std::pair<int, BlizzardArchive::Listfile::FileKey> &p) const noexcept
{
auto h1 = std::hash<int>{}(p.first);
auto h2 = std::hash<std::string>{}(p.second.filepath());
auto h2 = std::hash<std::string>{}(p.second.hasFilepath() ? p.second.filepath() : "");
auto h3 = std::hash<int>{}(p.second.fileDataID());
return h1 ^ h2 ^ h3;

View File

@@ -4,7 +4,6 @@
#include <opengl/context.inl>
#include <noggit/DBC.h>
#include <noggit/application/NoggitApplication.hpp>
#include <glm/vec2.hpp>
LiquidTextureManager::LiquidTextureManager(Noggit::NoggitRenderContext context)
: _context(context)
@@ -43,7 +42,7 @@ void LiquidTextureManager::upload()
}
catch (...) // fallback for malformed DBC
{
filename = "XTextures\\river\\lake_a.%d.blp";
filename = "XTextures\\river\\lake_a.";
}
}
@@ -54,7 +53,7 @@ void LiquidTextureManager::upload()
// init 2D texture array
// loading a texture is required to get its dimensions and format
blp_texture tex(string_format(filename,1), _context);
blp_texture tex(filename + "1.blp", _context);
tex.finishLoading();
int width_ = tex.width();
@@ -91,13 +90,13 @@ void LiquidTextureManager::upload()
unsigned n_frames = 30;
for (int j = 0; j < N_FRAMES; ++j)
{
if (!NOGGIT_APP->clientData()->exists(string_format(filename, (j + 1))))
if (!NOGGIT_APP->clientData()->exists(filename + std::to_string((j + 1)) + ".blp"))
{
n_frames = j;
break;
}
blp_texture tex_frame(string_format(filename, (j + 1)), _context);
blp_texture tex_frame(filename + std::to_string(j + 1) + ".blp", _context);
tex_frame.finishLoading();
// error checking

View File

@@ -7,7 +7,7 @@
#include <noggit/MapHeaders.h>
#include <noggit/Misc.h>
#include <noggit/World.h>
#include <noggit/alphamap.hpp>
#include <noggit/Alphamap.hpp>
#include <noggit/texture_set.hpp>
#include <noggit/tool_enums.hpp>
#include <noggit/ui/TexturingGUI.h>

View File

@@ -9,7 +9,7 @@
#include <noggit/TileWater.hpp>
#include <noggit/WMOInstance.h> // WMOInstance
#include <noggit/World.h>
#include <noggit/alphamap.hpp>
#include <noggit/Alphamap.hpp>
#include <noggit/texture_set.hpp>
#include <noggit/ui/TexturingGUI.h>
#include <noggit/application/NoggitApplication.hpp>

View File

@@ -4598,4 +4598,3 @@ void World::setupOccluderBuffers()
}
#undef BOOST_POOL_NO_MT

View File

@@ -2,7 +2,7 @@
#pragma once
#include <noggit/alphamap.hpp>
#include <noggit/Alphamap.hpp>
#include <noggit/MapHeaders.h>
#include <noggit/ContextObject.hpp>