Ya se ven las notificaciones por pantalla
This commit is contained in:
@@ -3,12 +3,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
// Constructor
|
||||
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options, int gameInternalResX, int gameInternalResY)
|
||||
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options, int gameInternalResX, int gameInternalResY)
|
||||
{
|
||||
// Inicializa variables
|
||||
this->window = window;
|
||||
this->renderer = renderer;
|
||||
this->options = options;
|
||||
this->asset = asset;
|
||||
|
||||
// Crea los objetos
|
||||
notify = new Notify(renderer, asset->get("smb2.png"), asset->get("smb2.txt"));
|
||||
|
||||
gameCanvasWidth = gameInternalResX;
|
||||
gameCanvasHeight = gameInternalResY;
|
||||
@@ -41,7 +45,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, options_t *options, i
|
||||
// Destructor
|
||||
Screen::~Screen()
|
||||
{
|
||||
renderer = nullptr;
|
||||
delete notify;
|
||||
}
|
||||
|
||||
// Limpia la pantalla
|
||||
@@ -70,6 +74,9 @@ void Screen::blit()
|
||||
// Copia la textura de juego en el renderizador en la posición adecuada
|
||||
SDL_RenderCopy(renderer, gameCanvas, nullptr, &dest);
|
||||
|
||||
// Dibuja las notificaciones
|
||||
notify->render();
|
||||
|
||||
// Muestra por pantalla el renderizador
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
@@ -362,4 +369,16 @@ void Screen::renderFX()
|
||||
{
|
||||
renderFade();
|
||||
renderSpectrumFade();
|
||||
}
|
||||
|
||||
// Actualiza el notificador
|
||||
void Screen::updateNotifier()
|
||||
{
|
||||
notify->update();
|
||||
}
|
||||
|
||||
// Muestra una notificación de texto por pantalla;
|
||||
void Screen::showText(std::string text)
|
||||
{
|
||||
notify->showText(text);
|
||||
}
|
||||
Reference in New Issue
Block a user