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

@@ -104,7 +104,7 @@ namespace hex {
EVENT_DEF(EventFileLoaded, fs::path);
EVENT_DEF(EventFileUnloaded);
EVENT_DEF(EventDataChanged);
EVENT_DEF(EventPatternChanged, std::vector<pl::PatternData *> &);
EVENT_DEF(EventHighlightingChanged);
EVENT_DEF(EventWindowClosing, GLFWwindow *);
EVENT_DEF(EventRegionSelected, Region);
EVENT_DEF(EventProjectFileStore);

View File

@@ -39,11 +39,15 @@ namespace hex {
id, Highlighting {region, color, tooltip}
});
EventManager::post<EventHighlightingChanged>();
return id;
}
void removeHighlight(u32 id) {
s_highlights.erase(id);
EventManager::post<EventHighlightingChanged>();
}
std::map<u32, Highlighting> &getHighlights() {