diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index 2dee50e87..1530923b8 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -259,6 +259,7 @@ "hex.builtin.nodes.constants.rgba8.output.b": "Blue", "hex.builtin.nodes.constants.rgba8.output.g": "Green", "hex.builtin.nodes.constants.rgba8.output.r": "Red", + "hex.builtin.nodes.constants.rgba8.output.color": "RGBA8", "hex.builtin.nodes.constants.string": "String", "hex.builtin.nodes.constants.string.header": "String", "hex.builtin.nodes.control_flow": "Control flow", diff --git a/plugins/builtin/source/content/data_processor_nodes/basic_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes/basic_nodes.cpp index ae8c192e8..ab3a5ce79 100644 --- a/plugins/builtin/source/content/data_processor_nodes/basic_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes/basic_nodes.cpp @@ -144,10 +144,13 @@ namespace hex::plugin::builtin { class NodeRGBA8 : public dp::Node { public: NodeRGBA8() : Node("hex.builtin.nodes.constants.rgba8.header", - { dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.r"), + { + dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.r"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.g"), dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.b"), - dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.a") }) { } + dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Integer, "hex.builtin.nodes.constants.rgba8.output.a"), + dp::Attribute(dp::Attribute::IOType::Out, dp::Attribute::Type::Buffer, "hex.builtin.nodes.constants.rgba8.output.color"), + }) { } void drawNode() override { ImGui::PushItemWidth(200_scaled); @@ -156,10 +159,18 @@ namespace hex::plugin::builtin { } void process() override { - this->setBufferOnOutput(0, wolv::util::toBytes(u8(m_color.Value.x * 0xFF))); - this->setBufferOnOutput(1, wolv::util::toBytes(u8(m_color.Value.y * 0xFF))); - this->setBufferOnOutput(2, wolv::util::toBytes(u8(m_color.Value.z * 0xFF))); - this->setBufferOnOutput(3, wolv::util::toBytes(u8(m_color.Value.w * 0xFF))); + this->setIntegerOnOutput(0, u8(m_color.Value.x * 0xFF)); + this->setIntegerOnOutput(1, u8(m_color.Value.y * 0xFF)); + this->setIntegerOnOutput(2, u8(m_color.Value.z * 0xFF)); + this->setIntegerOnOutput(3, u8(m_color.Value.w * 0xFF)); + + std::array buffer = { + u8(m_color.Value.x * 0xFF), + u8(m_color.Value.y * 0xFF), + u8(m_color.Value.z * 0xFF), + u8(m_color.Value.w * 0xFF) + }; + this->setBufferOnOutput(4, buffer); } void store(nlohmann::json &j) const override {