Change from DrawCircleV to Circle::draw

This commit is contained in:
Nikola Petrov 2024-12-21 11:33:25 +01:00
parent 6661a71271
commit 8d4562edf6
2 changed files with 10 additions and 3 deletions

View File

@ -22,6 +22,7 @@ void BackGround::deinit()
void BackGround::draw(Dna *dna)
{
Circle::setSoftEdge(true);
m_dna = dna;
mountenSeed = dna->mountenSeed;
starSeed = dna->starSeed;

View File

@ -1,8 +1,11 @@
#include <cmath>
#include "canvas/Tree.hpp"
#include "canvas/Circle.hpp"
#include "Math.hpp"
#include <raylib.h>
#include <raymath.h>
#include "canvas/Tree.hpp"
#include "Math.hpp"
// Public
void Tree::init(int size)
@ -14,6 +17,8 @@ void Tree::init(int size)
void Tree::draw(Dna *dna)
{
Circle::setSoftEdge(false);
m_dna = dna;
draw_calls.push_back({start, 0, (float)size / 4, 1});
@ -43,7 +48,8 @@ Vector2 Tree::drawLine()
{
Vector2 point = Vector2Lerp(arg.start, end, i);
Color color = ColorLerp(m_dna->branches[arg.dep - 1].color, m_dna->branches[arg.dep].color, i);
DrawCircleV(point, thick, color); // TODO Change to use shader
Circle::setColor(color);
Circle::draw(point.x, point.y, thick); // TODO Change to BeginShaderMode and EndShaderMode only onece
}
return end;
}