improving mixer

This commit is contained in:
2018-08-02 09:44:14 +02:00
parent 8a3760df9e
commit 12c1aa33c4
10 changed files with 71 additions and 51 deletions

View File

@@ -63,6 +63,7 @@ void NodePanelBrush::init()
brush->set_icon(path.c_str());
brush->m_brushID = count++;
brush->high_path = path_hi;
brush->brush_name = i;
brush->high_id = const_hash(path_hi.c_str());
m_brushes.push_back(brush);
brush->on_click = std::bind(&NodePanelBrush::handle_click, this, std::placeholders::_1);
@@ -82,6 +83,18 @@ void NodePanelBrush::handle_click(Node* target)
on_brush_changed(this, m_current->m_brushID);
}
int NodePanelBrush::find_brush(const std::string & name) const
{
for (int i = 0; i < m_brushes.size(); i++)
{
if (m_brushes[i]->brush_name.find(name) != std::string::npos)
{
return i;
}
}
return -1;
}
uint16_t NodePanelBrush::get_texture_id(int index) const
{
TextureManager::load(m_brushes[index]->high_path.c_str(), true);