mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6b24dfd29 | ||
|
|
041f113402 | ||
|
|
5f61fe2c4f | ||
|
|
96cc7e8ba8 | ||
|
|
22b3daf082 | ||
|
|
1deb27a6df |
@@ -260,9 +260,6 @@ namespace ImGuiExt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Texture::Texture(Texture&& other) noexcept {
|
Texture::Texture(Texture&& other) noexcept {
|
||||||
if (m_textureId != 0)
|
|
||||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
|
||||||
|
|
||||||
m_textureId = other.m_textureId;
|
m_textureId = other.m_textureId;
|
||||||
m_width = other.m_width;
|
m_width = other.m_width;
|
||||||
m_height = other.m_height;
|
m_height = other.m_height;
|
||||||
@@ -271,8 +268,10 @@ namespace ImGuiExt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Texture& Texture::operator=(Texture&& other) noexcept {
|
Texture& Texture::operator=(Texture&& other) noexcept {
|
||||||
if (m_textureId != 0)
|
if (this == &other)
|
||||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
return *this;
|
||||||
|
|
||||||
|
this->reset();
|
||||||
|
|
||||||
m_textureId = other.m_textureId;
|
m_textureId = other.m_textureId;
|
||||||
m_width = other.m_width;
|
m_width = other.m_width;
|
||||||
@@ -288,6 +287,11 @@ namespace ImGuiExt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Texture::reset() {
|
void Texture::reset() {
|
||||||
|
#if !defined(OS_WEB)
|
||||||
|
if (glDeleteTextures == nullptr)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_textureId != 0) {
|
if (m_textureId != 0) {
|
||||||
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
|
||||||
m_textureId = 0;
|
m_textureId = 0;
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ namespace hex {
|
|||||||
|
|
||||||
{
|
{
|
||||||
std::unique_lock lock(m_sleepMutex);
|
std::unique_lock lock(m_sleepMutex);
|
||||||
m_sleepCondVar.wait_for(lock, std::chrono::microseconds(100));
|
m_sleepCondVar.wait(lock);
|
||||||
if (m_sleepFlag.exchange(false))
|
if (m_sleepFlag.exchange(false))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1233,6 +1233,7 @@ namespace hex {
|
|||||||
m_wakeupCondVar.wait_for(lock, requestedFrameTime, [&] {
|
m_wakeupCondVar.wait_for(lock, requestedFrameTime, [&] {
|
||||||
return m_wakeupFlag || stopToken.stop_requested();
|
return m_wakeupFlag || stopToken.stop_requested();
|
||||||
});
|
});
|
||||||
|
m_wakeupFlag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
endTime = std::chrono::steady_clock::now();
|
endTime = std::chrono::steady_clock::now();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <hex/api/localization_manager.hpp>
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
#include <hex/helpers/logger.hpp>
|
#include <hex/helpers/logger.hpp>
|
||||||
|
#include <hex/helpers/menu_items.hpp>
|
||||||
#include <hex/ui/imgui_imhex_extensions.h>
|
#include <hex/ui/imgui_imhex_extensions.h>
|
||||||
|
|
||||||
#include <loaders/dotnet/dotnet_loader.hpp>
|
#include <loaders/dotnet/dotnet_loader.hpp>
|
||||||
@@ -88,7 +89,7 @@ std::vector<const Script*> loadAllScripts() {
|
|||||||
hex::ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
|
hex::ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
|
||||||
static bool menuJustOpened = true;
|
static bool menuJustOpened = true;
|
||||||
|
|
||||||
if (ImGui::BeginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
|
if (menu::beginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
|
||||||
if (menuJustOpened) {
|
if (menuJustOpened) {
|
||||||
menuJustOpened = false;
|
menuJustOpened = false;
|
||||||
if (!updaterTask.isRunning()) {
|
if (!updaterTask.isRunning()) {
|
||||||
@@ -99,9 +100,9 @@ std::vector<const Script*> loadAllScripts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (updaterTask.isRunning()) {
|
if (updaterTask.isRunning()) {
|
||||||
ImGuiExt::TextSpinner("hex.script_loader.menu.loading"_lang);
|
menu::menuItem("hex.script_loader.menu.loading"_lang, Shortcut::None, false, false);
|
||||||
} else if (scripts.empty()) {
|
} else if (scripts.empty()) {
|
||||||
ImGui::TextUnformatted("hex.script_loader.menu.no_scripts"_lang);
|
menu::menuItem("hex.script_loader.menu.no_scripts"_lang, Shortcut::None, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &script : scripts) {
|
for (const auto &script : scripts) {
|
||||||
@@ -109,14 +110,14 @@ std::vector<const Script*> loadAllScripts() {
|
|||||||
if (background)
|
if (background)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ImGui::MenuItem(name.c_str(), loader->getTypeName().c_str())) {
|
if (menu::menuItem(name.c_str())) {
|
||||||
runnerTask = TaskManager::createTask("hex.script_loader.task.running", TaskManager::NoProgress, [entryPoint](auto&) {
|
runnerTask = TaskManager::createTask("hex.script_loader.task.running", TaskManager::NoProgress, [entryPoint](auto&) {
|
||||||
entryPoint();
|
entryPoint();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndMenu();
|
menu::endMenu();
|
||||||
} else {
|
} else {
|
||||||
menuJustOpened = true;
|
menuJustOpened = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user