pasaeta loca de clang-format (despres m'arrepentiré pero bueno)
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
#include "screen.h"
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_LogCategory
|
||||
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_LogCategory
|
||||
|
||||
#include <algorithm> // Para min, max
|
||||
#include <fstream> // Para basic_ifstream, ifstream
|
||||
#include <iterator> // Para istreambuf_iterator, operator==
|
||||
#include <memory> // Para allocator, shared_ptr, __shared_pt...
|
||||
#include <string> // Para basic_string, char_traits, operator+
|
||||
|
||||
#include "asset.h" // Para Asset
|
||||
#include "external/jail_shader.h" // Para init, render
|
||||
#include "mouse.h" // Para updateCursorVisibility
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "options.h" // Para VideoOptions, video, WindowOptions
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamDebug
|
||||
#include "text.h" // Para Text, TEXT_COLOR, TEXT_STROKE
|
||||
#include "texture.h" // Para Texture
|
||||
#include "ui/service_menu.h" // Para ServiceMenu
|
||||
#include "asset.h" // Para Asset
|
||||
#include "external/jail_shader.h" // Para init, render
|
||||
#include "mouse.h" // Para updateCursorVisibility
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "options.h" // Para VideoOptions, video, WindowOptions
|
||||
#include "param.h" // Para Param, param, ParamGame, ParamDebug
|
||||
#include "text.h" // Para Text, TEXT_COLOR, TEXT_STROKE
|
||||
#include "texture.h" // Para Texture
|
||||
#include "ui/service_menu.h" // Para ServiceMenu
|
||||
|
||||
// Singleton
|
||||
Screen *Screen::instance_ = nullptr;
|
||||
@@ -27,7 +28,7 @@ void Screen::init() { Screen::instance_ = new Screen(); }
|
||||
void Screen::destroy() { delete Screen::instance_; }
|
||||
|
||||
// Obtiene la instancia
|
||||
Screen *Screen::get() { return Screen::instance_; }
|
||||
auto Screen::get() -> Screen * { return Screen::instance_; }
|
||||
|
||||
// Constructor
|
||||
Screen::Screen()
|
||||
@@ -36,9 +37,8 @@ Screen::Screen()
|
||||
game_canvas_(nullptr),
|
||||
service_menu_(nullptr),
|
||||
notifier_(nullptr),
|
||||
src_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)}),
|
||||
dst_rect_(SDL_FRect{0, 0, static_cast<float>(param.game.width), static_cast<float>(param.game.height)})
|
||||
{
|
||||
src_rect_(SDL_FRect{0, 0, param.game.width, param.game.height}),
|
||||
dst_rect_(SDL_FRect{0, 0, param.game.width, param.game.height}) {
|
||||
// Arranca SDL VIDEO, crea la ventana y el renderizador
|
||||
initSDLVideo();
|
||||
|
||||
@@ -61,16 +61,14 @@ Screen::Screen()
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Screen::~Screen()
|
||||
{
|
||||
Screen::~Screen() {
|
||||
SDL_DestroyTexture(game_canvas_);
|
||||
SDL_DestroyRenderer(renderer_);
|
||||
SDL_DestroyWindow(window_);
|
||||
}
|
||||
|
||||
// Limpia la pantalla
|
||||
void Screen::clean(Color color)
|
||||
{
|
||||
void Screen::clean(Color color) {
|
||||
SDL_SetRenderDrawColor(renderer_, color.r, color.g, color.b, 0xFF);
|
||||
SDL_RenderClear(renderer_);
|
||||
}
|
||||
@@ -79,75 +77,59 @@ void Screen::clean(Color color)
|
||||
void Screen::start() { SDL_SetRenderTarget(renderer_, game_canvas_); }
|
||||
|
||||
// Vuelca el contenido del renderizador en pantalla
|
||||
void Screen::render()
|
||||
{
|
||||
void Screen::render() {
|
||||
fps_.increment();
|
||||
|
||||
// Renderiza todos los overlays y efectos
|
||||
renderOverlays();
|
||||
|
||||
// Renderiza el contenido del game_canvas_
|
||||
renderScreen();
|
||||
renderOverlays(); // Renderiza todos los overlays y efectos
|
||||
renderScreen(); // Renderiza el contenido del game_canvas_
|
||||
}
|
||||
|
||||
// Vuelca el contenido del renderizador en pantalla exceptuando ciertas partes
|
||||
void Screen::coreRender()
|
||||
{
|
||||
void Screen::coreRender() {
|
||||
fps_.increment();
|
||||
#ifdef DEBUG
|
||||
renderInfo();
|
||||
#endif
|
||||
renderScreen();
|
||||
renderScreen(); // Renderiza el contenido del game_canvas_
|
||||
}
|
||||
|
||||
// Renderiza el contenido del game_canvas_
|
||||
void Screen::renderScreen()
|
||||
{
|
||||
void Screen::renderScreen() {
|
||||
SDL_SetRenderTarget(renderer_, nullptr);
|
||||
clean();
|
||||
|
||||
if (Options::video.shaders)
|
||||
{
|
||||
if (Options::video.shaders) {
|
||||
shader::render();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
SDL_RenderTexture(renderer_, game_canvas_, nullptr, nullptr);
|
||||
SDL_RenderPresent(renderer_);
|
||||
}
|
||||
}
|
||||
|
||||
// Establece el modo de video
|
||||
void Screen::setFullscreenMode()
|
||||
{
|
||||
void Screen::setFullscreenMode() {
|
||||
SDL_SetWindowFullscreen(window_, Options::video.fullscreen);
|
||||
}
|
||||
|
||||
// Camibia entre pantalla completa y ventana
|
||||
void Screen::toggleFullscreen()
|
||||
{
|
||||
void Screen::toggleFullscreen() {
|
||||
Options::video.fullscreen = !Options::video.fullscreen;
|
||||
setFullscreenMode();
|
||||
}
|
||||
|
||||
// Cambia el tamaño de la ventana
|
||||
void Screen::setWindowZoom(int zoom)
|
||||
{
|
||||
void Screen::setWindowZoom(int zoom) {
|
||||
Options::window.size = zoom;
|
||||
adjustWindowSize();
|
||||
}
|
||||
|
||||
// Reduce el tamaño de la ventana
|
||||
bool Screen::decWindowSize()
|
||||
{
|
||||
if (!Options::video.fullscreen)
|
||||
{
|
||||
auto Screen::decWindowSize() -> bool {
|
||||
if (!Options::video.fullscreen) {
|
||||
const int PREVIOUS_ZOOM = Options::window.size;
|
||||
--Options::window.size;
|
||||
Options::window.size = std::max(Options::window.size, 1);
|
||||
|
||||
if (Options::window.size != PREVIOUS_ZOOM)
|
||||
{
|
||||
if (Options::window.size != PREVIOUS_ZOOM) {
|
||||
adjustWindowSize();
|
||||
return true;
|
||||
}
|
||||
@@ -157,16 +139,13 @@ bool Screen::decWindowSize()
|
||||
}
|
||||
|
||||
// Aumenta el tamaño de la ventana
|
||||
bool Screen::incWindowSize()
|
||||
{
|
||||
if (!Options::video.fullscreen)
|
||||
{
|
||||
auto Screen::incWindowSize() -> bool {
|
||||
if (!Options::video.fullscreen) {
|
||||
const int PREVIOUS_ZOOM = Options::window.size;
|
||||
++Options::window.size;
|
||||
Options::window.size = std::min(Options::window.size, Options::window.max_size);
|
||||
|
||||
if (Options::window.size != PREVIOUS_ZOOM)
|
||||
{
|
||||
if (Options::window.size != PREVIOUS_ZOOM) {
|
||||
adjustWindowSize();
|
||||
return true;
|
||||
}
|
||||
@@ -176,45 +155,41 @@ bool Screen::incWindowSize()
|
||||
}
|
||||
|
||||
// Actualiza la lógica de la clase
|
||||
void Screen::update()
|
||||
{
|
||||
void Screen::update() {
|
||||
fps_.calculate(SDL_GetTicks());
|
||||
shake_effect_.update(src_rect_, dst_rect_);
|
||||
flash_effect_.update();
|
||||
if (service_menu_)
|
||||
if (service_menu_ != nullptr) {
|
||||
service_menu_->update();
|
||||
if (notifier_)
|
||||
}
|
||||
if (notifier_ != nullptr) {
|
||||
notifier_->update();
|
||||
}
|
||||
Mouse::updateCursorVisibility();
|
||||
}
|
||||
|
||||
// Actualiza los elementos mínimos
|
||||
void Screen::coreUpdate()
|
||||
{
|
||||
void Screen::coreUpdate() {
|
||||
fps_.calculate(SDL_GetTicks());
|
||||
Mouse::updateCursorVisibility();
|
||||
}
|
||||
|
||||
// Actualiza y dibuja el efecto de flash en la pantalla
|
||||
void Screen::renderFlash()
|
||||
{
|
||||
if (flash_effect_.isRendarable())
|
||||
{
|
||||
void Screen::renderFlash() {
|
||||
if (flash_effect_.isRendarable()) {
|
||||
SDL_SetRenderDrawColor(renderer_, flash_effect_.color.r, flash_effect_.color.g, flash_effect_.color.b, 0xFF);
|
||||
SDL_RenderClear(renderer_);
|
||||
}
|
||||
}
|
||||
|
||||
// Aplica el efecto de agitar la pantalla
|
||||
void Screen::renderShake()
|
||||
{
|
||||
if (shake_effect_.enabled)
|
||||
{
|
||||
void Screen::renderShake() {
|
||||
if (shake_effect_.enabled) {
|
||||
// Guarda el renderizador actual para dejarlo despues como estaba
|
||||
auto current_target = SDL_GetRenderTarget(renderer_);
|
||||
auto *current_target = SDL_GetRenderTarget(renderer_);
|
||||
|
||||
// Crea una textura temporal
|
||||
auto temp_texture = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, param.game.width, param.game.height);
|
||||
auto *temp_texture = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, param.game.width, param.game.height);
|
||||
|
||||
// Vuelca game_canvas_ a la textura temporal
|
||||
SDL_SetRenderTarget(renderer_, temp_texture);
|
||||
@@ -233,10 +208,8 @@ void Screen::renderShake()
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// Muestra información por pantalla
|
||||
void Screen::renderInfo()
|
||||
{
|
||||
if (debug_info_.show)
|
||||
{
|
||||
void Screen::renderInfo() {
|
||||
if (debug_info_.show) {
|
||||
// Resolution
|
||||
debug_info_.text->writeDX(TEXT_COLOR | TEXT_STROKE, param.game.width - debug_info_.text->lenght(Options::video.info) - 2, 1, Options::video.info, 1, param.debug.color, 1, param.debug.color.darken(150));
|
||||
|
||||
@@ -247,10 +220,8 @@ void Screen::renderInfo()
|
||||
}
|
||||
#endif
|
||||
// Carga el contenido del archivo GLSL
|
||||
void Screen::loadShaders()
|
||||
{
|
||||
if (shader_source_.empty())
|
||||
{
|
||||
void Screen::loadShaders() {
|
||||
if (shader_source_.empty()) {
|
||||
const std::string GLSL_FILE = param.game.game_area.rect.h == 256 ? "crtpi_256.glsl" : "crtpi_240.glsl";
|
||||
std::ifstream f(Asset::get()->get(GLSL_FILE).c_str());
|
||||
shader_source_ = std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
|
||||
@@ -258,32 +229,30 @@ void Screen::loadShaders()
|
||||
}
|
||||
|
||||
// Inicializa los shaders
|
||||
void Screen::initShaders()
|
||||
{
|
||||
if (Options::video.shaders)
|
||||
{
|
||||
void Screen::initShaders() {
|
||||
if (Options::video.shaders) {
|
||||
loadShaders();
|
||||
shader::init(window_, game_canvas_, shader_source_);
|
||||
}
|
||||
}
|
||||
|
||||
// Calcula el tamaño de la ventana
|
||||
void Screen::adjustWindowSize()
|
||||
{
|
||||
if (!Options::video.fullscreen)
|
||||
{
|
||||
void Screen::adjustWindowSize() {
|
||||
if (!Options::video.fullscreen) {
|
||||
// Establece el nuevo tamaño
|
||||
const int WIDTH = param.game.width * Options::window.size;
|
||||
const int HEIGHT = param.game.height * Options::window.size;
|
||||
|
||||
int old_width, old_height;
|
||||
int old_width;
|
||||
int old_height;
|
||||
SDL_GetWindowSize(window_, &old_width, &old_height);
|
||||
|
||||
int old_pos_x, old_pos_y;
|
||||
int old_pos_x;
|
||||
int old_pos_y;
|
||||
SDL_GetWindowPosition(window_, &old_pos_x, &old_pos_y);
|
||||
|
||||
const int NEW_POS_X = old_pos_x + (old_width - WIDTH) / 2;
|
||||
const int NEW_POS_Y = old_pos_y + (old_height - HEIGHT) / 2;
|
||||
const int NEW_POS_X = old_pos_x + ((old_width - WIDTH) / 2);
|
||||
const int NEW_POS_Y = old_pos_y + ((old_height - HEIGHT) / 2);
|
||||
|
||||
SDL_SetWindowPosition(window_, std::max(NEW_POS_X, WINDOWS_DECORATIONS_), std::max(NEW_POS_Y, 0));
|
||||
SDL_SetWindowSize(window_, WIDTH, HEIGHT);
|
||||
@@ -291,8 +260,7 @@ void Screen::adjustWindowSize()
|
||||
}
|
||||
|
||||
// Renderiza todos los overlays y efectos
|
||||
void Screen::renderOverlays()
|
||||
{
|
||||
void Screen::renderOverlays() {
|
||||
// Dibuja efectos y elementos sobre el game_canvas_
|
||||
renderShake();
|
||||
renderFlash();
|
||||
@@ -305,24 +273,20 @@ void Screen::renderOverlays()
|
||||
}
|
||||
|
||||
// Atenua la pantalla
|
||||
void Screen::renderAttenuate()
|
||||
{
|
||||
if (attenuate_effect_)
|
||||
{
|
||||
void Screen::renderAttenuate() {
|
||||
if (attenuate_effect_) {
|
||||
SDL_SetRenderDrawColor(renderer_, 0, 0, 0, 64);
|
||||
SDL_RenderFillRect(renderer_, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
// Arranca SDL VIDEO y crea la ventana
|
||||
bool Screen::initSDLVideo()
|
||||
{
|
||||
auto Screen::initSDLVideo() -> bool {
|
||||
// Inicializar SDL
|
||||
if (!SDL_Init(SDL_INIT_VIDEO))
|
||||
{
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"FATAL: Failed to initialize SDL_VIDEO! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
"FATAL: Failed to initialize SDL_VIDEO! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -330,16 +294,14 @@ bool Screen::initSDLVideo()
|
||||
getDisplayInfo();
|
||||
|
||||
// Configurar hint para OpenGL
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"))
|
||||
{
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl")) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Warning: Failed to set OpenGL hint!");
|
||||
"Warning: Failed to set OpenGL hint!");
|
||||
}
|
||||
|
||||
// Crear ventana
|
||||
SDL_WindowFlags window_flags = SDL_WINDOW_OPENGL;
|
||||
if (Options::video.fullscreen)
|
||||
{
|
||||
if (Options::video.fullscreen) {
|
||||
window_flags |= SDL_WINDOW_FULLSCREEN;
|
||||
}
|
||||
window_ = SDL_CreateWindow(
|
||||
@@ -348,22 +310,20 @@ bool Screen::initSDLVideo()
|
||||
param.game.height * Options::window.size,
|
||||
window_flags);
|
||||
|
||||
if (!window_)
|
||||
{
|
||||
if (window_ == nullptr) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"FATAL: Failed to create window! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
"FATAL: Failed to create window! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
SDL_Quit();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Crear renderer
|
||||
renderer_ = SDL_CreateRenderer(window_, nullptr);
|
||||
if (!renderer_)
|
||||
{
|
||||
if (renderer_ == nullptr) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"FATAL: Failed to create renderer! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
"FATAL: Failed to create renderer! SDL Error: %s",
|
||||
SDL_GetError());
|
||||
SDL_DestroyWindow(window_);
|
||||
window_ = nullptr;
|
||||
SDL_Quit();
|
||||
@@ -382,39 +342,35 @@ bool Screen::initSDLVideo()
|
||||
}
|
||||
|
||||
// Obtiene información sobre la pantalla
|
||||
void Screen::getDisplayInfo()
|
||||
{
|
||||
int i, num_displays = 0;
|
||||
void Screen::getDisplayInfo() {
|
||||
int i;
|
||||
int num_displays = 0;
|
||||
SDL_DisplayID *displays = SDL_GetDisplays(&num_displays);
|
||||
if (displays)
|
||||
{
|
||||
for (i = 0; i < num_displays; ++i)
|
||||
{
|
||||
if (displays != nullptr) {
|
||||
for (i = 0; i < num_displays; ++i) {
|
||||
SDL_DisplayID instance_id = displays[i];
|
||||
const char *name = SDL_GetDisplayName(instance_id);
|
||||
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Display %" SDL_PRIu32 ": %s", instance_id, name ? name : "Unknown");
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Display %" SDL_PRIu32 ": %s", instance_id, (name != nullptr) ? name : "Unknown");
|
||||
}
|
||||
|
||||
auto DM = SDL_GetCurrentDisplayMode(displays[0]);
|
||||
const auto *dm = SDL_GetCurrentDisplayMode(displays[0]);
|
||||
|
||||
// Calcula el máximo factor de zoom que se puede aplicar a la pantalla
|
||||
Options::window.max_size = std::min(DM->w / param.game.width, DM->h / param.game.height);
|
||||
Options::window.max_size = std::min(dm->w / param.game.width, dm->h / param.game.height);
|
||||
Options::window.size = std::min(Options::window.size, Options::window.max_size);
|
||||
|
||||
// Muestra información sobre el tamaño de la pantalla y de la ventana de juego
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Current display mode: %dx%d @ %dHz",
|
||||
static_cast<int>(DM->w), static_cast<int>(DM->h), static_cast<int>(DM->refresh_rate));
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Current display mode: %dx%d @ %dHz", static_cast<int>(dm->w), static_cast<int>(dm->h), static_cast<int>(dm->refresh_rate));
|
||||
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Window resolution: %dx%d x%d",
|
||||
static_cast<int>(param.game.width), static_cast<int>(param.game.height), Options::window.size);
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Window resolution: %dx%d x%d", static_cast<int>(param.game.width), static_cast<int>(param.game.height), Options::window.size);
|
||||
|
||||
Options::video.info = std::to_string(static_cast<int>(DM->w)) + "x" +
|
||||
std::to_string(static_cast<int>(DM->h)) + " @ " +
|
||||
std::to_string(static_cast<int>(DM->refresh_rate)) + " Hz";
|
||||
Options::video.info = std::to_string(static_cast<int>(dm->w)) + "x" +
|
||||
std::to_string(static_cast<int>(dm->h)) + " @ " +
|
||||
std::to_string(static_cast<int>(dm->refresh_rate)) + " Hz";
|
||||
|
||||
// Calcula el máximo factor de zoom que se puede aplicar a la pantalla
|
||||
const int MAX_ZOOM = std::min(DM->w / param.game.width, (DM->h - WINDOWS_DECORATIONS_) / param.game.height);
|
||||
const int MAX_ZOOM = std::min(dm->w / param.game.width, (dm->h - WINDOWS_DECORATIONS_) / param.game.height);
|
||||
|
||||
// Normaliza los valores de zoom
|
||||
Options::window.size = std::min(Options::window.size, MAX_ZOOM);
|
||||
@@ -424,43 +380,37 @@ void Screen::getDisplayInfo()
|
||||
}
|
||||
|
||||
// Alterna entre activar y desactivar los shaders
|
||||
void Screen::toggleShaders()
|
||||
{
|
||||
void Screen::toggleShaders() {
|
||||
Options::video.shaders = !Options::video.shaders;
|
||||
initShaders();
|
||||
}
|
||||
|
||||
// Alterna entre activar y desactivar el escalado entero
|
||||
void Screen::toggleIntegerScale()
|
||||
{
|
||||
void Screen::toggleIntegerScale() {
|
||||
Options::video.integer_scale = !Options::video.integer_scale;
|
||||
SDL_SetRenderLogicalPresentation(renderer_, param.game.width, param.game.height, Options::video.integer_scale ? SDL_LOGICAL_PRESENTATION_INTEGER_SCALE : SDL_LOGICAL_PRESENTATION_LETTERBOX);
|
||||
}
|
||||
|
||||
// Alterna entre activar y desactivar el V-Sync
|
||||
void Screen::toggleVSync()
|
||||
{
|
||||
void Screen::toggleVSync() {
|
||||
Options::video.v_sync = !Options::video.v_sync;
|
||||
SDL_SetRenderVSync(renderer_, Options::video.v_sync ? 1 : SDL_RENDERER_VSYNC_DISABLED);
|
||||
}
|
||||
|
||||
// Establece el estado del V-Sync
|
||||
void Screen::setVSync(bool enabled)
|
||||
{
|
||||
void Screen::setVSync(bool enabled) {
|
||||
Options::video.v_sync = enabled;
|
||||
SDL_SetRenderVSync(renderer_, enabled ? 1 : SDL_RENDERER_VSYNC_DISABLED);
|
||||
}
|
||||
|
||||
// Obtiene los punteros a los singletones
|
||||
void Screen::getSingletons()
|
||||
{
|
||||
void Screen::getSingletons() {
|
||||
service_menu_ = ServiceMenu::get();
|
||||
notifier_ = Notifier::get();
|
||||
}
|
||||
|
||||
// Aplica los valores de las opciones
|
||||
void Screen::applySettings()
|
||||
{
|
||||
void Screen::applySettings() {
|
||||
SDL_SetRenderVSync(renderer_, Options::video.v_sync ? 1 : SDL_RENDERER_VSYNC_DISABLED);
|
||||
SDL_SetRenderLogicalPresentation(Screen::get()->getRenderer(), param.game.width, param.game.height, Options::video.integer_scale ? SDL_LOGICAL_PRESENTATION_INTEGER_SCALE : SDL_LOGICAL_PRESENTATION_LETTERBOX);
|
||||
setFullscreenMode();
|
||||
@@ -468,8 +418,7 @@ void Screen::applySettings()
|
||||
}
|
||||
|
||||
// Crea el objeto de texto
|
||||
void Screen::createText()
|
||||
{
|
||||
void Screen::createText() {
|
||||
auto texture = std::make_shared<Texture>(getRenderer(), Asset::get()->get("aseprite.png"));
|
||||
text_ = std::make_shared<Text>(texture, Asset::get()->get("aseprite.txt"));
|
||||
}
|
||||
Reference in New Issue
Block a user