build: Remove all static variables from headers to hopefully fix plugins

This commit is contained in:
WerWolv
2023-07-26 13:50:51 +02:00
parent 866c87b2bf
commit 27c8e19c14
31 changed files with 236 additions and 225 deletions

View File

@@ -7,9 +7,13 @@
namespace hex::dp {
int Node::s_idCounter = 1;
namespace {
Node::Node(std::string unlocalizedTitle, std::vector<Attribute> attributes) : m_id(Node::s_idCounter++), m_unlocalizedTitle(std::move(unlocalizedTitle)), m_attributes(std::move(attributes)) {
int s_idCounter = 1;
}
Node::Node(std::string unlocalizedTitle, std::vector<Attribute> attributes) : m_id(s_idCounter++), m_unlocalizedTitle(std::move(unlocalizedTitle)), m_attributes(std::move(attributes)) {
for (auto &attr : this->m_attributes)
attr.setParentNode(this);
}
@@ -136,4 +140,9 @@ namespace hex::dp {
this->m_overlay->getData() = data;
}
void Node::setIdCounter(int id) {
if (id > s_idCounter)
s_idCounter = id;
}
}