sys: Drastically improve highlighting performance

This commit is contained in:
WerWolv
2022-02-04 00:29:47 +01:00
parent ba68f463e5
commit 618eead341
6 changed files with 95 additions and 52 deletions

View File

@@ -14,12 +14,22 @@ namespace hex::prv {
class Provider;
}
namespace hex::plugin::builtin {
using SearchFunction = std::vector<std::pair<u64, u64>> (*)(prv::Provider *&provider, std::string string);
struct HighlightBlock {
struct Highlight {
color_t color;
std::vector<std::string> tooltips;
};
constexpr static size_t Size = 0x2000;
u64 base;
std::array<Highlight, Size> highlight;
};
class ViewHexEditor : public View {
public:
ViewHexEditor();
@@ -54,6 +64,8 @@ namespace hex::plugin::builtin {
hex::EncodingFile m_currEncodingFile;
u8 m_highlightAlpha = 0x80;
std::list<HighlightBlock> m_highlights;
bool m_processingImportExport = false;
bool m_advancedDecodingEnabled = false;