Acabat amb els singletones, de moment

Arreglat els checkEvents
This commit is contained in:
2025-02-22 23:39:10 +01:00
parent fc01676df2
commit 2ac425483b
25 changed files with 134 additions and 137 deletions

View File

@@ -27,7 +27,6 @@ Ending::Ending()
input(Input::get())
{
// Reserva memoria para los punteros a objetos
eventHandler = new SDL_Event();
text = new Text(resource->getOffset("smb2.txt"), resource->getTexture("smb2.png"), renderer);
music = JA_LoadMusic(asset->get("ending1.ogg").c_str());
@@ -72,7 +71,6 @@ Ending::Ending()
Ending::~Ending()
{
// Libera la memoria de los objetos
delete eventHandler;
delete text;
SDL_DestroyTexture(coverTexture);
@@ -159,11 +157,11 @@ void Ending::render()
// Comprueba el manejador de eventos
void Ending::checkEvents()
{
// Comprueba los eventos que hay en la cola
while (SDL_PollEvent(eventHandler) != 0)
SDL_Event event;
while (SDL_PollEvent(&event))
{
// Evento de salida de la aplicación
if (eventHandler->type == SDL_QUIT)
if (event.type == SDL_QUIT)
{
options.section.name = SECTION_QUIT;
break;