migrant a SDL3

This commit is contained in:
2025-03-27 08:14:37 +01:00
parent a9c869baf6
commit d2286905dc
83 changed files with 570 additions and 541 deletions

View File

@@ -5,9 +5,9 @@
#include <utility> // Para move
// Devuelve un vector con los puntos que conforman la ruta
std::vector<SDL_Point> createPath(int start, int end, PathType type, int fixed_pos, int steps, const std::function<double(double)> &easingFunction)
std::vector<SDL_FPoint> createPath(float start, float end, PathType type, float fixed_pos, int steps, const std::function<double(double)> &easingFunction)
{
std::vector<SDL_Point> v;
std::vector<SDL_FPoint> v;
v.reserve(steps);
for (int i = 0; i < steps; ++i)
@@ -23,10 +23,10 @@ std::vector<SDL_Point> createPath(int start, int end, PathType type, int fixed_p
switch (type)
{
case PathType::HORIZONTAL:
v.emplace_back(SDL_Point{static_cast<int>(value), fixed_pos});
v.emplace_back(SDL_FPoint{static_cast<float>(value), fixed_pos});
break;
case PathType::VERTICAL:
v.emplace_back(SDL_Point{fixed_pos, static_cast<int>(value)});
v.emplace_back(SDL_FPoint{fixed_pos, static_cast<float>(value)});
break;
default:
break;
@@ -93,7 +93,7 @@ void PathSprite::addPath(int start, int end, PathType type, int fixed_pos, int s
}
// Añade un recorrido
void PathSprite::addPath(std::vector<SDL_Point> spots, int waiting_counter)
void PathSprite::addPath(std::vector<SDL_FPoint> spots, int waiting_counter)
{
paths_.emplace_back(std::move(spots), waiting_counter);
}