Rework to weak_ptr from lots of shared_ptr.

This commit is contained in:
Sebastian
2024-12-03 01:25:49 +01:00
parent 722848d46b
commit 0040956801
10 changed files with 171 additions and 191 deletions
+13 -4
View File
@@ -1,6 +1,7 @@
#pragma once
#include <raylib.h>
#include <string>
#include "moveable.h"
#include "node.h"
@@ -15,11 +16,11 @@ namespace VISEQ::SIGNAL {
Signal() {}
Signal(Vec2Df position, float r, float _speed, Color color) : Movable(position, Vec2Df(0,0), _speed), radius(r), color(color) {}
NODES::SPTR_Node next;
NODES::SPTR_Node last;
EDGES::SPTR_Edge edge;
NODES::WPTR_Node next;
NODES::WPTR_Node last;
EDGES::WPTR_Edge edge;
NODES::SPTR_Node start;
NODES::WPTR_Node start;
bool at_target = false;
bool run = true;
@@ -34,6 +35,14 @@ namespace VISEQ::SIGNAL {
int midi_note_offset = 0;
int midi_cc_offset = 0;
void reset(){
toStart();
}
void toStart(){
position = start.lock()->position;
}
void update(double t_delta){
// 120px / 16th = 1920px / whole note