Skip to content

Commit fbde116

Browse files
authored
Merge branch 'master' into xtex-202403
2 parents fb2350d + 6fbbf89 commit fbde116

File tree

78 files changed

+2555
-618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2555
-618
lines changed

.gitmodules

+10-5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
path = lib/third_party/jthread/jthread
2323
url = https://github.com/josuttis/jthread
2424
ignore = dirty
25+
url = https://github.com/WerWolv/HashLibPlus
26+
[submodule "lib/third_party/edlib"]
27+
path = lib/third_party/edlib
28+
url = https://github.com/Martinsos/edlib
29+
ignore = dirty
30+
[submodule "lib/third_party/lunasvg"]
31+
path = lib/third_party/lunasvg
32+
url = https://github.com/sammycage/lunasvg
33+
ignore = dirty
2534

2635
[submodule "lib/external/libromfs"]
2736
path = lib/external/libromfs
@@ -34,8 +43,4 @@
3443
url = https://github.com/WerWolv/libwolv
3544

3645
[submodule "lib/third_party/HashLibPlus"]
37-
path = lib/third_party/HashLibPlus
38-
url = https://github.com/WerWolv/HashLibPlus
39-
[submodule "lib/third_party/edlib"]
40-
path = lib/third_party/edlib
41-
url = https://github.com/Martinsos/edlib
46+
path = lib/third_party/HashLibPlus

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<a href="https://imhex.werwolv.net">
22
<h1 align="center">
33
<picture>
4-
<source media="(prefers-color-scheme: dark)" srcset="./resources/projects/logo_text_light.svg">
5-
<img height="100px" src="./resources/projects/logo_text_dark.svg">
4+
<img height="300px" src="./resources/dist/common/logo/ImHexLogoSVGBG.svg">
65
</picture>
76
</h1>
87
</a>

cmake/build_helpers.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,14 @@ macro(addBundledLibraries)
596596
set(NLOHMANN_JSON_LIBRARIES nlohmann_json::nlohmann_json)
597597
endif()
598598

599+
if (NOT USE_SYSTEM_LUNASVG)
600+
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
601+
set(LUNASVG_LIBRARIES lunasvg)
602+
else()
603+
find_package(LunaSVG REQUIRED)
604+
set(LUNASVG_LIBRARIES lunasvg)
605+
endif()
606+
599607
if (NOT USE_SYSTEM_LLVM)
600608
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/llvm-demangle EXCLUDE_FROM_ALL)
601609
else()

cmake/sdk/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ add_subdirectory(lib/libimhex)
4444
if (WIN32)
4545
set_target_properties(libimhex PROPERTIES
4646
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.dll"
47-
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibimhex.dll.a"
47+
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex.dll.a"
4848
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
4949
elseif (APPLE)
5050
file(GLOB LIBIMHEX_DYLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../Frameworks/libimhex.*.dylib")

lib/external/pattern_language

Submodule pattern_language updated 42 files

lib/libimhex/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.16)
22
project(libimhex)
33

44
set(CMAKE_CXX_STANDARD 23)
5-
set(CMAKE_SHARED_LIBRARY_PREFIX "")
65

76
set(LIBIMHEX_SOURCES
87
source/api/imhex_api.cpp
@@ -143,11 +142,12 @@ if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
143142
precompileHeaders(libimhex "${CMAKE_CURRENT_SOURCE_DIR}/include")
144143
endif()
145144

146-
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES})
145+
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} ${LUNASVG_LIBRARIES})
147146

148147
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
149148

150149
add_dependencies(imhex_all libimhex)
151150

