Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangwei committed Jun 21, 2023
1 parent c570445 commit c9ba2ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Expand Up @@ -214,6 +214,7 @@ public static void saveImageToFile(String path, int[] pixels, int width, int hei
} catch (Exception e) {
Log.e("citra", "saveImageToFile error: " + path, e);
}
bitmap.recycle();
}
}

Expand Down
Expand Up @@ -103,6 +103,7 @@ protected Integer doInBackground(Bitmap... args) {
error = TranslateHelper.RequestYeekit();
}
}
image.recycle();
return error;
}

Expand Down Expand Up @@ -461,6 +462,7 @@ public void requestScreenshot() {
BaiduOCRTask task = new BaiduOCRTask(this);
TranslateHelper.BaiduOCRLanguage = TranslateHelper.BaiduOCRLanguageJPN;
task.execute(image);
screenshot.recycle();
});
});
}
Expand Down
9 changes: 4 additions & 5 deletions src/android/jni/input_manager.cpp
Expand Up @@ -78,15 +78,14 @@ class ButtonList {
std::unique_ptr<Input::ButtonDevice> CreateButton(int button_id, float threshold,
bool trigger_if_greater) {
std::lock_guard<std::mutex> guard(mutex);
std::unique_ptr<AnalogButton> button =
std::make_unique<AnalogButton>(this, button_id, threshold, trigger_if_greater);
auto button = std::make_unique<AnalogButton>(this, button_id, threshold, trigger_if_greater);
buttons.push_back(button.get());
return std::move(button);
}

void DestroyButton(AnalogButton* target) {
std::lock_guard<std::mutex> guard(mutex);
buttons.erase(std::remove(buttons.begin(), buttons.end(), target), buttons.end());
std::erase(buttons, target);
}

bool ChangeButtonValue(int button_id, float value) {
Expand Down Expand Up @@ -156,14 +155,14 @@ class AnalogList {
public:
std::unique_ptr<Input::AnalogDevice> CreateButton(int button_id) {
std::lock_guard<std::mutex> guard(mutex);
std::unique_ptr<Joystick> analog = std::make_unique<Joystick>(this, button_id);
auto analog = std::make_unique<Joystick>(this, button_id);
buttons.push_back(analog.get());
return std::move(analog);
}

void DestroyButton(Joystick* target) {
std::lock_guard<std::mutex> guard(mutex);
buttons.erase(std::remove(buttons.begin(), buttons.end(), target), buttons.end());
std::erase(buttons, target);
}

bool ChangeJoystickStatus(int button_id, float x, float y) {
Expand Down
2 changes: 2 additions & 0 deletions src/android/jni/main_android.cpp
Expand Up @@ -114,6 +114,7 @@ void BootGame(const std::string& path) {
"Error while loading ROM! An unknown error occured.");
break;
}
s_render_window.reset();
return;
}

Expand Down Expand Up @@ -627,6 +628,7 @@ JNIEXPORT void JNICALL Java_org_citra_emu_NativeLibrary_setRunningSettings(JNIEn

// Accurate Mul
Settings::values.shaders_accurate_mul = static_cast<Settings::AccurateMul>(settings[i++]);
Config::Set(Config::SHADERS_ACCURATE_MUL, Settings::values.shaders_accurate_mul);

// Custom Layout
Settings::values.custom_layout = settings[i++] > 0;
Expand Down

0 comments on commit c9ba2ed

Please sign in to comment.