This commit is contained in:
2025-03-01 09:15:08 +01:00
parent c7db6aeaa3
commit 4e525642a0
7 changed files with 124 additions and 19 deletions

View File

@@ -13,7 +13,7 @@
#include "notifier.h" // Para Notify
#include "options.h"
#include "mouse.h"
#include "surface.h"
//#include "surface.h"
// [SINGLETON]
Screen *Screen::screen_ = nullptr;
@@ -84,8 +84,8 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer)
setBorderColor(border_color_);
// Crea la surface donde se pinta el juego
surface_ = std::make_shared<Surface>(nullptr, options.game.width, options.game.height);
surface_->loadPalette(Asset::get()->get("test.gif"));
//surface_ = std::make_shared<Surface>(nullptr, options.game.width, options.game.height);
//surface_->loadPalette(Asset::get()->get("test.gif"));
// Establece el modo de video
setVideoMode(options.video.mode);
@@ -113,7 +113,7 @@ void Screen::clean(Color color)
// Prepara para empezar a dibujar en la textura de juego
void Screen::start()
{
surface_->clear(surface_->getSurface(), surface_->getTransparentColor());
//surface_->clear(surface_->getSurface(), surface_->getTransparentColor());
SDL_SetRenderTarget(renderer_, game_texture_);
}
@@ -129,9 +129,9 @@ void Screen::render()
// Renderiza sobre gameCanvas los overlays
renderNotifications();
fillTextureWithColor(renderer_, surface_texture_, 0xFF, 0x00, 0xFF, 0xFF);
surface_->copyToTexture(renderer_, surface_texture_);
SDL_RenderCopy(renderer_, surface_texture_, nullptr, nullptr);
//fillTextureWithColor(renderer_, surface_texture_, 0xFF, 0x00, 0xFF, 0xFF);
//surface_->copyToTexture(renderer_, surface_texture_);
//SDL_RenderCopy(renderer_, surface_texture_, nullptr, nullptr);
// Si está el borde activo, vuelca gameCanvas sobre borderCanvas
if (options.video.border.enabled)