android: Run clang-format

This commit is contained in:
FearlessTobi 2020-05-02 21:28:12 +02:00 committed by bunnei
parent d18cf87964
commit f069d740ac
7 changed files with 25 additions and 28 deletions

View File

@ -106,7 +106,7 @@ void Config::ReadValues() {
// Premium
Settings::values.texture_filter_name =
sdl2_config->GetString("Premium", "texture_filter_name", "none");
sdl2_config->GetString("Premium", "texture_filter_name", "none");
// Renderer
Settings::values.use_gles = sdl2_config->GetBoolean("Renderer", "use_gles", true);

View File

@ -3,9 +3,9 @@
// Refer to the license.txt file included.
#include <cstring>
#include <map>
#include <memory>
#include <vector>
#include <map>
#include "common/string_util.h"
#include "core/hle/service/am/am.h"
@ -90,7 +90,7 @@ char16_t* GetPublisher(std::string physical_name) {
// Get the Publisher's name from SMDH in UTF-16 format
char16_t* publisher;
publisher =
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].publisher.data());
reinterpret_cast<char16_t*>(smdh.titles[static_cast<int>(language)].publisher.data());
LOG_INFO(Frontend, "Publisher: {}", Common::UTF16ToUTF8(publisher));
@ -111,13 +111,10 @@ std::string GetRegions(std::string physical_name) {
using GameRegion = Loader::SMDH::GameRegion;
static const std::map<GameRegion, const char*> regions_map = {
{GameRegion::Japan, "Japan"},
{GameRegion::NorthAmerica, "North America"},
{GameRegion::Europe, "Europe"},
{GameRegion::Australia, "Australia"},
{GameRegion::China, "China"},
{GameRegion::Korea, "Korea"},
{GameRegion::Taiwan, "Taiwan"}};
{GameRegion::Japan, "Japan"}, {GameRegion::NorthAmerica, "North America"},
{GameRegion::Europe, "Europe"}, {GameRegion::Australia, "Australia"},
{GameRegion::China, "China"}, {GameRegion::Korea, "Korea"},
{GameRegion::Taiwan, "Taiwan"}};
std::vector<GameRegion> regions = smdh.GetRegions();
if (regions.empty()) {
@ -125,9 +122,9 @@ std::string GetRegions(std::string physical_name) {
}
const bool region_free =
std::all_of(regions_map.begin(), regions_map.end(), [&regions](const auto& it) {
return std::find(regions.begin(), regions.end(), it.first) != regions.end();
});
std::all_of(regions_map.begin(), regions_map.end(), [&regions](const auto& it) {
return std::find(regions.begin(), regions.end(), it.first) != regions.end();
});
if (region_free) {
return "Region free";

View File

@ -153,7 +153,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) {
window->StartPresenting();
SCOPE_EXIT({TryShutdown();});
SCOPE_EXIT({ TryShutdown(); });
while (is_running) {
if (!pause_emulation) {
@ -519,7 +519,8 @@ void Java_org_citra_citra_1emu_NativeLibrary_ReloadCameraDevices(JNIEnv* env, jc
}
}
jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass clazz, jbyteArray bytes) {
jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv* env, jclass clazz,
jbyteArray bytes) {
Core::System& system{Core::System::GetInstance()};
Service::SM::ServiceManager& sm = system.ServiceManager();
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
@ -528,15 +529,16 @@ jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass
}
Service::NFC::AmiiboData amiibo_data{};
env->GetByteArrayRegion(bytes, 0, sizeof(Service::NFC::AmiiboData), reinterpret_cast<jbyte*>(&amiibo_data));
env->GetByteArrayRegion(bytes, 0, sizeof(Service::NFC::AmiiboData),
reinterpret_cast<jbyte*>(&amiibo_data));
nfc->LoadAmiibo(amiibo_data);
return static_cast<jboolean>(true);
}
void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv *env, jclass clazz) {
Core::System &system{Core::System::GetInstance()};
Service::SM::ServiceManager &sm = system.ServiceManager();
void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv* env, jclass clazz) {
Core::System& system{Core::System::GetInstance()};
Service::SM::ServiceManager& sm = system.ServiceManager();
auto nfc = sm.GetService<Service::NFC::Module::Interface>("nfc:u");
if (nfc == nullptr) {
return;

View File

@ -137,9 +137,10 @@ Java_org_citra_citra_1emu_NativeLibrary_GetTextureFilterNames(JNIEnv* env, jclas
JNIEXPORT void JNICALL Java_org_citra_citra_1emu_NativeLibrary_ReloadCameraDevices(JNIEnv* env,
jclass clazz);
JNIEXPORT jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv *env, jclass clazz, jbyteArray bytes);
JNIEXPORT jboolean Java_org_citra_citra_1emu_NativeLibrary_LoadAmiibo(JNIEnv* env, jclass clazz,
jbyteArray bytes);
JNIEXPORT void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv *env, jclass clazz);
JNIEXPORT void Java_org_citra_citra_1emu_NativeLibrary_RemoveAmiibo(JNIEnv* env, jclass clazz);
#ifdef __cplusplus
}

View File

@ -67,8 +67,7 @@ class NDKMotion final : public Input::MotionDevice {
LOG_CRITICAL(Input, "Could not retrieve sensor manager");
return;
}
event_queue = ASensorManager_createEventQueue(
sensor_manager, looper, 0, nullptr, nullptr);
event_queue = ASensorManager_createEventQueue(sensor_manager, looper, 0, nullptr, nullptr);
if (!event_queue) {
LOG_ERROR(Input, "Could not create sensor event queue");
return;
@ -101,7 +100,7 @@ class NDKMotion final : public Input::MotionDevice {
while (ASensorEventQueue_getEvents(event_queue, &event, 1) > 0) {
if (event.type == ASENSOR_TYPE_ACCELEROMETER) {
new_accel.emplace(event.vector.x, event.vector.y, event.vector.z);
} else if (event.type == ASENSOR_TYPE_GYROSCOPE){
} else if (event.type == ASENSOR_TYPE_GYROSCOPE) {
new_rot.emplace(event.vector.x, event.vector.y, event.vector.z);
}
// occasionally the queue has ASENSOR_TYPE_ADDITIONAL_INFO events

View File

@ -9,6 +9,4 @@
#include <string_view>
#include "common/logging/log.h"
namespace Log {
} // namespace Log
namespace Log {} // namespace Log

View File

@ -72,7 +72,7 @@ void TextureDownloaderES::Test() {
// every time the error between the real and expected value changes, log it
// some error is expected in D24 due to floating point precision
LOG_WARNING(Render_OpenGL, "difference changed at {:#X}: {:#X} -> {:#X}", idx,
original_data[idx], new_data[idx]);
original_data[idx], new_data[idx]);
}
};
LOG_INFO(Render_OpenGL, "GL_DEPTH24_STENCIL8 download test starting");