本文整理汇总了C++中DArgs::FlushArgs方法的典型用法代码示例。如果您正苦于以下问题:C++ DArgs::FlushArgs方法的具体用法?C++ DArgs::FlushArgs怎么用?C++ DArgs::FlushArgs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DArgs
的用法示例。
在下文中一共展示了DArgs::FlushArgs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: D_DoDefDehackedPatch
//
// D_DoDefDehackedPatch
//
// [Russell] - Change the meaning, this will load multiple patch files if
// specified
void D_DoDefDehackedPatch (const std::vector<std::string> patch_files = std::vector<std::string>())
{
DArgs files;
BOOL noDef = false;
QWORD i;
if (!patch_files.empty())
{
std::string f;
std::string ext;
// we want the extension of the file
for (i = 0; i < patch_files.size(); i++)
{
if (M_ExtractFileExtension(patch_files[i], ext))
{
f = BaseFileSearch (patch_files[i], ext);
if (f.length())
{
if (DoDehPatch (f.c_str(), false))
{
std::string Filename;
M_ExtractFileName(f, Filename);
patchfiles.push_back(Filename);
}
noDef = true;
}
}
}
}
else // [Russell] - Only load if patch_files is empty
{
// try .deh files on command line
files = Args.GatherFiles ("-deh", ".deh", false);
if (files.NumArgs())
{
for (i = 0; i < files.NumArgs(); i++)
{
std::string f = BaseFileSearch (files.GetArg (i), ".DEH");
if (f.length())
{
if (DoDehPatch (f.c_str(), false))
{
std::string Filename;
M_ExtractFileName(f, Filename);
patchfiles.push_back(Filename);
}
}
}
noDef = true;
}
// remove the old arguments
files.FlushArgs();
// try .bex files on command line
files = Args.GatherFiles ("-bex", ".bex", false);
if (files.NumArgs())
{
for (i = 0; i < files.NumArgs(); i++)
{
std::string f = BaseFileSearch (files.GetArg (i), ".BEX");
if (f.length())
{
if (DoDehPatch (f.c_str(), false))
{
std::string Filename;
M_ExtractFileName(f, Filename);
patchfiles.push_back(Filename);
}
}
}
noDef = true;
}
}
// try default patches
if (!noDef)
DoDehPatch (NULL, true); // See if there's a patch in a PWAD
}
示例2: D_DoDefDehackedPatch
//
// D_DoDefDehackedPatch
//
// [Russell] - Change the meaning, this will load multiple patch files if
// specified
void D_DoDefDehackedPatch (const std::vector<std::string> patch_files = std::vector<std::string>())
{
DArgs files;
BOOL noDef = false;
BOOL chexLoaded = false;
QWORD i;
if (!patch_files.empty())
{
std::string f;
std::string ext;
// we want the extension of the file
for (i = 0; i < patch_files.size(); i++)
{
if (M_ExtractFileExtension(patch_files[i], ext))
{
f = BaseFileSearch (patch_files[i], ext);
if (f.length())
{
DoDehPatch (f.c_str(), false);
noDef = true;
}
}
}
}
else // [Russell] - Only load if patch_files is empty
{
// try .deh files on command line
files = Args.GatherFiles ("-deh", ".deh", false);
if (files.NumArgs())
{
for (i = 0; i < files.NumArgs(); i++)
{
std::string f = BaseFileSearch (files.GetArg (i), ".DEH");
if (f.length()) {
DoDehPatch (f.c_str(), false);
if (!strncmp(files.GetArg (i),"chex.deh",8))
chexLoaded = true;
}
}
noDef = true;
}
if (gamemode == retail_chex && !multiplayer && !chexLoaded)
Printf(PRINT_HIGH,"Warning: chex.deh not loaded, experience may differ from the original!\n");
// remove the old arguments
files.FlushArgs();
// try .bex files on command line
files = Args.GatherFiles ("-bex", ".bex", false);
if (files.NumArgs())
{
for (i = 0; i < files.NumArgs(); i++)
{
std::string f = BaseFileSearch (files.GetArg (i), ".BEX");
if (f.length())
DoDehPatch (f.c_str(), false);
}
noDef = true;
}
}
// try default patches
if (!noDef)
DoDehPatch (NULL, true); // See if there's a patch in a PWAD
}