152151
install(FILES "$<TARGET_FILE:libimhex>" DESTINATION "${CMAKE_INSTALL_LIBDIR}" PERMISSIONS ${LIBRARY_PERMISSIONS})
153152
set_target_properties(libimhex PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
153+
set_target_properties(libimhex PROPERTIES PREFIX "")

lib/libimhex/include/hex/api/achievement_manager.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace hex {
151151
if (m_icon.isValid())
152152
return m_icon;
153153

154-
m_icon = ImGuiExt::Texture(m_iconData.data(), m_iconData.size(), ImGuiExt::Texture::Filter::Linear);
154+
m_icon = ImGuiExt::Texture::fromImage(m_iconData.data(), m_iconData.size(), ImGuiExt::Texture::Filter::Linear);
155155

156156
return m_icon;
157157
}

lib/libimhex/include/hex/ui/imgui_imhex_extensions.h

+15-8
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,21 @@ namespace ImGuiExt {
7676
};
7777

7878
Texture() = default;
79-
Texture(const ImU8 *buffer, int size, Filter filter = Filter::Nearest, int width = 0, int height = 0);
80-
Texture(std::span<const std::byte> bytes, Filter filter = Filter::Nearest, int width = 0, int height = 0);
81-
explicit Texture(const char *path, Filter filter = Filter::Nearest);
82-
explicit Texture(const std::fs::path &path, Filter filter = Filter::Nearest);
83-
Texture(unsigned int texture, int width, int height);
8479
Texture(const Texture&) = delete;
8580
Texture(Texture&& other) noexcept;
8681

82+
static Texture fromImage(const ImU8 *buffer, int size, Filter filter = Filter::Nearest);
83+
static Texture fromImage(std::span<const std::byte> buffer, Filter filter = Filter::Nearest);
84+
static Texture fromImage(const char *path, Filter filter = Filter::Nearest);
85+
static Texture fromImage(const std::fs::path &path, Filter filter = Filter::Nearest);
86+
static Texture fromGLTexture(unsigned int texture, int width, int height);
87+
static Texture fromBitmap(const ImU8 *buffer, int size, int width, int height, Filter filter = Filter::Nearest);
88+
static Texture fromBitmap(std::span<const std::byte> buffer, int width, int height, Filter filter = Filter::Nearest);
89+
static Texture fromSVG(const char *path, int width = 0, int height = 0, Filter filter = Filter::Nearest);
90+
static Texture fromSVG(const std::fs::path &path, int width = 0, int height = 0, Filter filter = Filter::Nearest);
91+
static Texture fromSVG(std::span<const std::byte> buffer, int width = 0, int height = 0, Filter filter = Filter::Nearest);
92+
93+
8794
~Texture();
8895

8996
Texture& operator=(const Texture&) = delete;
@@ -187,8 +194,8 @@ namespace ImGuiExt {
187194
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2());
188195
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4());
189196

190-
ImGui::PushItemWidth(-FLT_MIN);
191-
ImGui::InputText("##", const_cast<char *>(text.c_str()), text.size(), ImGuiInputTextFlags_ReadOnly);
197+
ImGui::PushItemWidth(ImGui::CalcTextSize(text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2);
198+
ImGui::InputText("##", const_cast<char *>(text.c_str()), text.size(), ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_NoHorizontalScroll);
192199
ImGui::PopItemWidth();
193200

194201
ImGui::PopStyleColor();
@@ -222,7 +229,7 @@ namespace ImGuiExt {
222229
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2());
223230
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4());
224231

225-
ImGui::PushItemWidth(-FLT_MIN);
232+
ImGui::PushItemWidth(ImGui::CalcTextSize(text.c_str()).x + ImGui::GetStyle().FramePadding.x * 2);
226233
ImGui::InputTextMultiline(
227234
"##",
228235
const_cast<char *>(text.c_str()),

lib/libimhex/include/hex/ui/view.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ namespace hex {
178178
ImGui::EndPopup();
179179
}
180180

181-
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape)))
181+
if (ImGui::IsKeyPressed(ImGuiKey_Escape))
182182
this->getWindowOpenState() = false;
183183
}
184184
}

lib/libimhex/source/api/theme_manager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace hex {
1717
AutoReset<std::string> s_imageTheme;
1818
AutoReset<std::string> s_currTheme;
1919

20-
std::mutex s_themeMutex;
20+
std::recursive_mutex s_themeMutex;
2121
}
2222

2323

0 commit comments

Comments
 (0)