forked from jaildesigner-jailgames/jaildoctors_dilemma
Arreglos en la estructura i format del codi
This commit is contained in:
@@ -15,12 +15,10 @@ Surface::Surface(std::shared_ptr<SurfaceData> surface_dest, int w, int h)
|
||||
surface_(std::make_shared<SurfaceData>(w, h)),
|
||||
transparent_color_(0) {}
|
||||
|
||||
Surface::Surface(std::shared_ptr<SurfaceData> surface_dest, std::string file_path)
|
||||
Surface::Surface(std::shared_ptr<SurfaceData> surface_dest, const std::string &file_path)
|
||||
: surface_dest_(surface_dest),
|
||||
surface_(std::make_shared<SurfaceData>(loadSurface(Asset::get()->get(file_path)))),
|
||||
transparent_color_(0) {
|
||||
std::cout << "surface loaded: "<< surface_->width << "x" << surface_->height << std::endl;
|
||||
}
|
||||
transparent_color_(0) {}
|
||||
|
||||
Surface::~Surface() {}
|
||||
|
||||
@@ -137,7 +135,7 @@ void Surface::render(int dx, int dy, int sx, int sy, int w, int h)
|
||||
{
|
||||
throw std::runtime_error("Surface source or destination is null.");
|
||||
}
|
||||
|
||||
|
||||
// Limitar la región para evitar accesos fuera de rango
|
||||
w = std::min(w, surface_->width - sx);
|
||||
h = std::min(h, surface_->height - sy);
|
||||
|
||||
Reference in New Issue
Block a user