afegit resources.pack y prefixe a les rutes de recursos

This commit is contained in:
2025-12-08 21:48:52 +01:00
parent 4b7cbd88bb
commit a41e696b69
21 changed files with 1066 additions and 36 deletions

View File

@@ -8,6 +8,7 @@
#include <iostream>
#include "core/defaults.hpp"
#include "core/graphics/shape_loader.hpp"
#include "core/rendering/shape_renderer.hpp"
namespace Graphics {
@@ -21,11 +22,11 @@ Starfield::Starfield(SDL_Renderer* renderer,
punt_fuga_(punt_fuga),
area_(area),
densitat_(densitat) {
// Carregar forma d'estrella
shape_estrella_ = std::make_shared<Shape>("data/shapes/star.shp");
// Carregar forma d'estrella amb ShapeLoader
shape_estrella_ = ShapeLoader::load("star.shp");
if (!shape_estrella_->es_valida()) {
std::cerr << "ERROR: No s'ha pogut carregar data/shapes/star.shp" << std::endl;
if (!shape_estrella_ || !shape_estrella_->es_valida()) {
std::cerr << "ERROR: No s'ha pogut carregar star.shp" << std::endl;
return;
}