forked from jaildesigner-jailgames/jaildoctors_dilemma
Ja torna a funcionar el borde
This commit is contained in:
@@ -124,40 +124,22 @@ void Screen::start()
|
||||
setRendererSurface(nullptr);
|
||||
}
|
||||
|
||||
// Prepara para empezar a dibujar en la textura del borde
|
||||
void Screen::startDrawOnBorder()
|
||||
{
|
||||
}
|
||||
|
||||
// Vuelca el contenido del renderizador en pantalla
|
||||
void Screen::render()
|
||||
{
|
||||
// Renderiza sobre game_surface_ los overlays
|
||||
renderNotifications();
|
||||
|
||||
// Copia la surface a game_texture_
|
||||
game_surface_->copyToTexture(renderer_, game_texture_);
|
||||
|
||||
// Si está el borde activo, vuelca gameCanvas sobre borderCanvas
|
||||
if (options.video.border.enabled)
|
||||
{
|
||||
gameCanvasToBorderCanvas();
|
||||
setRendererSurface(border_surface_);
|
||||
game_surface_->render(options.video.border.width, options.video.border.height);
|
||||
border_surface_->copyToTexture(renderer_, border_texture_);
|
||||
}
|
||||
|
||||
// Muestra el contenido por pantalla
|
||||
renderPresent();
|
||||
}
|
||||
|
||||
// Vuelca el contenido del renderizador en pantalla
|
||||
void Screen::renderWithoutNotifier()
|
||||
{
|
||||
// Copia la surface a game_texture_
|
||||
game_surface_->copyToTexture(renderer_, game_texture_);
|
||||
|
||||
// Si está el borde activo, vuelca gameCanvas sobre borderCanvas
|
||||
if (options.video.border.enabled)
|
||||
else
|
||||
{
|
||||
gameCanvasToBorderCanvas();
|
||||
game_surface_->copyToTexture(renderer_, game_texture_);
|
||||
}
|
||||
|
||||
// Muestra el contenido por pantalla
|
||||
@@ -232,11 +214,7 @@ bool Screen::incWindowZoom()
|
||||
void Screen::setBorderColor(Uint8 color)
|
||||
{
|
||||
border_color_ = color;
|
||||
auto temp = SDL_GetRenderTarget(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, border_texture_);
|
||||
SDL_SetRenderDrawColor(renderer_, color, color, color, 0xFF);
|
||||
SDL_RenderClear(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, temp);
|
||||
border_surface_->clear(border_color_);
|
||||
}
|
||||
|
||||
// Cambia el tipo de mezcla
|
||||
@@ -259,15 +237,12 @@ void Screen::toggleBorder()
|
||||
}
|
||||
|
||||
// Dibuja las notificaciones
|
||||
void Screen::renderNotifications() { Notifier::get()->render(); }
|
||||
|
||||
// Copia el gameCanvas en el borderCanvas
|
||||
void Screen::gameCanvasToBorderCanvas()
|
||||
void Screen::renderNotifications()
|
||||
{
|
||||
auto temp = SDL_GetRenderTarget(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, border_texture_);
|
||||
SDL_RenderCopy(renderer_, game_texture_, nullptr, &game_rect_);
|
||||
SDL_SetRenderTarget(renderer_, temp);
|
||||
if (notifications_enabled_)
|
||||
{
|
||||
Notifier::get()->render();
|
||||
}
|
||||
}
|
||||
|
||||
// Muestra el contenido de Screen por pantalla
|
||||
|
||||
Reference in New Issue
Block a user