Las notificaciones ya se renderizan a su propia resolución

This commit is contained in:
2022-11-15 13:11:56 +01:00
parent 754671e695
commit 54cee20883
2 changed files with 18 additions and 5 deletions

View File

@@ -75,7 +75,7 @@ void Screen::blit()
SDL_RenderCopy(renderer, gameCanvas, nullptr, &dest);
// Dibuja las notificaciones
notify->render();
renderNotifications();
// Muestra por pantalla el renderizador
SDL_RenderPresent(renderer);
@@ -101,14 +101,16 @@ void Screen::setVideoMode(int fullScreenMode)
else
{
screenWidth = gameCanvasWidth;
screenHeight = gameCanvasHeight;
screenWidth = gameCanvasWidth * options->windowSize;
screenHeight = gameCanvasHeight * options->windowSize;
dest = {0, 0, gameCanvasWidth, gameCanvasHeight};
}
// Modifica el tamaño del renderizador y de la ventana
SDL_RenderSetLogicalSize(renderer, screenWidth, screenHeight);
SDL_SetWindowSize(window, screenWidth * options->windowSize, screenHeight * options->windowSize);
// SDL_RenderSetLogicalSize(renderer, screenWidth, screenHeight);
// SDL_SetWindowSize(window, screenWidth * options->windowSize, screenHeight * options->windowSize);
SDL_RenderSetLogicalSize(renderer, gameCanvasWidth, gameCanvasHeight);
SDL_SetWindowSize(window, screenWidth, screenHeight);
}
// Si está activo el modo de pantalla completa añade el borde
@@ -382,3 +384,11 @@ void Screen::showText(std::string text)
{
notify->showText(text);
}
// Dibuja las notificaciones
void Screen::renderNotifications()
{
SDL_RenderSetLogicalSize(renderer, screenWidth, screenHeight);
notify->render();
SDL_RenderSetLogicalSize(renderer, gameCanvasWidth, gameCanvasHeight);
}

View File

@@ -69,6 +69,9 @@ private:
// Dibuja el spectrum fade
void renderSpectrumFade();
// Dibuja las notificaciones
void renderNotifications();
public:
// Constructor
Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options, int gameInternalResX, int gameInternalResY);