build: unifica .clang-format/.clang-tidy i exclou external/ i spv/ amb dummies
This commit is contained in:
@@ -11,9 +11,8 @@ Checks:
|
|||||||
- -modernize-avoid-c-arrays,-warnings-as-errors
|
- -modernize-avoid-c-arrays,-warnings-as-errors
|
||||||
|
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
# Solo incluir archivos de tu código fuente (external tiene su propio .clang-tidy)
|
# Solo headers del propio código fuente (external/ y spv/ tienen su propio .clang-tidy dummy)
|
||||||
# Excluye jail_audio.hpp del análisis
|
HeaderFilterRegex: 'source/.*'
|
||||||
HeaderFilterRegex: 'source/(?!core/audio/jail_audio\.hpp|core/rendering/sdl3gpu/.*_spv\.h).*'
|
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
|
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
@@ -40,7 +39,7 @@ CheckOptions:
|
|||||||
# Variables estáticas privadas como miembros privados
|
# Variables estáticas privadas como miembros privados
|
||||||
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
|
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
|
||||||
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
|
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
|
||||||
|
|
||||||
# Constantes estáticas sin sufijo
|
# Constantes estáticas sin sufijo
|
||||||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(projecte_2026 VERSION 1.00)
|
project(projecte_2026 VERSION 1.00)
|
||||||
|
|
||||||
|
# Tipus de build per defecte (Debug) si no se n'ha especificat cap
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Establecer estándar de C++
|
# Establecer estándar de C++
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
@@ -167,7 +172,7 @@ if(NOT APPLE AND NOT EMSCRIPTEN)
|
|||||||
find_program(GLSLC_EXE NAMES glslc)
|
find_program(GLSLC_EXE NAMES glslc)
|
||||||
|
|
||||||
set(SHADERS_DIR "${CMAKE_SOURCE_DIR}/data/shaders")
|
set(SHADERS_DIR "${CMAKE_SOURCE_DIR}/data/shaders")
|
||||||
set(HEADERS_DIR "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu")
|
set(HEADERS_DIR "${CMAKE_SOURCE_DIR}/source/core/rendering/sdl3gpu/spv")
|
||||||
|
|
||||||
set(SHADER_POSTFX_VERT_SRC "${SHADERS_DIR}/postfx.vert")
|
set(SHADER_POSTFX_VERT_SRC "${SHADERS_DIR}/postfx.vert")
|
||||||
set(SHADER_POSTFX_FRAG_SRC "${SHADERS_DIR}/postfx.frag")
|
set(SHADER_POSTFX_FRAG_SRC "${SHADERS_DIR}/postfx.frag")
|
||||||
@@ -324,10 +329,7 @@ file(GLOB_RECURSE ALL_SOURCE_FILES
|
|||||||
# Excluir directorio external del análisis
|
# Excluir directorio external del análisis
|
||||||
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX ".*/external/.*")
|
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX ".*/external/.*")
|
||||||
|
|
||||||
# Para clang-tidy, también excluir jail_audio.hpp
|
|
||||||
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
||||||
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*jail_audio\\.hpp$")
|
|
||||||
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*_spv\\.h$")
|
|
||||||
|
|
||||||
# Para cppcheck, pasar solo .cpp (los headers se procesan transitivamente).
|
# Para cppcheck, pasar solo .cpp (los headers se procesan transitivamente).
|
||||||
# Si pasamos .hpp como TUs independientes, cppcheck reporta falsos positivos de
|
# Si pasamos .hpp como TUs independientes, cppcheck reporta falsos positivos de
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -35,16 +35,17 @@ static void installWebStandardMapping(SDL_JoystickID jid) {
|
|||||||
|
|
||||||
char mapping[512];
|
char mapping[512];
|
||||||
SDL_snprintf(mapping, sizeof(mapping),
|
SDL_snprintf(mapping, sizeof(mapping),
|
||||||
"%s,%s,"
|
"%s,%s,"
|
||||||
"a:b0,b:b1,x:b2,y:b3,"
|
"a:b0,b:b1,x:b2,y:b3,"
|
||||||
"leftshoulder:b4,rightshoulder:b5,"
|
"leftshoulder:b4,rightshoulder:b5,"
|
||||||
"back:b6,start:b7,"
|
"back:b6,start:b7,"
|
||||||
"leftstick:b8,rightstick:b9,"
|
"leftstick:b8,rightstick:b9,"
|
||||||
"dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,"
|
"dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,"
|
||||||
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
||||||
"lefttrigger:a4,righttrigger:a5,"
|
"lefttrigger:a4,righttrigger:a5,"
|
||||||
"platform:Emscripten",
|
"platform:Emscripten",
|
||||||
guidStr, name);
|
guidStr,
|
||||||
|
name);
|
||||||
SDL_AddGamepadMapping(mapping);
|
SDL_AddGamepadMapping(mapping);
|
||||||
#else
|
#else
|
||||||
(void)jid;
|
(void)jid;
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
#include "core/rendering/sdl3gpu/sdl3gpu_shader.hpp" // Para SDL3GPUShader (no soportado en WebGL2)
|
#include "core/rendering/sdl3gpu/sdl3gpu_shader.hpp" // Para SDL3GPUShader (no soportado en WebGL2)
|
||||||
#endif
|
#endif
|
||||||
#include "core/rendering/surface.hpp" // Para Surface, readPalFile
|
#include "core/rendering/surface.hpp" // Para Surface, readPalFile
|
||||||
#include "core/rendering/text.hpp" // Para Text
|
#include "core/rendering/text.hpp" // Para Text
|
||||||
#include "core/resources/resource_cache.hpp" // Para Resource
|
#include "core/resources/resource_cache.hpp" // Para Resource
|
||||||
#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 "game/options.hpp" // Para Options, options, OptionsVideo, Border
|
#include "game/options.hpp" // Para Options, options, OptionsVideo, Border
|
||||||
#include "game/ui/console.hpp" // Para Console
|
#include "game/ui/console.hpp" // Para Console
|
||||||
#include "game/ui/notifier.hpp" // Para Notifier
|
#include "game/ui/notifier.hpp" // Para Notifier
|
||||||
|
|
||||||
// [SINGLETON]
|
// [SINGLETON]
|
||||||
Screen* Screen::screen = nullptr;
|
Screen* Screen::screen = nullptr;
|
||||||
|
|||||||
@@ -135,16 +135,16 @@ class Screen {
|
|||||||
static Screen* screen;
|
static Screen* screen;
|
||||||
|
|
||||||
// Métodos privados
|
// Métodos privados
|
||||||
void renderNotifications() const; // Dibuja las notificaciones
|
void renderNotifications() const; // Dibuja las notificaciones
|
||||||
void adjustWindowSize(); // Calcula el tamaño de la ventana
|
void adjustWindowSize(); // Calcula el tamaño de la ventana
|
||||||
void adjustRenderLogicalSize(); // Ajusta el tamaño lógico del renderizador
|
void adjustRenderLogicalSize(); // Ajusta el tamaño lógico del renderizador
|
||||||
void surfaceToTexture(); // Copia la surface a la textura
|
void surfaceToTexture(); // Copia la surface a la textura
|
||||||
void textureToRenderer(); // Copia la textura al renderizador
|
void textureToRenderer(); // Copia la textura al renderizador
|
||||||
void renderOverlays(); // Renderiza todos los overlays
|
void renderOverlays(); // Renderiza todos los overlays
|
||||||
void initShaders(); // Inicializa los shaders
|
void initShaders(); // Inicializa los shaders
|
||||||
void applyCurrentPostFXPreset(); // Aplica los parámetros del preset PostFX actual al backend
|
void applyCurrentPostFXPreset(); // Aplica los parámetros del preset PostFX actual al backend
|
||||||
void applyCurrentCrtPiPreset(); // Aplica los parámetros del preset CrtPi actual al backend
|
void applyCurrentCrtPiPreset(); // Aplica los parámetros del preset CrtPi actual al backend
|
||||||
void getDisplayInfo(); // Obtiene información sobre la pantalla
|
void getDisplayInfo(); // Obtiene información sobre la pantalla
|
||||||
auto initSDLVideo() -> bool; // Arranca SDL VIDEO y crea la ventana
|
auto initSDLVideo() -> bool; // Arranca SDL VIDEO y crea la ventana
|
||||||
void registerEmscriptenEventCallbacks(); // Registra los callbacks nativos para restaurar el canvas en wasm (no-op fuera de emscripten)
|
void registerEmscriptenEventCallbacks(); // Registra los callbacks nativos para restaurar el canvas en wasm (no-op fuera de emscripten)
|
||||||
void createText(); // Crea el objeto de texto
|
void createText(); // Crea el objeto de texto
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
#include <iostream> // std::cout
|
#include <iostream> // std::cout
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
#include "core/rendering/sdl3gpu/crtpi_frag_spv.h"
|
#include "core/rendering/sdl3gpu/spv/crtpi_frag_spv.h"
|
||||||
#include "core/rendering/sdl3gpu/downscale_frag_spv.h"
|
#include "core/rendering/sdl3gpu/spv/downscale_frag_spv.h"
|
||||||
#include "core/rendering/sdl3gpu/postfx_frag_spv.h"
|
#include "core/rendering/sdl3gpu/spv/postfx_frag_spv.h"
|
||||||
#include "core/rendering/sdl3gpu/postfx_vert_spv.h"
|
#include "core/rendering/sdl3gpu/spv/postfx_vert_spv.h"
|
||||||
#include "core/rendering/sdl3gpu/upscale_frag_spv.h"
|
#include "core/rendering/sdl3gpu/spv/upscale_frag_spv.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|||||||
2
source/core/rendering/sdl3gpu/spv/.clang-format
Normal file
2
source/core/rendering/sdl3gpu/spv/.clang-format
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: Never
|
||||||
4
source/core/rendering/sdl3gpu/spv/.clang-tidy
Normal file
4
source/core/rendering/sdl3gpu/spv/.clang-tidy
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# source/core/rendering/sdl3gpu/spv/.clang-tidy
|
||||||
|
Checks: '-*'
|
||||||
|
WarningsAsErrors: ''
|
||||||
|
HeaderFilterRegex: ''
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "core/system/global_events.hpp"
|
#include "core/system/global_events.hpp"
|
||||||
|
|
||||||
#include "core/input/input.hpp" // Para Input (gamepad add/remove)
|
#include "core/input/input.hpp" // Para Input (gamepad add/remove)
|
||||||
#include "core/input/mouse.hpp"
|
#include "core/input/mouse.hpp"
|
||||||
#include "core/locale/locale.hpp" // Para Locale
|
#include "core/locale/locale.hpp" // Para Locale
|
||||||
#include "game/options.hpp" // Para Options, options, OptionsGame, OptionsAudio
|
#include "game/options.hpp" // Para Options, options, OptionsGame, OptionsAudio
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ namespace Options {
|
|||||||
inline GamepadControls gamepad_controls{}; // Botones del gamepad usados para jugar
|
inline GamepadControls gamepad_controls{}; // Botones del gamepad usados para jugar
|
||||||
inline Kiosk kiosk{}; // Opciones del modo kiosko
|
inline Kiosk kiosk{}; // Opciones del modo kiosko
|
||||||
inline Console console{}; // Opciones visuales de la consola en pantalla
|
inline Console console{}; // Opciones visuales de la consola en pantalla
|
||||||
inline Loading loading{}; // Opciones de la pantalla de carga de recursos
|
inline Loading loading{}; // Opciones de la pantalla de carga de recursos
|
||||||
|
|
||||||
// Idioma del juego (establecido al inicio, sin cambio en caliente)
|
// Idioma del juego (establecido al inicio, sin cambio en caliente)
|
||||||
inline std::string language{Defaults::Localization::LANGUAGE};
|
inline std::string language{Defaults::Localization::LANGUAGE};
|
||||||
|
|||||||
Reference in New Issue
Block a user