Run clang-format
This commit is contained in:
parent
7dfdf2e08a
commit
8c0d85e081
@ -51,12 +51,15 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const std::array<int, Settings::NativeButton::NumButtons> default_buttons = {
|
static const std::array<int, Settings::NativeButton::NumButtons> default_buttons = {
|
||||||
InputManager::N3DS_BUTTON_A, InputManager::N3DS_BUTTON_B, InputManager::N3DS_BUTTON_X,
|
InputManager::N3DS_BUTTON_A, InputManager::N3DS_BUTTON_B,
|
||||||
InputManager::N3DS_BUTTON_Y, InputManager::N3DS_DPAD_UP, InputManager::N3DS_DPAD_DOWN,
|
InputManager::N3DS_BUTTON_X, InputManager::N3DS_BUTTON_Y,
|
||||||
InputManager::N3DS_DPAD_LEFT, InputManager::N3DS_DPAD_RIGHT, InputManager::N3DS_TRIGGER_L,
|
InputManager::N3DS_DPAD_UP, InputManager::N3DS_DPAD_DOWN,
|
||||||
InputManager::N3DS_TRIGGER_R, InputManager::N3DS_BUTTON_START, InputManager::N3DS_BUTTON_SELECT,
|
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_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<int, Settings::NativeAnalog::NumAnalogs> default_analogs{{
|
static const std::array<int, Settings::NativeAnalog::NumAnalogs> default_analogs{{
|
||||||
|
@ -64,7 +64,8 @@ std::u16string GetTitle(std::string physical_name) {
|
|||||||
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
|
||||||
|
|
||||||
// Get the title from SMDH in UTF-16 format
|
// Get the title from SMDH in UTF-16 format
|
||||||
std::u16string title{reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].long_title.data())};
|
std::u16string title{
|
||||||
|
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].long_title.data())};
|
||||||
|
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
@ -171,13 +171,15 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
|
|||||||
// Audio stretching on Android is only useful with lower framerates, disable it when fullspeed
|
// Audio stretching on Android is only useful with lower framerates, disable it when fullspeed
|
||||||
Core::TimingEventType* audio_stretching_event{};
|
Core::TimingEventType* audio_stretching_event{};
|
||||||
const s64 audio_stretching_ticks{msToCycles(500)};
|
const s64 audio_stretching_ticks{msToCycles(500)};
|
||||||
audio_stretching_event = system.CoreTiming().RegisterEvent(
|
audio_stretching_event =
|
||||||
"AudioStretchingEvent", [&](u64, s64 cycles_late) {
|
system.CoreTiming().RegisterEvent("AudioStretchingEvent", [&](u64, s64 cycles_late) {
|
||||||
if (Settings::values.enable_audio_stretching) {
|
if (Settings::values.enable_audio_stretching) {
|
||||||
Core::DSP().EnableStretching(Core::System::GetInstance().GetAndResetPerfStats().emulation_speed < 0.95);
|
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);
|
system.CoreTiming().ScheduleEvent(audio_stretching_ticks, audio_stretching_event);
|
||||||
|
|
||||||
@ -339,7 +341,8 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_onGamePadMoveEvent(JNIEnv* env,
|
|||||||
x = std::clamp(x, -1.f, 1.f);
|
x = std::clamp(x, -1.f, 1.f);
|
||||||
y = std::clamp(-y, -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;
|
float r = x * x + y * y;
|
||||||
if (r > 1.0f) {
|
if (r > 1.0f) {
|
||||||
r = std::sqrt(r);
|
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,
|
jboolean Java_org_citra_citra_1emu_NativeLibrary_onTouchEvent(JNIEnv* env,
|
||||||
[[maybe_unused]] jclass clazz, jfloat x,
|
[[maybe_unused]] jclass clazz,
|
||||||
jfloat y, jboolean pressed) {
|
jfloat x, jfloat y,
|
||||||
return static_cast<jboolean>(window->OnTouchEvent(static_cast<int>(x + 0.5), static_cast<int>(y + 0.5), pressed));
|
jboolean pressed) {
|
||||||
|
return static_cast<jboolean>(
|
||||||
|
window->OnTouchEvent(static_cast<int>(x + 0.5), static_cast<int>(y + 0.5), pressed));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Java_org_citra_citra_1emu_NativeLibrary_onTouchMoved(JNIEnv* env,
|
void Java_org_citra_citra_1emu_NativeLibrary_onTouchMoved(JNIEnv* env,
|
||||||
|
@ -2038,8 +2038,8 @@ void RasterizerOpenGL::SyncShadowTextureBias() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncAndUploadLUTsLF() {
|
void RasterizerOpenGL::SyncAndUploadLUTsLF() {
|
||||||
constexpr std::size_t max_size = sizeof(GLvec2) * 256 * Pica::LightingRegs::NumLightingSampler +
|
constexpr std::size_t max_size =
|
||||||
sizeof(GLvec2) * 128; // fog
|
sizeof(GLvec2) * 256 * Pica::LightingRegs::NumLightingSampler + sizeof(GLvec2) * 128; // fog
|
||||||
|
|
||||||
if (!uniform_block_data.lighting_lut_dirty_any && !uniform_block_data.fog_lut_dirty) {
|
if (!uniform_block_data.lighting_lut_dirty_any && !uniform_block_data.fog_lut_dirty) {
|
||||||
return;
|
return;
|
||||||
|
@ -517,7 +517,7 @@ private:
|
|||||||
if (!sanitize_mul) {
|
if (!sanitize_mul) {
|
||||||
// When accurate multiplication is OFF, NaN are not really handled. This is a
|
// 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.
|
// 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);
|
SetDest(swizzle, dest_reg, fmt::format("(1.0 / {}.x)", src1), 4, 1);
|
||||||
break;
|
break;
|
||||||
@ -527,7 +527,7 @@ private:
|
|||||||
if (!sanitize_mul) {
|
if (!sanitize_mul) {
|
||||||
// When accurate multiplication is OFF, NaN are not really handled. This is a
|
// 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.
|
// 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);
|
SetDest(swizzle, dest_reg, fmt::format("inversesqrt({}.x)", src1), 4, 1);
|
||||||
break;
|
break;
|
||||||
|
@ -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);
|
AppendColorModifier(out, config, stage.color_modifier2, stage.color_source2, index_name);
|
||||||
out += fmt::format(";\nvec3 color_results_{}_3 = ", index_name);
|
out += fmt::format(";\nvec3 color_results_{}_3 = ", index_name);
|
||||||
AppendColorModifier(out, config, stage.color_modifier3, stage.color_source3, 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
|
// 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);
|
out += fmt::format("vec3 color_output_{} = byteround(", index_name);
|
||||||
|
@ -102,8 +102,9 @@ TextureDownloaderES::TextureDownloaderES(bool enable_depth_stencil) {
|
|||||||
converter.lod_location = glGetUniformLocation(converter.program.handle, "lod");
|
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
|
// xperia64: The depth stencil shader currently uses a GLES extension that is not supported
|
||||||
// Reportedly broken on Tegra devices and the Nexus 6P, so enabling it can be toggled
|
// across all devices Reportedly broken on Tegra devices and the Nexus 6P, so enabling it can be
|
||||||
|
// toggled
|
||||||
if (enable_depth_stencil) {
|
if (enable_depth_stencil) {
|
||||||
init_program(d24s8_r32ui_conversion_shader, ds_to_color_frag);
|
init_program(d24s8_r32ui_conversion_shader, ds_to_color_frag);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user