eliminada la clase Debug en Release
This commit is contained in:
@@ -63,7 +63,6 @@ set(APP_SOURCES
|
|||||||
source/core/resources/resource_helper.cpp
|
source/core/resources/resource_helper.cpp
|
||||||
|
|
||||||
# Core - System
|
# Core - System
|
||||||
source/core/system/debug.cpp
|
|
||||||
source/core/system/director.cpp
|
source/core/system/director.cpp
|
||||||
source/core/system/global_events.cpp
|
source/core/system/global_events.cpp
|
||||||
|
|
||||||
@@ -119,6 +118,11 @@ set(RENDERING_SOURCES
|
|||||||
source/core/rendering/opengl/opengl_shader.cpp
|
source/core/rendering/opengl/opengl_shader.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Fuentes de debug (solo en modo Debug)
|
||||||
|
set(DEBUG_SOURCES
|
||||||
|
source/core/system/debug.cpp
|
||||||
|
)
|
||||||
|
|
||||||
# Configuración de SDL3
|
# Configuración de SDL3
|
||||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
||||||
message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
|
message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
|
||||||
@@ -126,6 +130,9 @@ message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
|
|||||||
# --- 2. AÑADIR EJECUTABLE ---
|
# --- 2. AÑADIR EJECUTABLE ---
|
||||||
add_executable(${PROJECT_NAME} ${APP_SOURCES} ${EXTERNAL_SOURCES} ${RENDERING_SOURCES})
|
add_executable(${PROJECT_NAME} ${APP_SOURCES} ${EXTERNAL_SOURCES} ${RENDERING_SOURCES})
|
||||||
|
|
||||||
|
# Añadir fuentes de debug solo en modo Debug
|
||||||
|
target_sources(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:${DEBUG_SOURCES}>)
|
||||||
|
|
||||||
# --- 3. DIRECTORIOS DE INCLUSIÓN ---
|
# --- 3. DIRECTORIOS DE INCLUSIÓN ---
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
"${CMAKE_SOURCE_DIR}/source"
|
"${CMAKE_SOURCE_DIR}/source"
|
||||||
|
|||||||
@@ -221,9 +221,11 @@ void handle() {
|
|||||||
//handleToggleDebug();
|
//handleToggleDebug();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
case InputAction::SHOW_DEBUG_INFO:
|
case InputAction::SHOW_DEBUG_INFO:
|
||||||
handleShowDebugInfo();
|
handleShowDebugInfo();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case InputAction::NONE:
|
case InputAction::NONE:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -322,7 +322,9 @@ void Screen::textureToRenderer() {
|
|||||||
// Renderiza todos los overlays
|
// Renderiza todos los overlays
|
||||||
void Screen::renderOverlays() {
|
void Screen::renderOverlays() {
|
||||||
renderNotifications();
|
renderNotifications();
|
||||||
|
#ifdef _DEBUG
|
||||||
renderInfo();
|
renderInfo();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Localiza la paleta dentro del vector de paletas
|
// Localiza la paleta dentro del vector de paletas
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
|
|
||||||
#include <string> // Para string
|
#include <string> // Para string
|
||||||
@@ -38,3 +40,5 @@ class Debug {
|
|||||||
int y_ = 0; // Posición donde escribir el texto de debug
|
int y_ = 0; // Posición donde escribir el texto de debug
|
||||||
bool enabled_ = false; // Indica si esta activo el modo debug
|
bool enabled_ = false; // Indica si esta activo el modo debug
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // _DEBUG
|
||||||
@@ -18,7 +18,9 @@
|
|||||||
#include "core/resources/resource_helper.hpp" // Para ResourceHelper
|
#include "core/resources/resource_helper.hpp" // Para ResourceHelper
|
||||||
#include "core/resources/resource_list.hpp" // Para Asset, AssetType
|
#include "core/resources/resource_list.hpp" // Para Asset, AssetType
|
||||||
#include "core/resources/resource_loader.hpp" // Para ResourceLoader
|
#include "core/resources/resource_loader.hpp" // Para ResourceLoader
|
||||||
|
#ifdef _DEBUG
|
||||||
#include "core/system/debug.hpp" // Para Debug
|
#include "core/system/debug.hpp" // Para Debug
|
||||||
|
#endif
|
||||||
#include "game/gameplay/cheevos.hpp" // Para Cheevos
|
#include "game/gameplay/cheevos.hpp" // Para Cheevos
|
||||||
#include "game/options.hpp" // Para Options, options, OptionsVideo
|
#include "game/options.hpp" // Para Options, options, OptionsVideo
|
||||||
#include "game/scene_manager.hpp" // Para SceneManager
|
#include "game/scene_manager.hpp" // Para SceneManager
|
||||||
@@ -143,7 +145,9 @@ Director::Director(std::vector<std::string> const& args) {
|
|||||||
// Aplica las teclas configuradas desde Options
|
// Aplica las teclas configuradas desde Options
|
||||||
Input::get()->applyKeyboardBindingsFromOptions();
|
Input::get()->applyKeyboardBindingsFromOptions();
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
Debug::init();
|
Debug::init();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Special handling for cheevos.bin - also needs filesystem path
|
// Special handling for cheevos.bin - also needs filesystem path
|
||||||
#ifdef RELEASE_BUILD
|
#ifdef RELEASE_BUILD
|
||||||
@@ -160,7 +164,9 @@ Director::~Director() {
|
|||||||
|
|
||||||
// Destruye los singletones
|
// Destruye los singletones
|
||||||
Cheevos::destroy();
|
Cheevos::destroy();
|
||||||
|
#ifdef _DEBUG
|
||||||
Debug::destroy();
|
Debug::destroy();
|
||||||
|
#endif
|
||||||
Input::destroy();
|
Input::destroy();
|
||||||
Notifier::destroy();
|
Notifier::destroy();
|
||||||
Resource::Cache::destroy();
|
Resource::Cache::destroy();
|
||||||
|
|||||||
@@ -82,8 +82,10 @@ void Player::move(float delta_time) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
syncSpriteAndCollider(); // Actualiza la posición del sprite y las colisiones
|
syncSpriteAndCollider(); // Actualiza la posición del sprite y las colisiones
|
||||||
|
#ifdef _DEBUG
|
||||||
Debug::get()->add(std::string("X: " + std::to_string(static_cast<int>(x_))));
|
Debug::get()->add(std::string("X: " + std::to_string(static_cast<int>(x_))));
|
||||||
Debug::get()->add(std::string("Y: " + std::to_string(static_cast<int>(y_))));
|
Debug::get()->add(std::string("Y: " + std::to_string(static_cast<int>(y_))));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::handleConveyorBelts() {
|
void Player::handleConveyorBelts() {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
#include <algorithm> // Para std::ranges::any_of
|
#include <algorithm> // Para std::ranges::any_of
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
#include "core/system/debug.hpp" // Para Debug
|
#include "core/system/debug.hpp" // Para Debug
|
||||||
|
#endif
|
||||||
#include "utils/defines.hpp" // Para Collision
|
#include "utils/defines.hpp" // Para Collision
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
#include "core/rendering/screen.hpp"
|
#include "core/rendering/screen.hpp"
|
||||||
#include "core/rendering/surface.hpp"
|
#include "core/rendering/surface.hpp"
|
||||||
#include "core/rendering/surface_sprite.hpp"
|
#include "core/rendering/surface_sprite.hpp"
|
||||||
|
#ifdef _DEBUG
|
||||||
#include "core/system/debug.hpp"
|
#include "core/system/debug.hpp"
|
||||||
|
#endif
|
||||||
#include "game/gameplay/collision_map.hpp"
|
#include "game/gameplay/collision_map.hpp"
|
||||||
#include "utils/utils.hpp"
|
#include "utils/utils.hpp"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user