- Removed generational garbage collection from the string pool because it didn't
actually work. - Turned the list of TabCommands into a TArray because I saw lots of console commands in the memory leak report at exit. Then I realized those were actually key bindings, so I changed the Bindings and DoubleBindings arrays into FString arrays. - Fixed: FStringCVar was missing a destructor. - Added TArray::Insert(). - Fixed: TArray::Delete() used memmove(). - Renamed Malloc(), Realloc(), and Calloc() to M_Malloc(), M_Realloc(), and M_Calloc() so that the debug versions can be defined as macros. - Enabled the CRT's memory leak detection in WinMain(). - Moved contents of PO_DeInit() into P_FreeLevelData(). - Removed "PolyBlockMap = NULL;" from P_SetupLevel(), because the P_FreeLevelData() call it makes next does the exact same thing, but also freeing it if needed. - Fixed: Unneeded memcpy in UnpackUserCmd() when ucmd and basis are the same SVN r75 (trunk)
This commit is contained in:
parent
ea3b76815d
commit
c8cdb52863
38 changed files with 264 additions and 242 deletions
|
|
@ -244,9 +244,8 @@ const char *KeyNames[NUM_KEYS] =
|
|||
"mwheelup", "mwheeldown", // the mouse wheel
|
||||
};
|
||||
|
||||
static char *Bindings[NUM_KEYS];
|
||||
|
||||
static char *DoubleBindings[NUM_KEYS];
|
||||
static FString Bindings[NUM_KEYS];
|
||||
static FString DoubleBindings[NUM_KEYS];
|
||||
static unsigned int DClickTime[NUM_KEYS];
|
||||
static byte DClicked[(NUM_KEYS+7)/8];
|
||||
|
||||
|
|
@ -343,7 +342,7 @@ CCMD (bind)
|
|||
}
|
||||
else
|
||||
{
|
||||
ReplaceString (&Bindings[i], argv[2]);
|
||||
Bindings[i] = argv[2];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -438,7 +437,7 @@ CCMD (doublebind)
|
|||
}
|
||||
else
|
||||
{
|
||||
ReplaceString (&DoubleBindings[i], argv[2]);
|
||||
DoubleBindings[i] = argv[2];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -455,7 +454,7 @@ CCMD (doublebind)
|
|||
|
||||
CCMD (rebind)
|
||||
{
|
||||
char **bindings;
|
||||
FString *bindings;
|
||||
|
||||
if (key == 0)
|
||||
{
|
||||
|
|
@ -475,7 +474,7 @@ CCMD (rebind)
|
|||
|
||||
if (argv.argc() > 1)
|
||||
{
|
||||
ReplaceString (&bindings[key], argv[1]);
|
||||
bindings[key] = argv[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -603,7 +602,7 @@ BOOL C_DoKey (event_t *ev)
|
|||
|
||||
void C_ArchiveBindings (FConfigFile *f, bool dodouble, const char *matchcmd)
|
||||
{
|
||||
char **bindings;
|
||||
FString *bindings;
|
||||
const char *name;
|
||||
int i;
|
||||
|
||||
|
|
@ -660,7 +659,7 @@ void C_DoBind (const char *key, const char *bind, bool dodouble)
|
|||
}
|
||||
if (keynum != 0)
|
||||
{
|
||||
ReplaceString ((dodouble ? DoubleBindings : Bindings) + keynum, bind);
|
||||
(dodouble ? DoubleBindings : Bindings)[keynum] = bind;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -734,5 +733,5 @@ void C_ChangeBinding (const char *str, int newone)
|
|||
|
||||
char *C_GetBinding (int key)
|
||||
{
|
||||
return (unsigned int)key < NUM_KEYS ? Bindings[key] : NULL;
|
||||
return (unsigned int)key < NUM_KEYS ? Bindings[key].GetChars() : NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue