afegit define NO_AUDIO
renombrat define DEBUG a _DEBUG
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#include "screen.h"
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_LogCategory, SDL_LogInfo, SDL_RenderTexture, SDL_SetRenderDrawColor, SDL_SetRenderVSync, SDL_GetError, SDL_LogError, SDL_RendererLogicalPresentation, SDL_SetRenderLogicalPresentation, SDL_CreateTexture, SDL_DestroyTexture, SDL_DestroyWindow, SDL_GetTicks, SDL_Quit, SDL_RENDERER_VSYNC_DISABLED, SDL_RenderClear, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DisplayID, SDL_FRect, SDL_GetCurrentDisplayMode, SDL_GetDisplayName, SDL_GetDisplays, SDL_GetRenderTarget, SDL_GetWindowPosition, SDL_GetWindowSize, SDL_Init, SDL_LogWarn, SDL_PixelFormat, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetHint, SDL_SetRenderDrawBlendMode, SDL_SetTextureScaleMode, SDL_SetWindowFullscreen, SDL_SetWindowPosition, SDL_SetWindowSize, SDL_TextureAccess, SDL_free, SDL_BLENDMODE_BLEND, SDL_HINT_RENDER_DRIVER, SDL_INIT_VIDEO, SDL_PRIu32, SDL_ScaleMode, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WindowFlags
|
||||
#include <algorithm> // Para min, max
|
||||
#include <fstream> // Para basic_ifstream, ifstream
|
||||
#include <iterator> // Para istreambuf_iterator, operator==
|
||||
#include <memory> // Para allocator, shared_ptr, make_shared, __shared_ptr_access
|
||||
#include <string> // Para operator+, char_traits, to_string, string
|
||||
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_LogCategory, SDL_LogInfo, SDL_RenderTexture, SDL_SetRenderDrawColor, SDL_SetRenderVSync, SDL_GetError, SDL_LogError, SDL_RendererLogicalPresentation, SDL_SetRenderLogicalPresentation, SDL_CreateTexture, SDL_DestroyTexture, SDL_DestroyWindow, SDL_GetTicks, SDL_Quit, SDL_RENDERER_VSYNC_DISABLED, SDL_RenderClear, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DisplayID, SDL_FRect, SDL_GetCurrentDisplayMode, SDL_GetDisplayName, SDL_GetDisplays, SDL_GetRenderTarget, SDL_GetWindowPosition, SDL_GetWindowSize, SDL_Init, SDL_LogWarn, SDL_PixelFormat, SDL_RenderFillRect, SDL_RenderPresent, SDL_SetHint, SDL_SetRenderDrawBlendMode, SDL_SetTextureScaleMode, SDL_SetWindowFullscreen, SDL_SetWindowPosition, SDL_SetWindowSize, SDL_TextureAccess, SDL_free, SDL_BLENDMODE_BLEND, SDL_HINT_RENDER_DRIVER, SDL_INIT_VIDEO, SDL_PRIu32, SDL_ScaleMode, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WindowFlags
|
||||
|
||||
#include <algorithm> // Para min, max
|
||||
#include <fstream> // Para basic_ifstream, ifstream
|
||||
#include <iterator> // Para istreambuf_iterator, operator==
|
||||
#include <memory> // Para allocator, shared_ptr, make_shared, __shared_ptr_access
|
||||
#include <string> // Para operator+, char_traits, to_string, string
|
||||
|
||||
#include "asset.h" // Para Asset
|
||||
#include "external/jail_shader.h" // Para init, render
|
||||
@@ -49,7 +50,7 @@ Screen::Screen()
|
||||
// Crea el objeto de texto
|
||||
createText();
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
debug_info_.text = text_;
|
||||
setDebugInfoEnabled(true);
|
||||
#endif
|
||||
@@ -86,7 +87,7 @@ void Screen::render() {
|
||||
// Vuelca el contenido del renderizador en pantalla exceptuando ciertas partes
|
||||
void Screen::coreRender() {
|
||||
fps_.increment();
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
renderInfo();
|
||||
#endif
|
||||
renderScreen(); // Renderiza el contenido del game_canvas_
|
||||
@@ -206,7 +207,7 @@ void Screen::renderShake() {
|
||||
SDL_SetRenderTarget(renderer_, current_target);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
// Muestra información por pantalla
|
||||
void Screen::renderInfo() {
|
||||
if (debug_info_.show) {
|
||||
@@ -267,7 +268,7 @@ void Screen::renderOverlays() {
|
||||
renderAttenuate();
|
||||
service_menu_->render();
|
||||
notifier_->render();
|
||||
#ifdef DEBUG
|
||||
#ifdef _DEBUG
|
||||
renderInfo();
|
||||
#endif
|
||||
}
|
||||
@@ -335,9 +336,8 @@ auto Screen::initSDLVideo() -> bool {
|
||||
SDL_SetRenderLogicalPresentation(renderer_, param.game.width, param.game.height, Options::video.integer_scale ? SDL_LOGICAL_PRESENTATION_INTEGER_SCALE : SDL_LOGICAL_PRESENTATION_LETTERBOX);
|
||||
SDL_SetRenderDrawBlendMode(renderer_, SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderVSync(renderer_, Options::video.v_sync ? 1 : SDL_RENDERER_VSYNC_DISABLED);
|
||||
// SDL_SetWindowFullscreen(window_, Options::video.fullscreen);
|
||||
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "SDL Video initialized successfully.");
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "** Video system initialized successfully");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user