Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions modules/renders/rendergl/src/resources/materialgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,6 @@ bool MaterialInstanceGL::bind(CommandBufferGL *buffer, uint32_t layer, uint32_t

uint8_t i = 0;

if(m_surfaceType == Material::Skinned) {
Texture *skinMatrices = texture(*buffer, SKIN_BIND);

if(skinMatrices) {
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, static_cast<TextureGL *>(skinMatrices)->nativeHandle());

i++;
}
}

for(auto &it : material->textures()) {
Texture *tex = texture(*buffer, it.binding);

Expand Down
4 changes: 3 additions & 1 deletion modules/uikit/includes/uisystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ class UiSystem : public System {
static void riseWidget(Widget *widget);
static void lowerWidget(Widget *widget);

static std::list<Widget *> &widgets();
static std::list<Widget *> widgets();

private:
void composeComponent(Component *component) const override;

private:
static std::list<Widget *> m_uiComponents;

static std::mutex m_mutex;

};

#endif // UISYSTEM_H
10 changes: 9 additions & 1 deletion modules/uikit/src/uisystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "pipelinetasks/guilayer.h"

std::list<Widget *> UiSystem::m_uiComponents;
std::mutex UiSystem::m_mutex;

UiSystem::UiSystem() :
System() {
Expand Down Expand Up @@ -99,6 +100,8 @@ UiSystem::~UiSystem() {

StyleSheet::unregisterClassFactory(Engine::resourceSystem());
UiDocument::unregisterClassFactory(Engine::resourceSystem());

m_uiComponents.clear();
}

void UiSystem::update(World *) {
Expand All @@ -111,28 +114,33 @@ int UiSystem::threadPolicy() const {
}

void UiSystem::addWidget(Widget *widget) {
std::lock_guard<std::mutex> lock(m_mutex);
m_uiComponents.push_back(widget);
}

void UiSystem::removeWidget(Widget *widget) {
std::lock_guard<std::mutex> lock(m_mutex);
m_uiComponents.remove(widget);
}

void UiSystem::riseWidget(Widget *widget) {
if(widget) {
std::lock_guard<std::mutex> lock(m_mutex);
m_uiComponents.remove(widget);
m_uiComponents.push_back(widget);
}
}

void UiSystem::lowerWidget(Widget *widget) {
if(widget) {
std::lock_guard<std::mutex> lock(m_mutex);
m_uiComponents.remove(widget);
m_uiComponents.push_front(widget);
}
}

std::list<Widget *> &UiSystem::widgets() {
std::list<Widget *> UiSystem::widgets() {
std::lock_guard<std::mutex> lock(m_mutex);
return m_uiComponents;
}

Expand Down
Loading