From b39057049e682a5c3940200276944b6c0a15a5c3 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Sun, 7 Aug 2016 19:31:09 +0300 Subject: [PATCH] (profiler) Proper color names and 6 new colors --- include/profiler/profiler.h | 20 +++++++++++++------- sample/main.cpp | 6 +++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/profiler/profiler.h b/include/profiler/profiler.h index faf447f..76b9669 100644 --- a/include/profiler/profiler.h +++ b/include/profiler/profiler.h @@ -51,7 +51,7 @@ Block will be automatically completed by destructor \ingroup profiler */ -#define PROFILER_BEGIN_BLOCK(name) profiler::Block TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)(name,0,profiler::BLOCK_TYPE_BLOCK);\ +#define PROFILER_BEGIN_BLOCK(name) profiler::Block TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)(name,profiler::colors::Clay,profiler::BLOCK_TYPE_BLOCK);\ profiler::beginBlock(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); /** Macro of beginning of block with custom name and custom identification @@ -199,12 +199,12 @@ namespace profiler const color_t Magenta = (Red | Blue); const color_t Cyan = (Green | Blue); const color_t Yellow = (Red | Green); - const color_t Lightred = 0x60; - const color_t Lightgreen = 0x0C; - const color_t Lightblue = 0x01; - const color_t Lightmagenta = (Lightred | Lightblue); - const color_t Lightcyan = (Lightgreen | Lightblue); - const color_t Lightyellow = (Lightred | Lightgreen); + const color_t Darkred = 0x60; + const color_t Darkgreen = 0x0C; + const color_t Darkblue = 0x01; + const color_t Darkmagenta = (Darkred | Darkblue); + const color_t Darkcyan = (Darkgreen | Darkblue); + const color_t Darkyellow = (Darkred | Darkgreen); const color_t Navy = 0x02; const color_t Teal = 0x12; const color_t Maroon = 0x80; @@ -212,6 +212,12 @@ namespace profiler const color_t Olive = 0x90; const color_t Grey = 0x92; const color_t Silver = 0xDB; + const color_t Orange = 0xF4; + const color_t Coral = 0xF6; + const color_t Brick = 0xED; + const color_t Clay = 0xD6; + const color_t Skin = 0xFA; + const color_t Palegold = 0xFE; inline int get_red(color_t color){ return (color >> 5) * 0x20; diff --git a/sample/main.cpp b/sample/main.cpp index 5ce4c2c..9238a30 100644 --- a/sample/main.cpp +++ b/sample/main.cpp @@ -18,7 +18,7 @@ int MODELLING_STEPS = 1000; int RESOURCE_LOADING_COUNT = 100; void loadingResources(){ - PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Lightcyan); + PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Darkcyan); std::this_thread::sleep_for(std::chrono::milliseconds(50)); } @@ -64,7 +64,7 @@ void calcBrain(){ } void calculateBehavior(){ - PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Lightblue); + PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Darkblue); calcPhys(); calcBrain(); } @@ -76,7 +76,7 @@ void modellingStep(){ } void prepareRender(){ - PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Lightred); + PROFILER_BEGIN_FUNCTION_BLOCK_GROUPED(profiler::colors::Darkred); volatile int i = 0; for (; i < 200000; ++i); //std::this_thread::sleep_for(std::chrono::milliseconds(8));