Skip to content

Commit

Permalink
- update to work with the latest gzdoom
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed May 15, 2022
1 parent 91e1b61 commit 700173d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion config-converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
#include <fstream>
#include <string>
#include <string.h>
#include <algorithm>
#include <cctype>

#include "config-converter.h"

Expand Down Expand Up @@ -79,6 +81,22 @@ int main(int argc, char** argv)
{ HT_BIND, "mapbind ", "[%s.%s.AutomapBindings]" },
};

string blacklisted_cvars[] =
{
"disablecrashlog",
"gl_control_tear",
"in_mouse",
"joy_dinput",
"joy_ps2raw",
"joy_xinput",
"k_allowfullscreentoggle",
"k_mergekeys",
"m_swapbuttons",
"queryiwad_key",
"vid_gpuswitch",
"vr_enable_quadbuffered"
};

// check for the presence of output files, and error out if they're found
// this is to prevent loss of data
if (fexists("keyconf.txt") || fexists("defcvars.txt") || fexists("defbinds.txt"))
Expand Down Expand Up @@ -151,12 +169,21 @@ int main(int argc, char** argv)
switch (handletype)
{
case HT_CVAR:
for (const string &bl : blacklisted_cvars)
{
std::transform(var.begin(), var.end(), var.begin(),
[](unsigned char c){ return std::tolower(c); });

// ignore blacklisted cvars
if (!bl.compare(var))
break;
}
defcvars << streamcommand << var << " " << quote << value << quote << endl;
break;
case HT_ALIAS:
if (!var.compare("Name"))
aliasname = value;
if (!var.compare("Value"))
if (!var.compare("Command"))
keyconf << streamcommand << aliasname << " " << quote << value << quote << endl;
break;
case HT_VERSION:
Expand Down

0 comments on commit 700173d

Please sign in to comment.