From 3a7578879fd5d5e2d7b1556948574aaf2863a5ca Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 9 Feb 2025 23:38:35 +0100 Subject: [PATCH] fix: RGBA8 data processor node not working correctly --- .../source/content/data_processor_nodes/other_nodes.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp index 99cf53323..011710a8a 100644 --- a/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes/other_nodes.cpp @@ -320,7 +320,7 @@ namespace hex::plugin::builtin { void drawNode() override { if (!m_texture.isValid() && !m_data.empty()) { - m_texture = ImGuiExt::Texture::fromImage(m_data.data(), m_data.size(), ImGuiExt::Texture::Filter::Nearest); + m_texture = ImGuiExt::Texture::fromBitmap(m_data.data(), m_data.size(), m_width, m_height, ImGuiExt::Texture::Filter::Nearest); } ImGui::Image(m_texture, scaled(ImVec2(m_texture.getAspectRatio() * 200, 200))); @@ -343,12 +343,15 @@ namespace hex::plugin::builtin { throwNodeError(hex::format("Image requires at least {} bytes of data, but only {} bytes are available", requiredBytes, rawData.size())); m_data = rawData; + m_width = width; + m_height = height; m_texture.reset(); } private: std::vector m_data; ImGuiExt::Texture m_texture; + u32 m_width, m_height; }; class NodeVisualizerByteDistribution : public dp::Node {