diff --git a/src/android/app/src/main/jni/config.cpp b/src/android/app/src/main/jni/config.cpp index f87486d330..c64bca6682 100644 --- a/src/android/app/src/main/jni/config.cpp +++ b/src/android/app/src/main/jni/config.cpp @@ -51,12 +51,15 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { } static const std::array default_buttons = { - InputManager::N3DS_BUTTON_A, InputManager::N3DS_BUTTON_B, InputManager::N3DS_BUTTON_X, - InputManager::N3DS_BUTTON_Y, InputManager::N3DS_DPAD_UP, InputManager::N3DS_DPAD_DOWN, - InputManager::N3DS_DPAD_LEFT, InputManager::N3DS_DPAD_RIGHT, InputManager::N3DS_TRIGGER_L, - InputManager::N3DS_TRIGGER_R, InputManager::N3DS_BUTTON_START, InputManager::N3DS_BUTTON_SELECT, + InputManager::N3DS_BUTTON_A, InputManager::N3DS_BUTTON_B, + InputManager::N3DS_BUTTON_X, InputManager::N3DS_BUTTON_Y, + InputManager::N3DS_DPAD_UP, InputManager::N3DS_DPAD_DOWN, + InputManager::N3DS_DPAD_LEFT, InputManager::N3DS_DPAD_RIGHT, + InputManager::N3DS_TRIGGER_L, InputManager::N3DS_TRIGGER_R, + InputManager::N3DS_BUTTON_START, InputManager::N3DS_BUTTON_SELECT, InputManager::N3DS_BUTTON_DEBUG, InputManager::N3DS_BUTTON_GPIO14, - InputManager::N3DS_BUTTON_ZL, InputManager::N3DS_BUTTON_ZR, InputManager::N3DS_BUTTON_HOME, + InputManager::N3DS_BUTTON_ZL, InputManager::N3DS_BUTTON_ZR, + InputManager::N3DS_BUTTON_HOME, }; static const std::array default_analogs{{ @@ -116,7 +119,7 @@ void Config::ReadValues() { Settings::values.shaders_accurate_mul = sdl2_config->GetBoolean("Renderer", "shaders_accurate_mul", false); Settings::values.use_asynchronous_gpu_emulation = - sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", true); + sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", true); Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); Settings::values.resolution_factor = static_cast(sdl2_config->GetInteger("Renderer", "resolution_factor", 1)); diff --git a/src/android/app/src/main/jni/game_info.cpp b/src/android/app/src/main/jni/game_info.cpp index af9dc79740..80c0379d62 100644 --- a/src/android/app/src/main/jni/game_info.cpp +++ b/src/android/app/src/main/jni/game_info.cpp @@ -64,7 +64,8 @@ std::u16string GetTitle(std::string physical_name) { memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH)); // Get the title from SMDH in UTF-16 format - std::u16string title{reinterpret_cast(smdh.titles[static_cast(language)].long_title.data())}; + std::u16string title{ + reinterpret_cast(smdh.titles[static_cast(language)].long_title.data())}; return title; } diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 1a6f5df97f..d5eb54aeb3 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -170,15 +170,17 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) { // Audio stretching on Android is only useful with lower framerates, disable it when fullspeed Core::TimingEventType* audio_stretching_event{}; - const s64 audio_stretching_ticks {msToCycles(500)}; - audio_stretching_event = system.CoreTiming().RegisterEvent( - "AudioStretchingEvent", [&](u64, s64 cycles_late) { - if (Settings::values.enable_audio_stretching) { - Core::DSP().EnableStretching(Core::System::GetInstance().GetAndResetPerfStats().emulation_speed < 0.95); - } + const s64 audio_stretching_ticks{msToCycles(500)}; + audio_stretching_event = + system.CoreTiming().RegisterEvent("AudioStretchingEvent", [&](u64, s64 cycles_late) { + if (Settings::values.enable_audio_stretching) { + Core::DSP().EnableStretching( + Core::System::GetInstance().GetAndResetPerfStats().emulation_speed < 0.95); + } - system.CoreTiming().ScheduleEvent(audio_stretching_ticks - cycles_late, audio_stretching_event); - }); + system.CoreTiming().ScheduleEvent(audio_stretching_ticks - cycles_late, + audio_stretching_event); + }); system.CoreTiming().ScheduleEvent(audio_stretching_ticks, audio_stretching_event); // Start running emulation @@ -339,7 +341,8 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadMoveEvent(JNIEnv* env, x = std::clamp(x, -1.f, 1.f); y = std::clamp(-y, -1.f, 1.f); - // Clamp the input to a circle (while touch input is already clamped in the frontend, gamepad is unknown) + // Clamp the input to a circle (while touch input is already clamped in the frontend, gamepad is + // unknown) float r = x * x + y * y; if (r > 1.0f) { r = std::sqrt(r); @@ -358,9 +361,11 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadAxisEvent(JNIEnv* env, } jboolean Java_org_citra_citra_1emu_NativeLibrary_onTouchEvent(JNIEnv* env, - [[maybe_unused]] jclass clazz, jfloat x, - jfloat y, jboolean pressed) { - return static_cast(window->OnTouchEvent(static_cast(x + 0.5), static_cast(y + 0.5), pressed)); + [[maybe_unused]] jclass clazz, + jfloat x, jfloat y, + jboolean pressed) { + return static_cast( + window->OnTouchEvent(static_cast(x + 0.5), static_cast(y + 0.5), pressed)); } void Java_org_citra_citra_1emu_NativeLibrary_onTouchMoved(JNIEnv* env, diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 43da4b60a5..3d919ab106 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -117,26 +117,26 @@ void PrintMessageToLogcat(const Entry& entry) { android_LogPriority android_log_priority; switch (entry.log_level) { - case Level::Trace: - android_log_priority = ANDROID_LOG_VERBOSE; - break; - case Level::Debug: - android_log_priority = ANDROID_LOG_DEBUG; - break; - case Level::Info: - android_log_priority = ANDROID_LOG_INFO; - break; - case Level::Warning: - android_log_priority = ANDROID_LOG_WARN; - break; - case Level::Error: - android_log_priority = ANDROID_LOG_ERROR; - break; - case Level::Critical: - android_log_priority = ANDROID_LOG_FATAL; - break; - case Level::Count: - UNREACHABLE(); + case Level::Trace: + android_log_priority = ANDROID_LOG_VERBOSE; + break; + case Level::Debug: + android_log_priority = ANDROID_LOG_DEBUG; + break; + case Level::Info: + android_log_priority = ANDROID_LOG_INFO; + break; + case Level::Warning: + android_log_priority = ANDROID_LOG_WARN; + break; + case Level::Error: + android_log_priority = ANDROID_LOG_ERROR; + break; + case Level::Critical: + android_log_priority = ANDROID_LOG_FATAL; + break; + case Level::Count: + UNREACHABLE(); } __android_log_print(android_log_priority, "CitraNative", "%s", str.c_str()); #endif diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index bc8369b0da..4171573539 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -2038,8 +2038,8 @@ void RasterizerOpenGL::SyncShadowTextureBias() { } void RasterizerOpenGL::SyncAndUploadLUTsLF() { - constexpr std::size_t max_size = sizeof(GLvec2) * 256 * Pica::LightingRegs::NumLightingSampler + - sizeof(GLvec2) * 128; // fog + constexpr std::size_t max_size = + sizeof(GLvec2) * 256 * Pica::LightingRegs::NumLightingSampler + sizeof(GLvec2) * 128; // fog if (!uniform_block_data.lighting_lut_dirty_any && !uniform_block_data.fog_lut_dirty) { return; diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 68fdb4eea5..6fb4ff12bb 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -234,7 +234,7 @@ static constexpr std::array gl // Allocate an uninitialized texture of appropriate size and format for the surface void AllocateSurfaceTexture(GLuint texture, const FormatTuple& format_tuple, u32 width, - u32 height) { + u32 height) { OpenGLState cur_state = OpenGLState::GetCurState(); // Keep track of previous texture bindings diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 66a6f96dd6..80283ba16f 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -517,7 +517,7 @@ class GLSLGenerator { if (!sanitize_mul) { // When accurate multiplication is OFF, NaN are not really handled. This is a // workaround to cheaply avoid NaN. Fixes graphical issues in Ocarina of Time. - shader.AddLine("if (" + src1 + ".x != 0.0)"); + shader.AddLine("if ({}.x != 0.0)", src1); } SetDest(swizzle, dest_reg, fmt::format("(1.0 / {}.x)", src1), 4, 1); break; @@ -527,7 +527,7 @@ class GLSLGenerator { if (!sanitize_mul) { // When accurate multiplication is OFF, NaN are not really handled. This is a // workaround to cheaply avoid NaN. Fixes graphical issues in Ocarina of Time. - shader.AddLine("if (" + src1 + ".x > 0.0)"); + shader.AddLine("if ({}.x > 0.0)", src1); } SetDest(swizzle, dest_reg, fmt::format("inversesqrt({}.x)", src1), 4, 1); break; diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index ae32ef16e2..3e19219074 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -628,7 +628,9 @@ static void WriteTevStage(std::string& out, const PicaFSConfig& config, unsigned AppendColorModifier(out, config, stage.color_modifier2, stage.color_source2, index_name); out += fmt::format(";\nvec3 color_results_{}_3 = ", index_name); AppendColorModifier(out, config, stage.color_modifier3, stage.color_source3, index_name); - out += fmt::format(";\nvec3 color_results_{}[3] = vec3[3](color_results_{}_1, color_results_{}_2, color_results_{}_3);\n", index_name, index_name, index_name, index_name); + out += fmt::format(";\nvec3 color_results_{}[3] = vec3[3](color_results_{}_1, " + "color_results_{}_2, color_results_{}_3);\n", + index_name, index_name, index_name, index_name); // Round the output of each TEV stage to maintain the PICA's 8 bits of precision out += fmt::format("vec3 color_output_{} = byteround(", index_name); diff --git a/src/video_core/renderer_opengl/texture_downloader_es.cpp b/src/video_core/renderer_opengl/texture_downloader_es.cpp index 70b01e67fb..11663512e4 100644 --- a/src/video_core/renderer_opengl/texture_downloader_es.cpp +++ b/src/video_core/renderer_opengl/texture_downloader_es.cpp @@ -102,9 +102,10 @@ TextureDownloaderES::TextureDownloaderES(bool enable_depth_stencil) { converter.lod_location = glGetUniformLocation(converter.program.handle, "lod"); }; - // xperia64: The depth stencil shader currently uses a GLES extension that is not supported across all devices - // Reportedly broken on Tegra devices and the Nexus 6P, so enabling it can be toggled - if(enable_depth_stencil) { + // xperia64: The depth stencil shader currently uses a GLES extension that is not supported + // across all devices Reportedly broken on Tegra devices and the Nexus 6P, so enabling it can be + // toggled + if (enable_depth_stencil) { init_program(d24s8_r32ui_conversion_shader, ds_to_color_frag); }