From b67f083506803c3cf075e8872cacb329b063e8b3 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 25 Sep 2019 03:40:44 +0300 Subject: Optimize color markdown stuff properly by creating lists and preloading things --- include/courtroom.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/courtroom.h b/include/courtroom.h index 72dec046..d6bf4512 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -354,8 +354,29 @@ private: int realization_state = 0; int screenshake_state = 0; int text_color = 0; - static const int max_colors = 12; //How many unique user colors are possible - QVector color_row_to_number; //Current color list indexes to real color references + + //How many unique user colors are possible + static const int max_colors = 12; + + //Text Color-related optimization: + //Current color list indexes to real color references + QVector color_row_to_number; + + //List of associated RGB colors for this color index + QVector color_rgb_list; + + //List of markdown start characters, their index is tied to the color index + QStringList color_markdown_start_list; + + //List of markdown end characters, their index is tied to the color index + QStringList color_markdown_end_list; + + //Whether or not we're supposed to remove this char during parsing + QVector color_markdown_remove_list; + + //Whether or not this color allows us to play the talking animation + QVector color_markdown_talking_list; + //Text Color-related optimization END bool is_presenting_evidence = false; -- cgit