diff --git a/source/resource.cpp b/source/resource.cpp index 3223280..de7b968 100644 --- a/source/resource.cpp +++ b/source/resource.cpp @@ -10,8 +10,8 @@ #include "screen.h" // Para Screen #include "text.h" // Para Text, loadTextFile #include "param.h" -struct JA_Music_t; // lines 11-11 -struct JA_Sound_t; // lines 12-12 +struct JA_Music_t; // lines 11-11 +struct JA_Sound_t; // lines 12-12 // Singleton Resource *Resource::instance_ = nullptr; @@ -28,6 +28,9 @@ Resource *Resource::get() { return Resource::instance_; } // Constructor Resource::Resource() : loading_text_(Screen::get()->getText()) { load(); } +// Destructor +Resource::~Resource() { clear(); } + // Vacia todos los vectores de recursos void Resource::clear() { @@ -441,7 +444,7 @@ void Resource::renderProgress() // Dibuja el interior de la barra de progreso SDL_SetRenderDrawColor(renderer, param.resource.color.r, param.resource.color.g, param.resource.color.b, param.resource.color.a); SDL_RenderFillRect(renderer, &loading_full_rect_); - + // Dibuja el marco de la barra de progreso SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); SDL_RenderRect(renderer, &loading_wired_rect_); diff --git a/source/resource.h b/source/resource.h index c481ba7..596ec9f 100644 --- a/source/resource.h +++ b/source/resource.h @@ -147,6 +147,6 @@ private: void updateProgressBar(); // Actualiza la barra de estado // --- Constructores y destructor privados (singleton) --- - Resource(); // Constructor privado - ~Resource() = default; // Destructor privado + Resource(); // Constructor privado + ~Resource(); // Destructor privado }; \ No newline at end of file