afegit resources.pack y prefixe a les rutes de recursos
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user