activa -Wextra -Wpedantic i neteja warnings
This commit is contained in:
+2
-2
@@ -244,7 +244,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3)
|
|||||||
|
|
||||||
# --- 4. CONFIGURACIÓN PLATAFORMAS Y COMPILADOR ---
|
# --- 4. CONFIGURACIÓN PLATAFORMAS Y COMPILADOR ---
|
||||||
# Configuración de flags de compilación
|
# Configuración de flags de compilación
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunction-sections -fdata-sections>)
|
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunction-sections -fdata-sections>)
|
||||||
|
|
||||||
# Definir _DEBUG en modo Debug y RELEASE_BUILD en modo Release
|
# Definir _DEBUG en modo Debug y RELEASE_BUILD en modo Release
|
||||||
@@ -390,7 +390,7 @@ if(NOT EMSCRIPTEN)
|
|||||||
source/core/resources/resource_pack.cpp
|
source/core/resources/resource_pack.cpp
|
||||||
)
|
)
|
||||||
target_include_directories(pack_resources PRIVATE "${CMAKE_SOURCE_DIR}/source")
|
target_include_directories(pack_resources PRIVATE "${CMAKE_SOURCE_DIR}/source")
|
||||||
target_compile_options(pack_resources PRIVATE -Wall)
|
target_compile_options(pack_resources PRIVATE -Wall -Wextra -Wpedantic)
|
||||||
|
|
||||||
# Regeneració automàtica de resources.pack en cada build si canvia data/.
|
# Regeneració automàtica de resources.pack en cada build si canvia data/.
|
||||||
file(GLOB_RECURSE DATA_FILES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/data/*")
|
file(GLOB_RECURSE DATA_FILES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/data/*")
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace GIF {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Gif::processImageDescriptor(const uint8_t*& buffer, const std::vector<RGB>& gct, int resolution_bits) -> std::vector<uint8_t> {
|
auto Gif::processImageDescriptor(const uint8_t*& buffer, const std::vector<RGB>& /*gct*/, int /*resolution_bits*/) -> std::vector<uint8_t> {
|
||||||
ImageDescriptor image_descriptor;
|
ImageDescriptor image_descriptor;
|
||||||
// Lee 9 bytes para el image descriptor.
|
// Lee 9 bytes para el image descriptor.
|
||||||
readBytes(buffer, &image_descriptor, sizeof(ImageDescriptor));
|
readBytes(buffer, &image_descriptor, sizeof(ImageDescriptor));
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Rendering {
|
|||||||
const std::string& fragment_source) -> bool override;
|
const std::string& fragment_source) -> bool override;
|
||||||
|
|
||||||
void render() override;
|
void render() override;
|
||||||
void setTextureSize(float width, float height) override {}
|
void setTextureSize(float /*width*/, float /*height*/) override {}
|
||||||
void cleanup() final; // Libera pipeline/texturas pero mantiene el device vivo
|
void cleanup() final; // Libera pipeline/texturas pero mantiene el device vivo
|
||||||
void destroy(); // Limpieza completa (device + swapchain); llamar solo al cerrar
|
void destroy(); // Limpieza completa (device + swapchain); llamar solo al cerrar
|
||||||
[[nodiscard]] auto isHardwareAccelerated() const -> bool override { return is_initialized_; }
|
[[nodiscard]] auto isHardwareAccelerated() const -> bool override { return is_initialized_; }
|
||||||
@@ -151,8 +151,40 @@ namespace Rendering {
|
|||||||
SDL_GPUTransferBuffer* upload_buffer_ = nullptr;
|
SDL_GPUTransferBuffer* upload_buffer_ = nullptr;
|
||||||
SDL_GPUSampler* sampler_ = nullptr; // NEAREST
|
SDL_GPUSampler* sampler_ = nullptr; // NEAREST
|
||||||
|
|
||||||
PostFXUniforms uniforms_{.vignette_strength = 0.6F, .chroma_min = 0.15F, .scanline_strength = 0.7F, .screen_height = 192.0F, .pixel_scale = 1.0F, .chroma_max = 0.15F, .scan_dark_ratio = 0.333F, .scan_dark_floor = 0.42F, .scan_edge_soft = 1.0F};
|
PostFXUniforms uniforms_{
|
||||||
CrtPiUniforms crtpi_uniforms_{.scanline_weight = 6.0F, .scanline_gap_brightness = 0.12F, .bloom_factor = 3.5F, .input_gamma = 2.4F, .output_gamma = 2.2F, .mask_brightness = 0.80F, .curvature_x = 0.05F, .curvature_y = 0.10F, .mask_type = 2, .enable_scanlines = 1, .enable_multisample = 1, .enable_gamma = 1};
|
.vignette_strength = 0.6F,
|
||||||
|
.chroma_min = 0.15F,
|
||||||
|
.scanline_strength = 0.7F,
|
||||||
|
.screen_height = 192.0F,
|
||||||
|
.mask_strength = 0.0F,
|
||||||
|
.gamma_strength = 0.0F,
|
||||||
|
.curvature = 0.0F,
|
||||||
|
.bleeding = 0.0F,
|
||||||
|
.pixel_scale = 1.0F,
|
||||||
|
.time = 0.0F,
|
||||||
|
.flicker = 0.0F,
|
||||||
|
.chroma_max = 0.15F,
|
||||||
|
.scan_dark_ratio = 0.333F,
|
||||||
|
.scan_dark_floor = 0.42F,
|
||||||
|
.scan_edge_soft = 1.0F,
|
||||||
|
.pad3 = 0.0F};
|
||||||
|
CrtPiUniforms crtpi_uniforms_{
|
||||||
|
.scanline_weight = 6.0F,
|
||||||
|
.scanline_gap_brightness = 0.12F,
|
||||||
|
.bloom_factor = 3.5F,
|
||||||
|
.input_gamma = 2.4F,
|
||||||
|
.output_gamma = 2.2F,
|
||||||
|
.mask_brightness = 0.80F,
|
||||||
|
.curvature_x = 0.05F,
|
||||||
|
.curvature_y = 0.10F,
|
||||||
|
.mask_type = 2,
|
||||||
|
.enable_scanlines = 1,
|
||||||
|
.enable_multisample = 1,
|
||||||
|
.enable_gamma = 1,
|
||||||
|
.enable_curvature = 0,
|
||||||
|
.enable_sharper = 0,
|
||||||
|
.texture_width = 0.0F,
|
||||||
|
.texture_height = 0.0F};
|
||||||
ShaderType active_shader_ = ShaderType::POSTFX; // Shader de post-procesado activo
|
ShaderType active_shader_ = ShaderType::POSTFX; // Shader de post-procesado activo
|
||||||
|
|
||||||
int game_width_ = 0; // Dimensiones originales del canvas
|
int game_width_ = 0; // Dimensiones originales del canvas
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Director::Director()
|
|||||||
// Crea el subdirectorio shaders/ dentro de system_folder_ sin modificar system_folder_
|
// Crea el subdirectorio shaders/ dentro de system_folder_ sin modificar system_folder_
|
||||||
{
|
{
|
||||||
std::string shaders_dir = system_folder_ + "/shaders";
|
std::string shaders_dir = system_folder_ + "/shaders";
|
||||||
struct stat st = {.st_dev = 0};
|
struct stat st{};
|
||||||
if (stat(shaders_dir.c_str(), &st) == -1) {
|
if (stat(shaders_dir.c_str(), &st) == -1) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -319,7 +319,7 @@ void Director::createSystemFolder(const std::string& folder) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct stat st = {.st_dev = 0};
|
struct stat st{};
|
||||||
if (stat(system_folder_.c_str(), &st) == -1) {
|
if (stat(system_folder_.c_str(), &st) == -1) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ void TilemapRenderer::setTile(int index, int tile_value) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Pinta el mapa estático y debug lines
|
// Pinta el mapa estático y debug lines
|
||||||
void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) {
|
void TilemapRenderer::fillMapTexture(const CollisionMap* /*collision_map*/) {
|
||||||
const Uint8 COLOR = stringToColor(bg_color_);
|
const Uint8 COLOR = stringToColor(bg_color_);
|
||||||
auto previous_renderer = Screen::get()->getRendererSurface();
|
auto previous_renderer = Screen::get()->getRendererSurface();
|
||||||
Screen::get()->setRendererSurface(map_surface_);
|
Screen::get()->setRendererSurface(map_surface_);
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ void LoadingScreen::updateState(float delta_time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gestiona la carga monocromática (time-based simplificado)
|
// Gestiona la carga monocromática (time-based simplificado)
|
||||||
void LoadingScreen::updateMonoLoad(float delta_time) {
|
void LoadingScreen::updateMonoLoad(float /*delta_time*/) {
|
||||||
// Calcular progreso lineal (0.0 - 1.0)
|
// Calcular progreso lineal (0.0 - 1.0)
|
||||||
float progress = state_time_ / LOADING_MONO_DURATION;
|
float progress = state_time_ / LOADING_MONO_DURATION;
|
||||||
progress = std::min(progress, 1.0F);
|
progress = std::min(progress, 1.0F);
|
||||||
@@ -234,7 +234,7 @@ void LoadingScreen::updateMonoLoad(float delta_time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gestiona la carga en color
|
// Gestiona la carga en color
|
||||||
void LoadingScreen::updateColorLoad(float delta_time) {
|
void LoadingScreen::updateColorLoad(float /*delta_time*/) {
|
||||||
// Calcular progreso lineal (0.0 - 1.0)
|
// Calcular progreso lineal (0.0 - 1.0)
|
||||||
float progress = state_time_ / LOADING_COLOR_DURATION;
|
float progress = state_time_ / LOADING_COLOR_DURATION;
|
||||||
progress = std::min(progress, 1.0F);
|
progress = std::min(progress, 1.0F);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ void Logo::handleInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gestiona el logo de JAILGAME
|
// Gestiona el logo de JAILGAME
|
||||||
void Logo::updateJAILGAMES(float delta_time) {
|
void Logo::updateJAILGAMES(float /*delta_time*/) {
|
||||||
// Solo actualizar durante el estado JAILGAMES_SLIDE_IN
|
// Solo actualizar durante el estado JAILGAMES_SLIDE_IN
|
||||||
if (state_ != State::JAILGAMES_SLIDE_IN) {
|
if (state_ != State::JAILGAMES_SLIDE_IN) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ void Title::handleMainMenuKeyPress(SDL_Keycode key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba las entradas
|
// Comprueba las entradas
|
||||||
void Title::handleInput(float delta_time) {
|
void Title::handleInput(float /*delta_time*/) {
|
||||||
Input::get()->update();
|
Input::get()->update();
|
||||||
|
|
||||||
// Permitir cancelar remap con ESC/CANCEL
|
// Permitir cancelar remap con ESC/CANCEL
|
||||||
|
|||||||
Reference in New Issue
Block a user