activa -Wextra -Wpedantic i neteja warnings
This commit is contained in:
+2
-2
@@ -266,7 +266,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
|
||||||
@@ -418,7 +418,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_; }
|
||||||
@@ -139,8 +139,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
|
||||||
|
|||||||
@@ -65,7 +65,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
|
||||||
@@ -316,7 +316,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
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ void Scoreboard::render() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza las variables del objeto
|
// Actualiza las variables del objeto
|
||||||
void Scoreboard::update(float delta_time) {
|
void Scoreboard::update(float /*delta_time*/) {
|
||||||
fillTexture();
|
fillTexture();
|
||||||
|
|
||||||
if (!is_paused_) {
|
if (!is_paused_) {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void SolidActorManager::forEachActor(Fn&& fn) const {
|
|||||||
// Sin esto, Player::stuckAgainstWall no detectaba puertas cerradas en contacto
|
// Sin esto, Player::stuckAgainstWall no detectaba puertas cerradas en contacto
|
||||||
// y la animación "walk" se reproducía aunque el clamp de moveHorizontal
|
// y la animación "walk" se reproducía aunque el clamp de moveHorizontal
|
||||||
// dejase x_ inmóvil.
|
// dejase x_ inmóvil.
|
||||||
auto SolidActorManager::checkWallLeft(float px, float py, float pw, float ph) const -> float {
|
auto SolidActorManager::checkWallLeft(float px, float py, float /*pw*/, float ph) const -> float {
|
||||||
float result = Collision::NONE;
|
float result = Collision::NONE;
|
||||||
forEachActor([&](const SolidActor* a, const SDL_FRect& r) {
|
forEachActor([&](const SolidActor* a, const SDL_FRect& r) {
|
||||||
if (!a->isBlocking()) { return; }
|
if (!a->isBlocking()) { return; }
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ static void renderDebugCollisionTilemap(const std::vector<int>& collision_tile_m
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Pinta el mapa estático
|
// Pinta el mapa estático
|
||||||
void TilemapRenderer::fillMapTexture(const std::vector<int>& collision_tile_map) {
|
void TilemapRenderer::fillMapTexture(const std::vector<int>& /*collision_tile_map*/) {
|
||||||
auto previous_renderer = Screen::get()->getRendererSurface();
|
auto previous_renderer = Screen::get()->getRendererSurface();
|
||||||
Screen::get()->setRendererSurface(map_surface_);
|
Screen::get()->setRendererSurface(map_surface_);
|
||||||
map_surface_->clear(bg_color_);
|
map_surface_->clear(bg_color_);
|
||||||
|
|||||||
@@ -70,7 +70,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;
|
||||||
|
|||||||
@@ -116,7 +116,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