build: unifica .clang-format/.clang-tidy i exclou external/ i spv/ amb dummies
This commit is contained in:
79
.clang-tidy
Normal file
79
.clang-tidy
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
Checks:
|
||||||
|
- readability-*
|
||||||
|
- modernize-*
|
||||||
|
- performance-*
|
||||||
|
- bugprone-*
|
||||||
|
- -readability-identifier-length
|
||||||
|
- -readability-magic-numbers
|
||||||
|
- -bugprone-integer-division
|
||||||
|
- -bugprone-easily-swappable-parameters
|
||||||
|
- -bugprone-narrowing-conversions
|
||||||
|
- -modernize-avoid-c-arrays,-warnings-as-errors
|
||||||
|
|
||||||
|
WarningsAsErrors: '*'
|
||||||
|
# Solo headers del propio código fuente (external/ y spv/ tienen su propio .clang-tidy dummy)
|
||||||
|
HeaderFilterRegex: 'source/.*'
|
||||||
|
FormatStyle: file
|
||||||
|
|
||||||
|
CheckOptions:
|
||||||
|
# bugprone-empty-catch: aceptar catches vacíos marcados con @INTENTIONAL en un comentario
|
||||||
|
- { key: bugprone-empty-catch.IgnoreCatchWithKeywords, value: '@INTENTIONAL' }
|
||||||
|
|
||||||
|
# Variables locales en snake_case
|
||||||
|
- { key: readability-identifier-naming.VariableCase, value: lower_case }
|
||||||
|
|
||||||
|
# Miembros privados en snake_case con sufijo _
|
||||||
|
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
|
||||||
|
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
|
||||||
|
|
||||||
|
# Miembros protegidos en snake_case con sufijo _
|
||||||
|
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
|
||||||
|
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
|
||||||
|
|
||||||
|
# Miembros públicos en snake_case (sin sufijo)
|
||||||
|
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case }
|
||||||
|
|
||||||
|
# Namespaces en CamelCase
|
||||||
|
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
|
||||||
|
|
||||||
|
# Variables estáticas privadas como miembros privados
|
||||||
|
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
|
||||||
|
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
|
||||||
|
|
||||||
|
# Constantes estáticas sin sufijo
|
||||||
|
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Constantes globales en UPPER_CASE
|
||||||
|
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Variables constexpr globales en UPPER_CASE
|
||||||
|
- { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Constantes locales en UPPER_CASE
|
||||||
|
- { key: readability-identifier-naming.LocalConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Constexpr miembros en UPPER_CASE (sin sufijo)
|
||||||
|
- { key: readability-identifier-naming.ConstexprMemberCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Constexpr miembros privados/protegidos con sufijo _
|
||||||
|
- { key: readability-identifier-naming.ConstexprMethodCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Clases, structs y enums en CamelCase
|
||||||
|
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||||
|
- { key: readability-identifier-naming.StructCase, value: CamelCase }
|
||||||
|
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
|
||||||
|
|
||||||
|
# Valores de enums en UPPER_CASE
|
||||||
|
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
|
||||||
|
|
||||||
|
# Métodos en camelBack (sin sufijos)
|
||||||
|
- { key: readability-identifier-naming.MethodCase, value: camelBack }
|
||||||
|
- { key: readability-identifier-naming.PrivateMethodCase, value: camelBack }
|
||||||
|
- { key: readability-identifier-naming.ProtectedMethodCase, value: camelBack }
|
||||||
|
- { key: readability-identifier-naming.PublicMethodCase, value: camelBack }
|
||||||
|
|
||||||
|
# Funciones en camelBack
|
||||||
|
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
|
||||||
|
|
||||||
|
# Parámetros en lower_case
|
||||||
|
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
|
||||||
@@ -3,6 +3,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(aee VERSION 1.00)
|
project(aee 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()
|
||||||
|
|
||||||
# Estándar de C++
|
# 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)
|
||||||
@@ -136,7 +141,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(ALL_SHADER_HEADERS
|
set(ALL_SHADER_HEADERS
|
||||||
"${HEADERS_DIR}/postfx_vert_spv.h"
|
"${HEADERS_DIR}/postfx_vert_spv.h"
|
||||||
@@ -302,9 +307,7 @@ file(GLOB_RECURSE ALL_SOURCE_FILES
|
|||||||
)
|
)
|
||||||
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX ".*/external/.*")
|
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX ".*/external/.*")
|
||||||
|
|
||||||
# Para clang-tidy, excluir headers SPIR-V generados
|
|
||||||
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
|
||||||
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).
|
||||||
set(CPPCHECK_SOURCES ${ALL_SOURCE_FILES})
|
set(CPPCHECK_SOURCES ${ALL_SOURCE_FILES})
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,8 @@ namespace Gamepad {
|
|||||||
"guide:b16,"
|
"guide:b16,"
|
||||||
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
"leftx:a0,lefty:a1,rightx:a2,righty:a3,"
|
||||||
"platform:Emscripten",
|
"platform:Emscripten",
|
||||||
guidStr, name);
|
guidStr,
|
||||||
|
name);
|
||||||
SDL_AddGamepadMapping(mapping);
|
SDL_AddGamepadMapping(mapping);
|
||||||
#else
|
#else
|
||||||
(void)jid;
|
(void)jid;
|
||||||
|
|||||||
@@ -171,8 +171,7 @@ namespace Menu {
|
|||||||
}
|
}
|
||||||
return std::string(Locale::get("menu.values.scaling_integer")); }, [](int dir) { Screen::get()->cycleScalingMode(dir); }, nullptr, nullptr, nullptr});
|
return std::string(Locale::get("menu.values.scaling_integer")); }, [](int dir) { Screen::get()->cycleScalingMode(dir); }, nullptr, nullptr, nullptr});
|
||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.texture_filter"), ItemKind::Cycle, [] {
|
p.items.push_back({Locale::get("menu.items.texture_filter"), ItemKind::Cycle, [] { return std::string(Options::video.texture_filter == Options::TextureFilter::LINEAR
|
||||||
return std::string(Options::video.texture_filter == Options::TextureFilter::LINEAR
|
|
||||||
? Locale::get("menu.values.linear")
|
? Locale::get("menu.values.linear")
|
||||||
: Locale::get("menu.values.nearest")); }, [](int dir) { Screen::get()->cycleTextureFilter(dir); }, nullptr, nullptr, nullptr});
|
: Locale::get("menu.values.nearest")); }, [](int dir) { Screen::get()->cycleTextureFilter(dir); }, nullptr, nullptr, nullptr});
|
||||||
|
|
||||||
@@ -187,20 +186,16 @@ namespace Menu {
|
|||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.shader_type"), ItemKind::Cycle, [] { return std::string(Screen::get()->getActiveShaderName()); }, [](int dir) {
|
p.items.push_back({Locale::get("menu.items.shader_type"), ItemKind::Cycle, [] { return std::string(Screen::get()->getActiveShaderName()); }, [](int dir) {
|
||||||
if (dir < 0) Screen::get()->prevShaderType();
|
if (dir < 0) Screen::get()->prevShaderType();
|
||||||
else Screen::get()->nextShaderType(); }, nullptr, nullptr,
|
else Screen::get()->nextShaderType(); }, nullptr, nullptr, [] { return Options::video.shader_enabled; }});
|
||||||
[] { return Options::video.shader_enabled; }});
|
|
||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.preset"), ItemKind::Cycle, [] { return std::string(Screen::get()->getCurrentPresetName()); }, [](int dir) {
|
p.items.push_back({Locale::get("menu.items.preset"), ItemKind::Cycle, [] { return std::string(Screen::get()->getCurrentPresetName()); }, [](int dir) {
|
||||||
if (dir < 0) Screen::get()->prevPreset();
|
if (dir < 0) Screen::get()->prevPreset();
|
||||||
else Screen::get()->nextPreset(); }, nullptr, nullptr,
|
else Screen::get()->nextPreset(); }, nullptr, nullptr, [] { return Options::video.shader_enabled; }});
|
||||||
[] { return Options::video.shader_enabled; }});
|
|
||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.supersampling"), ItemKind::Toggle, [] { return onOff(Options::video.supersampling); }, [](int) { Screen::get()->toggleSupersampling(); }, nullptr, nullptr,
|
p.items.push_back({Locale::get("menu.items.supersampling"), ItemKind::Toggle, [] { return onOff(Options::video.supersampling); }, [](int) { Screen::get()->toggleSupersampling(); }, nullptr, nullptr, [] {
|
||||||
[] {
|
|
||||||
if (!Options::video.shader_enabled) return false;
|
if (!Options::video.shader_enabled) return false;
|
||||||
const char* name = Screen::get()->getActiveShaderName();
|
const char* name = Screen::get()->getActiveShaderName();
|
||||||
return name && std::string(name) == "POSTFX";
|
return name && std::string(name) == "POSTFX"; }});
|
||||||
}});
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Informació de render
|
// Informació de render
|
||||||
@@ -212,8 +207,7 @@ namespace Menu {
|
|||||||
}
|
}
|
||||||
return std::string(Locale::get("menu.values.off")); }, [](int dir) { Overlay::cycleRenderInfo(dir); }, nullptr, nullptr, nullptr});
|
return std::string(Locale::get("menu.values.off")); }, [](int dir) { Overlay::cycleRenderInfo(dir); }, nullptr, nullptr, nullptr});
|
||||||
|
|
||||||
p.items.push_back({Locale::get("menu.items.uptime"), ItemKind::Toggle, [] { return onOff(Options::render_info.show_time); }, [](int) { Options::render_info.show_time = !Options::render_info.show_time; }, nullptr, nullptr,
|
p.items.push_back({Locale::get("menu.items.uptime"), ItemKind::Toggle, [] { return onOff(Options::render_info.show_time); }, [](int) { Options::render_info.show_time = !Options::render_info.show_time; }, nullptr, nullptr, [] { return Options::render_info.position != Options::RenderInfoPosition::OFF; }});
|
||||||
[] { return Options::render_info.position != Options::RenderInfoPosition::OFF; }});
|
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@@ -287,13 +281,15 @@ namespace Menu {
|
|||||||
p.items.push_back({Locale::get("menu.items.restart"), ItemKind::Action, nullptr, nullptr, [] {
|
p.items.push_back({Locale::get("menu.items.restart"), ItemKind::Action, nullptr, nullptr, [] {
|
||||||
if (Director::get()) Director::get()->requestRestart();
|
if (Director::get()) Director::get()->requestRestart();
|
||||||
},
|
},
|
||||||
nullptr, nullptr});
|
nullptr,
|
||||||
|
nullptr});
|
||||||
|
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
p.items.push_back({Locale::get("menu.items.exit_game"), ItemKind::Action, nullptr, nullptr, [] {
|
p.items.push_back({Locale::get("menu.items.exit_game"), ItemKind::Action, nullptr, nullptr, [] {
|
||||||
if (Director::get()) Director::get()->requestQuit();
|
if (Director::get()) Director::get()->requestQuit();
|
||||||
},
|
},
|
||||||
nullptr, nullptr});
|
nullptr,
|
||||||
|
nullptr});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
@@ -527,7 +523,8 @@ namespace Menu {
|
|||||||
}
|
}
|
||||||
// Compta visibles — si cap, dibuixa placeholder (caixa totalment col·lapsada però oberta)
|
// Compta visibles — si cap, dibuixa placeholder (caixa totalment col·lapsada però oberta)
|
||||||
int visible_count = 0;
|
int visible_count = 0;
|
||||||
for (const auto& it : page.items) if (isVisible(it)) ++visible_count;
|
for (const auto& it : page.items)
|
||||||
|
if (isVisible(it)) ++visible_count;
|
||||||
if (visible_count == 0) {
|
if (visible_count == 0) {
|
||||||
const char* empty_text = Locale::get("menu.values.empty");
|
const char* empty_text = Locale::get("menu.values.empty");
|
||||||
int ew = font_->width(empty_text);
|
int ew = font_->width(empty_text);
|
||||||
|
|||||||
@@ -32,26 +32,26 @@
|
|||||||
// resincronitzar l'estat intern de SDL — sense això la logical presentation
|
// resincronitzar l'estat intern de SDL — sense això la logical presentation
|
||||||
// no encaixa amb el canvas real.
|
// no encaixa amb el canvas real.
|
||||||
namespace {
|
namespace {
|
||||||
Screen* g_screen_instance = nullptr;
|
Screen* g_screen_instance = nullptr;
|
||||||
|
|
||||||
void deferredCanvasResize(void* /*userData*/) {
|
void deferredCanvasResize(void* /*userData*/) {
|
||||||
if (g_screen_instance != nullptr) {
|
if (g_screen_instance != nullptr) {
|
||||||
g_screen_instance->handleCanvasResized();
|
g_screen_instance->handleCanvasResized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EM_BOOL onEmFullscreenChange(int /*eventType*/, const EmscriptenFullscreenChangeEvent* event, void* /*userData*/) {
|
EM_BOOL onEmFullscreenChange(int /*eventType*/, const EmscriptenFullscreenChangeEvent* event, void* /*userData*/) {
|
||||||
if (g_screen_instance != nullptr && event != nullptr) {
|
if (g_screen_instance != nullptr && event != nullptr) {
|
||||||
g_screen_instance->syncFullscreenFlagFromBrowser(event->isFullscreen != 0);
|
g_screen_instance->syncFullscreenFlagFromBrowser(event->isFullscreen != 0);
|
||||||
}
|
}
|
||||||
emscripten_async_call(deferredCanvasResize, nullptr, 0);
|
emscripten_async_call(deferredCanvasResize, nullptr, 0);
|
||||||
return EM_FALSE;
|
return EM_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EM_BOOL onEmOrientationChange(int /*eventType*/, const EmscriptenOrientationChangeEvent* /*event*/, void* /*userData*/) {
|
EM_BOOL onEmOrientationChange(int /*eventType*/, const EmscriptenOrientationChangeEvent* /*event*/, void* /*userData*/) {
|
||||||
emscripten_async_call(deferredCanvasResize, nullptr, 0);
|
emscripten_async_call(deferredCanvasResize, nullptr, 0);
|
||||||
return EM_FALSE;
|
return EM_FALSE;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif // __EMSCRIPTEN__
|
#endif // __EMSCRIPTEN__
|
||||||
|
|
||||||
@@ -555,11 +555,21 @@ void Screen::applyFallbackPresentation() {
|
|||||||
mode = SDL_LOGICAL_PRESENTATION_STRETCH;
|
mode = SDL_LOGICAL_PRESENTATION_STRETCH;
|
||||||
} else {
|
} else {
|
||||||
switch (Options::video.scaling_mode) {
|
switch (Options::video.scaling_mode) {
|
||||||
case Options::ScalingMode::DISABLED: mode = SDL_LOGICAL_PRESENTATION_DISABLED; break;
|
case Options::ScalingMode::DISABLED:
|
||||||
case Options::ScalingMode::STRETCH: mode = SDL_LOGICAL_PRESENTATION_STRETCH; break;
|
mode = SDL_LOGICAL_PRESENTATION_DISABLED;
|
||||||
case Options::ScalingMode::LETTERBOX: mode = SDL_LOGICAL_PRESENTATION_LETTERBOX; break;
|
break;
|
||||||
case Options::ScalingMode::OVERSCAN: mode = SDL_LOGICAL_PRESENTATION_OVERSCAN; break;
|
case Options::ScalingMode::STRETCH:
|
||||||
case Options::ScalingMode::INTEGER: mode = SDL_LOGICAL_PRESENTATION_INTEGER_SCALE; break;
|
mode = SDL_LOGICAL_PRESENTATION_STRETCH;
|
||||||
|
break;
|
||||||
|
case Options::ScalingMode::LETTERBOX:
|
||||||
|
mode = SDL_LOGICAL_PRESENTATION_LETTERBOX;
|
||||||
|
break;
|
||||||
|
case Options::ScalingMode::OVERSCAN:
|
||||||
|
mode = SDL_LOGICAL_PRESENTATION_OVERSCAN;
|
||||||
|
break;
|
||||||
|
case Options::ScalingMode::INTEGER:
|
||||||
|
mode = SDL_LOGICAL_PRESENTATION_INTEGER_SCALE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Amb resolució interna N > 1, la mida lògica creix proporcionalment
|
// Amb resolució interna N > 1, la mida lògica creix proporcionalment
|
||||||
|
|||||||
@@ -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__
|
||||||
@@ -939,8 +939,7 @@ namespace Rendering {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Options::ScalingMode::INTEGER: {
|
case Options::ScalingMode::INTEGER: {
|
||||||
const int SCALE = std::max(1, std::min(static_cast<int>(sw) / static_cast<int>(logical_w),
|
const int SCALE = std::max(1, std::min(static_cast<int>(sw) / static_cast<int>(logical_w), static_cast<int>(sh) / static_cast<int>(logical_h)));
|
||||||
static_cast<int>(sh) / static_cast<int>(logical_h)));
|
|
||||||
vw = logical_w * static_cast<float>(SCALE);
|
vw = logical_w * static_cast<float>(SCALE);
|
||||||
vh = logical_h * static_cast<float>(SCALE);
|
vh = logical_h * static_cast<float>(SCALE);
|
||||||
break;
|
break;
|
||||||
@@ -1482,7 +1481,10 @@ namespace Rendering {
|
|||||||
internal_texture_ = SDL_CreateGPUTexture(device_, &info);
|
internal_texture_ = SDL_CreateGPUTexture(device_, &info);
|
||||||
if (internal_texture_ == nullptr) {
|
if (internal_texture_ == nullptr) {
|
||||||
SDL_Log("SDL3GPUShader: failed to create internal texture %dx%d (×%d): %s",
|
SDL_Log("SDL3GPUShader: failed to create internal texture %dx%d (×%d): %s",
|
||||||
W, H, internal_res_, SDL_GetError());
|
W,
|
||||||
|
H,
|
||||||
|
internal_res_,
|
||||||
|
SDL_GetError());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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: ''
|
||||||
4
source/external/.clang-tidy
vendored
Normal file
4
source/external/.clang-tidy
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# source/external/.clang-tidy
|
||||||
|
Checks: '-*'
|
||||||
|
WarningsAsErrors: ''
|
||||||
|
HeaderFilterRegex: ''
|
||||||
@@ -125,11 +125,16 @@ namespace Options {
|
|||||||
video.supersampling = node["supersampling"].get_value<bool>();
|
video.supersampling = node["supersampling"].get_value<bool>();
|
||||||
if (node.contains("scaling_mode")) {
|
if (node.contains("scaling_mode")) {
|
||||||
auto s = node["scaling_mode"].get_value<std::string>();
|
auto s = node["scaling_mode"].get_value<std::string>();
|
||||||
if (s == "disabled") video.scaling_mode = ScalingMode::DISABLED;
|
if (s == "disabled")
|
||||||
else if (s == "stretch") video.scaling_mode = ScalingMode::STRETCH;
|
video.scaling_mode = ScalingMode::DISABLED;
|
||||||
else if (s == "letterbox") video.scaling_mode = ScalingMode::LETTERBOX;
|
else if (s == "stretch")
|
||||||
else if (s == "overscan") video.scaling_mode = ScalingMode::OVERSCAN;
|
video.scaling_mode = ScalingMode::STRETCH;
|
||||||
else video.scaling_mode = ScalingMode::INTEGER;
|
else if (s == "letterbox")
|
||||||
|
video.scaling_mode = ScalingMode::LETTERBOX;
|
||||||
|
else if (s == "overscan")
|
||||||
|
video.scaling_mode = ScalingMode::OVERSCAN;
|
||||||
|
else
|
||||||
|
video.scaling_mode = ScalingMode::INTEGER;
|
||||||
}
|
}
|
||||||
if (node.contains("vsync"))
|
if (node.contains("vsync"))
|
||||||
video.vsync = node["vsync"].get_value<bool>();
|
video.vsync = node["vsync"].get_value<bool>();
|
||||||
@@ -290,11 +295,21 @@ namespace Options {
|
|||||||
{
|
{
|
||||||
const char* m = "integer";
|
const char* m = "integer";
|
||||||
switch (video.scaling_mode) {
|
switch (video.scaling_mode) {
|
||||||
case ScalingMode::DISABLED: m = "disabled"; break;
|
case ScalingMode::DISABLED:
|
||||||
case ScalingMode::STRETCH: m = "stretch"; break;
|
m = "disabled";
|
||||||
case ScalingMode::LETTERBOX: m = "letterbox"; break;
|
break;
|
||||||
case ScalingMode::OVERSCAN: m = "overscan"; break;
|
case ScalingMode::STRETCH:
|
||||||
case ScalingMode::INTEGER: m = "integer"; break;
|
m = "stretch";
|
||||||
|
break;
|
||||||
|
case ScalingMode::LETTERBOX:
|
||||||
|
m = "letterbox";
|
||||||
|
break;
|
||||||
|
case ScalingMode::OVERSCAN:
|
||||||
|
m = "overscan";
|
||||||
|
break;
|
||||||
|
case ScalingMode::INTEGER:
|
||||||
|
m = "integer";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
file << " scaling_mode: " << m << " # disabled|stretch|letterbox|overscan|integer\n";
|
file << " scaling_mode: " << m << " # disabled|stretch|letterbox|overscan|integer\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ namespace {
|
|||||||
// comú aplicat tant al blit del logo com als CURSOR_X de sota.
|
// comú aplicat tant al blit del logo com als CURSOR_X de sota.
|
||||||
constexpr int LOGO_DST_X = (320 - LETTER_WIDTHS[8]) / 2; // 66
|
constexpr int LOGO_DST_X = (320 - LETTER_WIDTHS[8]) / 2; // 66
|
||||||
constexpr int CENTER_SHIFT = LOGO_DST_X - LOGO_SRC_X; // +6
|
constexpr int CENTER_SHIFT = LOGO_DST_X - LOGO_SRC_X; // +6
|
||||||
constexpr int CURSOR_X[9] = {77 + CENTER_SHIFT, 100 + CENTER_SHIFT, 111 + CENTER_SHIFT,
|
constexpr int CURSOR_X[9] = {77 + CENTER_SHIFT, 100 + CENTER_SHIFT, 111 + CENTER_SHIFT, 130 + CENTER_SHIFT, 153 + CENTER_SHIFT, 176 + CENTER_SHIFT, 207 + CENTER_SHIFT, 230 + CENTER_SHIFT, 249 + CENTER_SHIFT};
|
||||||
130 + CENTER_SHIFT, 153 + CENTER_SHIFT, 176 + CENTER_SHIFT,
|
|
||||||
207 + CENTER_SHIFT, 230 + CENTER_SHIFT, 249 + CENTER_SHIFT};
|
|
||||||
constexpr int CURSOR_W = 12;
|
constexpr int CURSOR_W = 12;
|
||||||
constexpr int CURSOR_H = 3;
|
constexpr int CURSOR_H = 3;
|
||||||
constexpr int CURSOR_Y = LOGO_DST_Y + LOGO_HEIGHT - CURSOR_H; // y = 103
|
constexpr int CURSOR_Y = LOGO_DST_Y + LOGO_HEIGHT - CURSOR_H; // y = 103
|
||||||
|
|||||||
Reference in New Issue
Block a user