json serialization beginnings, but still much to do
This commit is contained in:
@@ -41,7 +41,7 @@ class SignalManager{
|
||||
|
||||
void reset(){
|
||||
for(auto &s : signals){
|
||||
s->position = s->start->position + Vec2D<float>{0.1, 0.1};
|
||||
s->position = s->start->position + Vec2Df{0.1, 0.1};
|
||||
s->next = s->start;
|
||||
s->last = s->start;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class SignalManager{
|
||||
|
||||
void addSignalAtNode(SPTR_Node node){
|
||||
Color c = {(unsigned char)(20 + (rand() % 200)), 100, (unsigned char)(20 + (int)(rand() % 200)), 200};
|
||||
signals.emplace_back(std::make_shared<Signal>(node->position + Vec2D<float>{0.5f, 0.5f}, 8.0f, 0, c)); // position + 1 or else it does not render. why? no idea!
|
||||
signals.emplace_back(std::make_shared<Signal>(node->position + Vec2Df{0.5f, 0.5f}, 8.0f, 0, c)); // position + 1 or else it does not render. why? no idea!
|
||||
signals.back()->next = node;
|
||||
signals.back()->last = node;
|
||||
signals.back()->start = node;
|
||||
@@ -105,7 +105,7 @@ class SignalManager{
|
||||
}
|
||||
}
|
||||
|
||||
void drawSignals(Vec2D<float> mouse_pos, Camera2D camera){
|
||||
void drawSignals(Vec2Df mouse_pos, Camera2D camera){
|
||||
for(auto s : signals){
|
||||
mutex->lock();
|
||||
s->draw(mouse_pos, camera);
|
||||
|
||||
Reference in New Issue
Block a user