-
Notifications
You must be signed in to change notification settings - Fork 1
Development Notes
- UI Module has 2 global references to
displayContextDef_t
.
NOTE: Try to consolidate these:
- ::uiInfo.uiDC
- ::DC
- UI_Init() calls
UI_InitMemory()
multiple times.
NOTE: UI_InitMemory() is called 2x in the Init routine, the 2nd call is unnecessary.
ui_main.cpp::UI_Init(bool)
...
UI_InitMemory();
BG_InitMemory();
... display context initialization ...
String_Init() // FIXME
-> UI_InitMemory()
- Cleanup
keywordHash_t
No need for hand-rolled hash tables with C++
These functions are duplicating the data from ParseKeywords into the Hash table, this is unnecessary. These tables are also very sparse, there far larger than is necessary.
void ui_shared.cpp::Item_SetupKeywordHash(void)
itemParseKeywordHash
itemParseKeywords
-
itemParseKeywordHash
has512
slots. -
itemParseKeywords
only has68
elements. -
414
slots are unused.
void Menu_SetupKeywordHash(void)
menuParseKeywordHash
menuParseKeywords
-
menuParseKeywordHash
has512
slots. -
menuParseKeywords
has29
elements. -
482
slots are unused.
print sizeof(menuParseKeywordHash)/sizeof(menuParseKeywordHash[0])
(unsigned long) $4 = 512
print sizeof(menuParseKeywordHash)
(unsigned long) $5 = 4096
print sizeof(menuParseKeywordHash[0])
(unsigned long) $6 = 8
print sizeof(menuParseKeywords)
(unsigned long) $7 = 960
- Unnecessary Check for
DC && DC->getBindingBuf
void ui_shared.cpp:String_Init(void)
...
if (DC && DC->getBindingBuf)
Controls_GetConfig();
- Controls_GetKeyAssignment() Loops 13,312 times
This function implments a very slow search algorithm. The purpose of this function is to map the Users configured bindings into a UI g_bindings table which is used in UI menu's.
- for each
command in g_bindings[52].command
- for each
keynum in (0..256)
- if
keys[keynum].binding == command
- set
g_bindings[i].twokeys = keys[keynum].tokeys
-
A better search can be implemented
-
Keys and Command Bindings could be broken out into it's own namespace/module/utility.
-
More global hash tables
tr_shader.cpp:
#define FILE_HASH_SIZE 1024
static shader_t* hashTable[FILE_HASH_SIZE];
1024
-
AssetCache() Loads the actual UI assets.
-
AVI recording, increase the default aviFrameRate
print cl_aviFrameRate->integer (int) $22 = 25