Merge remote-tracking branch 'origin/noggit-shadowlands' into noggit-shadowlands
This commit is contained in:
@@ -95,22 +95,15 @@ IF(VALIDATE_OPENGL_PROGRAMS)
|
||||
ENDIF()
|
||||
|
||||
includePlatform("prefind")
|
||||
|
||||
# Dependency: Lua
|
||||
FIND_PACKAGE(Lua REQUIRED)
|
||||
ADD_LIBRARY(Lua-Lua INTERFACE)
|
||||
ADD_LIBRARY(Lua::Lua ALIAS Lua-Lua)
|
||||
TARGET_LINK_LIBRARIES(Lua-Lua INTERFACE ${LUA_LIBRARIES})
|
||||
TARGET_INCLUDE_DIRECTORIES(Lua-Lua INTERFACE ${LUA_INCLUDE_DIR})
|
||||
|
||||
FIND_PACKAGE(StormLib REQUIRED)
|
||||
FIND_PACKAGE(CascLib REQUIRED)
|
||||
#External packages
|
||||
FIND_PACKAGE(OpenGL REQUIRED)
|
||||
FIND_PACKAGE(Json REQUIRED)
|
||||
FIND_PACKAGE(lodepng REQUIRED)
|
||||
FIND_PACKAGE(FastNoise2 REQUIRED)
|
||||
FIND_PACKAGE(StormLib REQUIRED)
|
||||
FIND_PACKAGE(CascLib REQUIRED)
|
||||
FIND_PACKAGE(Sol2 REQUIRED)
|
||||
FIND_PACKAGE(Boost 1.60 COMPONENTS system REQUIRED)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets OpenGL OpenGLExtensions Network Xml REQUIRED)
|
||||
|
||||
IF(USE_SQL)
|
||||
@@ -137,7 +130,6 @@ ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/qtimgui")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/QtAdvancedDockingSystem")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/NodeEditor")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/libnoise")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/blizzard-database-library")
|
||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/glm")
|
||||
|
||||
# Add the found include directories to our include list.
|
||||
@@ -217,6 +209,7 @@ collect_files(imguipiemenu_sources src/external/imguipiemenu FALSE "*.c;*.cpp;"
|
||||
collect_files(gradienteditor_sources src/external/qtgradienteditor FALSE "*.c;*.cpp;" "")
|
||||
collect_files(tracy_sources src/external/tracy FALSE "*.c;*.cpp;" "")
|
||||
collect_files(archive_sources src/external/blizzard-archive-library/src FALSE "*.c;*.cpp;" "")
|
||||
collect_files(database_sources src/external/blizzard-database-library/src TRUE "*.c;*.cpp;" "")
|
||||
|
||||
SET(util_sources src/util/exception_to_string.cpp)
|
||||
|
||||
@@ -244,14 +237,14 @@ collect_files(imguipiemenu_headers src/external/imguipiemenu FALSE "*.h;*.hpp" "
|
||||
collect_files(gradienteditor_headers src/external/qtgradienteditor FALSE "*.h;*.hpp" "")
|
||||
collect_files(tracy_headers src/external/tracy FALSE "*.h;*.hpp" "")
|
||||
collect_files(archive_headers src/external/blizzard-archive-library/include FALSE "*.h;*.hpp" "")
|
||||
|
||||
collect_files(database_headers src/external/blizzard-database-library/include TRUE "*.h;*.hpp" "")
|
||||
IF(WIN32)
|
||||
SET(os_sources include/win/StackWalker.cpp)
|
||||
SET(os_headers include/win/StackWalker.h)
|
||||
ENDIF(WIN32)
|
||||
|
||||
collect_files(resource_files resources FALSE "*.qrc" "")
|
||||
qt5_add_resources (compiled_resource_files ${resource_files})
|
||||
qt5_add_resources(compiled_resource_files ${resource_files})
|
||||
collect_files(ui_files src TRUE "*.ui" "")
|
||||
qt5_wrap_ui(compiled_ui_files ${ui_files})
|
||||
|
||||
@@ -294,6 +287,8 @@ assign_source_group(
|
||||
${tracy_headers}
|
||||
${archive_sources}
|
||||
${archive_headers}
|
||||
${database_sources}
|
||||
${database_headers}
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(noggit
|
||||
@@ -311,6 +306,8 @@ ADD_EXECUTABLE(noggit
|
||||
${noggit_ui_sources}
|
||||
${noggit_scripting_sources}
|
||||
${opengl_sources}
|
||||
${database_sources}
|
||||
${database_headers}
|
||||
${math_sources}
|
||||
${external_sources}
|
||||
${mysql_sources}
|
||||
@@ -348,10 +345,8 @@ ADD_EXECUTABLE(noggit
|
||||
|
||||
TARGET_LINK_LIBRARIES (noggit
|
||||
${OPENGL_LIBRARIES}
|
||||
BlizzardDatabaseLib
|
||||
StormLib
|
||||
CascLib
|
||||
Boost::system
|
||||
Qt5::Widgets
|
||||
Qt5::OpenGL
|
||||
Qt5::OpenGLExtensions
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// This file is part of Noggit3, licensed under GNU General Public License (version 3).
|
||||
|
||||
#include "LiquidTextureManager.hpp"
|
||||
|
||||
#include <opengl/context.inl>
|
||||
#include <noggit/DBC.h>
|
||||
#include <noggit/application/NoggitApplication.hpp>
|
||||
|
||||
@@ -10,6 +10,17 @@
|
||||
#include <tuple>
|
||||
#include <glm/vec2.hpp>
|
||||
|
||||
template<typename ... Args>
|
||||
std::string string_format(const std::string& format, Args ... args)
|
||||
{
|
||||
int size_s = std::snprintf(nullptr, 0, format.c_str(), args ...) + 1; // Extra space for '\0'
|
||||
if (size_s <= 0) { throw std::runtime_error("Error during formatting."); }
|
||||
auto size = static_cast<size_t>(size_s);
|
||||
auto buf = std::make_unique<char[]>(size);
|
||||
std::snprintf(buf.get(), size, format.c_str(), args ...);
|
||||
return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside
|
||||
}
|
||||
|
||||
class LiquidTextureManager
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,12 +23,10 @@
|
||||
#include <noggit/application/NoggitApplication.hpp>
|
||||
#include <opengl/scoped.hpp>
|
||||
#include <opengl/shader.hpp>
|
||||
|
||||
#include <noggit/ActionManager.hpp>
|
||||
|
||||
#include <external/PNG2BLP/Png2Blp.h>
|
||||
#include <external/tracy/Tracy.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include <QDir>
|
||||
#include <QBuffer>
|
||||
@@ -36,7 +34,6 @@
|
||||
#include <QPixmap>
|
||||
#include <QImage>
|
||||
#include <QTransform>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <ctime>
|
||||
@@ -1684,7 +1681,7 @@ void World::draw (glm::mat4x4 const& model_view
|
||||
|
||||
models_to_draw.clear();
|
||||
wmos_to_draw.clear();
|
||||
|
||||
|
||||
if(draw_models_with_box || (draw_hidden_models && !model_boxes_to_draw.empty()))
|
||||
{
|
||||
OpenGL::Scoped::use_program m2_box_shader{ *_m2_box_program.get() };
|
||||
@@ -2590,15 +2587,10 @@ bool World::saveMinimap(tile_index const& tile_idx, MinimapRenderSettings* setti
|
||||
// Register in md5translate.trs
|
||||
std::string map_name = gMapDB.getByID(mapIndex._map_id).getString(MapDB::InternalName);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << map_name;
|
||||
ss << "\\map";
|
||||
ss << std::setw(2) << std::setfill('0') << tile_idx.x;
|
||||
ss << "_";
|
||||
ss << std::setw(2) << std::setfill('0') << tile_idx.z;
|
||||
ss << ".blp";
|
||||
|
||||
mapIndex._minimap_md5translate[map_name][ss.str()] = tex_name;
|
||||
auto sstream = std::stringstream();
|
||||
sstream << map_name << "\\map" << std::setfill('0') << std::setw(2) << tile_idx.x << "_" << std::setfill('0') << std::setw(2) << tile_idx.z << ".blp";
|
||||
std::string tilename_left = sstream.str();
|
||||
mapIndex._minimap_md5translate[map_name][tilename_left] = tex_name;
|
||||
|
||||
if (unload)
|
||||
{
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include <noggit/tile_index.hpp>
|
||||
#include <noggit/ContextObject.hpp>
|
||||
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
#include <ranges>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
@@ -126,12 +125,9 @@ public:
|
||||
};
|
||||
|
||||
template<bool Load>
|
||||
auto tiles ( std::function<bool (tile_index const&, MapTile*)> pred
|
||||
= [] (tile_index const&, MapTile*) { return true; }
|
||||
)
|
||||
auto tiles (std::function<bool (tile_index const&, MapTile*)> pred= [] (tile_index const&, MapTile*) { return true; } )
|
||||
{
|
||||
return boost::make_iterator_range
|
||||
(tile_iterator<Load> {this, {0, 0}, pred}, tile_iterator<Load>{});
|
||||
return std::ranges::subrange(tile_iterator<Load> {this, { 0, 0 }, pred}, tile_iterator<Load>{});
|
||||
}
|
||||
|
||||
auto loaded_tiles()
|
||||
|
||||
Reference in New Issue
Block a user