mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
CheatsManager: Improve performance of searching & add input validation
The previous implementation of cheat search would reconvert the input string for every single memory value. Now we do it once and construct a comparison lambda which we pass to the search code. In addition, I also added input validation. So, for example, if you've selected Decimal input and you try to compare against "FF", it won't search and will instead let the user know they've entered an invalid value. Similar logic for if you enter "1.2" in a search for bytes. Before, it would just use 0 if it failed to convert the value.
This commit is contained in:
parent
526698d2fc
commit
4ce7079098
2 changed files with 90 additions and 26 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
@ -48,7 +49,7 @@ private:
|
|||
void OnStateChanged(Core::State state);
|
||||
|
||||
size_t GetTypeSize() const;
|
||||
bool MatchesSearch(u32 addr) const;
|
||||
std::function<bool(u32)> CreateMatchFunction();
|
||||
|
||||
void Reset();
|
||||
void NewSearch();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue