!I (1670414, 1670415, 1670416, 1670424, 1670431):
[CRYENGINE.git] / Code / CryPlugins / CryUQS / Core / core / Cvars.cpp
blobcde633afb967ae6a8f83c00eaed5a7c8efd47314
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #include "StdAfx.h"
5 // *INDENT-OFF* - <hard to read code and declarations due to inconsistent indentation>
7 namespace UQS
9 namespace Core
12 float SCvars::timeBudgetInSeconds;
13 int SCvars::debugDraw;
14 int SCvars::debugDrawZTestOn;
15 float SCvars::debugDrawLineThickness;
16 int SCvars::debugDrawAlphaValueOfDiscardedItems;
17 int SCvars::logQueryHistory;
18 float SCvars::timeBudgetExcessThresholdInPercent;
19 int SCvars::printTimeExcessWarningsToConsole;
21 void SCvars::Register()
23 REGISTER_CVAR2("uqs_timeBudgetInSeconds", &timeBudgetInSeconds, 0.0005f, VF_NULL,
24 "The total time-budget in seconds granted to update all running queries in a time-sliced fashion.");
26 REGISTER_CVAR2("uqs_debugDraw", &debugDraw, 0, VF_NULL,
27 "0/1: Draw details of running and finished queries on 2D screen as well as in the 3D world via debug geometry.");
29 REGISTER_CVAR2("uqs_debugDrawZTestOn", &debugDrawZTestOn, 1, VF_NULL,
30 "0/1: Disable/enable z-tests for 3D debug geometry.");
32 REGISTER_CVAR2("uqs_debugDrawLineThickness", &debugDrawLineThickness, 1.0f, VF_NULL,
33 "Thickness of all 3d lines that are used for debug drawing.");
35 REGISTER_CVAR2("uqs_debugDrawAlphaValueOfDiscardedItems", &debugDrawAlphaValueOfDiscardedItems, 127, VF_NULL,
36 "Alpha value for drawing items that didn't make it into the final result set of a query. Clamped to [0..255] internally.");
38 REGISTER_CVAR2("uqs_logQueryHistory", &logQueryHistory, 0, VF_NULL,
39 "0/1: Enable logging of past queries to draw them at a later time via 'uqs_debugDraw' set to 1.\n"
40 "Pick the one to draw via PGDOWN/PGUP.");
42 REGISTER_CVAR2("uqs_timeBudgetExcessThresholdInPercent", &timeBudgetExcessThresholdInPercent, 20.0f, VF_NULL,
43 "Percentage of the granted time of a query that we allow to exceed before before taking counter-measures and issuing warnings.");
45 REGISTER_CVAR2("uqs_printTimeExcessWarningsToConsole", &printTimeExcessWarningsToConsole, 1, VF_NULL,
46 "0/1: Print warnings due to time excess of queries also to the console, not just to the query history.");
49 void SCvars::Unregister()
51 gEnv->pConsole->UnregisterVariable("uqs_timeBudgetInSeconds");
52 gEnv->pConsole->UnregisterVariable("uqs_debugDraw");
53 gEnv->pConsole->UnregisterVariable("uqs_debugDrawZTestOn");
54 gEnv->pConsole->UnregisterVariable("uqs_debugDrawLineThickness");
55 gEnv->pConsole->UnregisterVariable("uqs_debugDrawAlphaValueOfDiscardedItems");
56 gEnv->pConsole->UnregisterVariable("uqs_logQueryHistory");
57 gEnv->pConsole->UnregisterVariable("uqs_timeBudgetExcessThresholdInPercent");
58 gEnv->pConsole->UnregisterVariable("uqs_printTimeExcessWarningsToConsole");