diff --git a/lib/graphics_engine/include/ge_render_info.hpp b/lib/graphics_engine/include/ge_render_info.hpp index bbe44a39c..f65bc7ce9 100644 --- a/lib/graphics_engine/include/ge_render_info.hpp +++ b/lib/graphics_engine/include/ge_render_info.hpp @@ -25,6 +25,8 @@ #ifndef HEADER_GE_RENDER_INFO_HPP #define HEADER_GE_RENDER_INFO_HPP +#include "SColor.h" + namespace GE { @@ -35,12 +37,14 @@ private: bool m_transparent; + irr::video::SColor m_vertex_color; public: // ------------------------------------------------------------------------ GERenderInfo(float hue = 0.0f, bool transparent = false) { m_hue = hue; m_transparent = transparent; + m_vertex_color = (irr::video::SColor)-1; } // ------------------------------------------------------------------------ void setHue(float hue) { m_hue = hue; } @@ -50,6 +54,8 @@ public: float getHue() const { return m_hue; } // ------------------------------------------------------------------------ bool isTransparent() const { return m_transparent; } + // ------------------------------------------------------------------------ + irr::video::SColor& getVertexColor() { return m_vertex_color; } }; // GERenderInfo diff --git a/lib/graphics_engine/src/ge_vulkan_draw_call.cpp b/lib/graphics_engine/src/ge_vulkan_draw_call.cpp index cde72b919..ee8fd08fc 100644 --- a/lib/graphics_engine/src/ge_vulkan_draw_call.cpp +++ b/lib/graphics_engine/src/ge_vulkan_draw_call.cpp @@ -70,7 +70,10 @@ void ObjectData::init(irr::scene::ISceneNode* node, int material_id, m_hue_change = ri->getHue(); else m_hue_change = 0.0f; - m_custom_vertex_color = irr::video::SColor((uint32_t)-1); + if (ri) + m_custom_vertex_color = ri->getVertexColor(); + else + m_custom_vertex_color = irr::video::SColor((uint32_t)-1); } // init // ============================================================================