Merge branch 'pre_clang_format_fixes' into 'master'

Fixes before applying clang-format

See merge request OpenMW/openmw!2397
make_linux_ci_do_zoomies
psi29a 2 years ago
commit 79c70b2e84

@ -31,35 +31,37 @@ struct Arguments
bool parseOptions (int argc, char** argv, Arguments &info)
{
bpo::options_description desc("Inspect and extract files from Bethesda BSA archives\n\n"
"Usages:\n"
" bsatool list [-l] archivefile\n"
" List the files presents in the input archive.\n\n"
" bsatool extract [-f] archivefile [file_to_extract] [output_directory]\n"
" Extract a file from the input archive.\n\n"
" bsatool extractall archivefile [output_directory]\n"
" Extract all files from the input archive.\n\n"
" bsatool add [-a] archivefile file_to_add\n"
" Add a file to the input archive.\n\n"
" bsatool create [-c] archivefile\n"
" Create an archive.\n\n"
"Allowed options");
desc.add_options()
("help,h", "print help message.")
("version,v", "print version information and quit.")
("long,l", "Include extra information in archive listing.")
("full-path,f", "Create directory hierarchy on file extraction "
"(always true for extractall).")
;
bpo::options_description desc(R"(Inspect and extract files from Bethesda BSA archives
Usages:
bsatool list [-l] archivefile\n
List the files presents in the input archive.
bsatool extract [-f] archivefile [file_to_extract] [output_directory]
Extract a file from the input archive.
bsatool extractall archivefile [output_directory]
Extract all files from the input archive.
bsatool add [-a] archivefile file_to_add
Add a file to the input archive.
bsatool create [-c] archivefile
Create an archive.
Allowed options)");
auto addOption = desc.add_options();
addOption("help,h", "print help message.");
addOption("version,v", "print version information and quit.");
addOption("long,l", "Include extra information in archive listing.");
addOption("full-path,f", "Create directory hierarchy on file extraction (always true for extractall).");
// input-file is hidden and used as a positional argument
bpo::options_description hidden("Hidden Options");
hidden.add_options()
( "mode,m", bpo::value<std::string>(), "bsatool mode")
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
;
auto addHiddenOption = hidden.add_options();
addHiddenOption("mode,m", bpo::value<std::string>(), "bsatool mode");
addHiddenOption("input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
bpo::positional_options_description p;
p.add("mode", 1).add("input-file", 3);

@ -39,41 +39,39 @@ namespace
using Fallback::FallbackMap;
bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");
result.add_options()
("help", "print help message")
addOption("version", "print version information and quit");
("version", "print version information and quit")
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)");
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)")
addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
"set local data directory (highest priority)");
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
"set local data directory (highest priority)")
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory")
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)");
("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)")
("encoding", bpo::value<std::string>()->
addOption("encoding", bpo::value<std::string>()->
default_value("win1252"),
"Character encoding used in OpenMW game messages:\n"
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default")
"\n\twin1252 - Western European (Latin) alphabet, used by default");
("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values")
addOption("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values");
;
Files::ConfigurationManager::addCommonOptions(result);
return result;

@ -48,29 +48,35 @@ struct ESMData
bool parseOptions (int argc, char** argv, Arguments &info)
{
bpo::options_description desc("Inspect and extract from Morrowind ES files (ESM, ESP, ESS)\nSyntax: esmtool [options] mode infile [outfile]\nAllowed modes:\n dump\t Dumps all readable data from the input file.\n clone\t Clones the input file to the output file.\n comp\t Compares the given files.\n\nAllowed options");
desc.add_options()
("help,h", "print help message.")
("version,v", "print version information and quit.")
("raw,r", bpo::value<std::string>(),
bpo::options_description desc(R"(Inspect and extract from Morrowind ES files (ESM, ESP, ESS)
Syntax: esmtool [options] mode infile [outfile]
Allowed modes:
dump Dumps all readable data from the input file.
clone Clones the input file to the output file.
comp Compares the given files.
Allowed options)");
auto addOption = desc.add_options();
addOption("help,h", "print help message.");
addOption("version,v", "print version information and quit.");
addOption("raw,r", bpo::value<std::string>(),
"Show an unformatted list of all records and subrecords of given format:\n"
"\n\tTES3"
"\n\tTES4")
"\n\tTES4");
// The intention is that this option would interact better
// with other modes including clone, dump, and raw.
("type,t", bpo::value< std::vector<std::string> >(),
addOption("type,t", bpo::value< std::vector<std::string> >(),
"Show only records of this type (four character record code). May "
"be specified multiple times. Only affects dump mode.")
("name,n", bpo::value<std::string>(),
"Show only the record with this name. Only affects dump mode.")
("plain,p", "Print contents of dialogs, books and scripts. "
"be specified multiple times. Only affects dump mode.");
addOption("name,n", bpo::value<std::string>(),
"Show only the record with this name. Only affects dump mode.");
addOption("plain,p", "Print contents of dialogs, books and scripts. "
"(skipped by default)"
"Only affects dump mode.")
("quiet,q", "Suppress all record information. Useful for speed tests.")
("loadcells,C", "Browse through contents of all cells.")
"Only affects dump mode.");
addOption("quiet,q", "Suppress all record information. Useful for speed tests.");
addOption("loadcells,C", "Browse through contents of all cells.");
( "encoding,e", bpo::value<std::string>(&(info.encoding))->
addOption( "encoding,e", bpo::value<std::string>(&(info.encoding))->
default_value("win1252"),
"Character encoding used in ESMTool:\n"
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
@ -82,11 +88,9 @@ bool parseOptions (int argc, char** argv, Arguments &info)
// input-file is hidden and used as a positional argument
bpo::options_description hidden("Hidden Options");
hidden.add_options()
( "mode,m", bpo::value<std::string>(), "esmtool mode")
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
;
auto addHiddenOption = hidden.add_options();
addHiddenOption( "mode,m", bpo::value<std::string>(), "esmtool mode");
addHiddenOption( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
bpo::positional_options_description p;
p.add("mode", 1).add("input-file", 2);

@ -46,7 +46,7 @@ std::string bodyPartLabel(int idx)
"Right Shoulder",
"Left Shoulder",
"Weapon",
"Tail"
"Tail",
};
return bodyPartLabels[idx];
}
@ -73,7 +73,7 @@ std::string meshPartLabel(int idx)
"Knee",
"Upper Leg",
"Clavicle",
"Tail"
"Tail",
};
return meshPartLabels[idx];
}
@ -88,7 +88,7 @@ std::string meshTypeLabel(int idx)
static const char *meshTypeLabels[] = {
"Skin",
"Clothing",
"Armor"
"Armor",
};
return meshTypeLabels[idx];
}
@ -110,7 +110,7 @@ std::string clothingTypeLabel(int idx)
"Left Glove",
"Skirt",
"Ring",
"Amulet"
"Amulet",
};
return clothingTypeLabels[idx];
}
@ -133,7 +133,7 @@ std::string armorTypeLabel(int idx)
"Right Gauntlet",
"Shield",
"Left Bracer",
"Right Bracer"
"Right Bracer",
};
return armorTypeLabels[idx];
}
@ -150,7 +150,7 @@ std::string dialogTypeLabel(int idx)
"Voice",
"Greeting",
"Persuasion",
"Journal"
"Journal",
};
return dialogTypeLabels[idx];
}
@ -169,7 +169,7 @@ std::string questStatusLabel(int idx)
"Name",
"Finished",
"Restart",
"Deleted"
"Deleted",
};
return questStatusLabels[idx];
}
@ -205,7 +205,7 @@ std::string soundTypeLabel(int idx)
"Moan",
"Roar",
"Scream",
"Land"
"Land",
};
return soundTypeLabels[idx];
}
@ -231,7 +231,7 @@ std::string weaponTypeLabel(int idx)
"Marksman Crossbow",
"Marksman Thrown",
"Arrow",
"Bolt"
"Bolt",
};
return weaponTypeLabels[idx];
}
@ -396,7 +396,7 @@ std::string magicEffectLabel(int idx)
"sEffectSummonCreature02",
"sEffectSummonCreature03",
"sEffectSummonCreature04",
"sEffectSummonCreature05"
"sEffectSummonCreature05",
};
return magicEffectLabels[idx];
}
@ -416,7 +416,7 @@ std::string attributeLabel(int idx)
"Speed",
"Endurance",
"Personality",
"Luck"
"Luck",
};
return attributeLabels[idx];
}
@ -434,7 +434,7 @@ std::string spellTypeLabel(int idx)
"Blight Disease",
"Disease",
"Curse",
"Powers"
"Powers",
};
return spellTypeLabels[idx];
}
@ -449,7 +449,7 @@ std::string specializationLabel(int idx)
const char* specializationLabels [] = {
"Combat",
"Magic",
"Stealth"
"Stealth",
};
return specializationLabels[idx];
}
@ -488,7 +488,7 @@ std::string skillLabel(int idx)
"Marksman",
"Mercantile",
"Speechcraft",
"Hand-to-hand"
"Hand-to-hand",
};
return skillLabels[idx];
}
@ -519,7 +519,7 @@ std::string rangeTypeLabel(int idx)
const char* rangeTypeLabels [] = {
"Self",
"Touch",
"Target"
"Target",
};
return rangeTypeLabels[idx];
}
@ -537,7 +537,7 @@ std::string schoolLabel(int idx)
"Destruction",
"Illusion",
"Mysticism",
"Restoration"
"Restoration",
};
return schoolLabels[idx];
}
@ -553,7 +553,7 @@ std::string enchantTypeLabel(int idx)
"Cast Once",
"Cast When Strikes",
"Cast When Used",
"Constant Effect"
"Constant Effect",
};
return enchantTypeLabels[idx];
}
@ -638,7 +638,7 @@ std::string ruleFunction(int idx)
"Alarm",
"Flee",
"Should Attack",
"Werewolf"
"Werewolf",
};
return ruleFunctions[idx];
}

@ -14,15 +14,15 @@ int main(int argc, char** argv)
{
try
{
bpo::options_description desc("Syntax: openmw-essimporter <options> infile.ess outfile.omwsave\nAllowed options");
bpo::options_description desc(R"(Syntax: openmw-essimporter <options> infile.ess outfile.omwsave
Allowed options)");
bpo::positional_options_description p_desc;
desc.add_options()
("help,h", "produce help message")
("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file")
("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)")
("compare,c", "compare two .ess files")
("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file")
;
auto addOption = desc.add_options();
addOption("help,h", "produce help message");
addOption("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file");
addOption("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)");
addOption("compare,c", "compare two .ess files");
addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file");
p_desc.add("mwsave", 1).add("output", 1);
Files::ConfigurationManager::addCommonOptions(desc);
@ -32,7 +32,6 @@ int main(int argc, char** argv)
.options(desc)
.positional(p_desc)
.run();
bpo::store(parsed, variables);
if(variables.count("help") || !variables.count("mwsave") || !variables.count("output")) {

@ -71,7 +71,7 @@ void ProfilesComboBox::slotEditingFinished()
return;
setItemText(currentIndex(), current);
emit(profileRenamed(previous, current));
emit profileRenamed(previous, current);
}
void ProfilesComboBox::slotIndexChangedByUser(int index)
@ -79,7 +79,7 @@ void ProfilesComboBox::slotIndexChangedByUser(int index)
if (index == -1)
return;
emit (signalProfileChanged(mOldProfile, currentText()));
emit signalProfileChanged(mOldProfile, currentText());
mOldProfile = currentText();
}

@ -61,20 +61,20 @@ int wmain(int argc, wchar_t *wargv[]) {
{
bpo::options_description desc("Syntax: openmw-iniimporter <options> inifile configfile\nAllowed options");
bpo::positional_options_description p_desc;
desc.add_options()
("help,h", "produce help message")
("verbose,v", "verbose output")
("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file")
("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file")
("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file")
("game-files,g", "import esm and esp files")
("fonts,f", "import bitmap fonts")
("no-archives,A", "disable bsa archives import")
("encoding,e", bpo::value<std::string>()-> default_value("win1252"),
auto addOption = desc.add_options();
addOption("help,h", "produce help message");
addOption("verbose,v", "verbose output");
addOption("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file");
addOption("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file");
addOption("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file");
addOption("game-files,g", "import esm and esp files");
addOption("fonts,f", "import bitmap fonts");
addOption("no-archives,A", "disable bsa archives import");
addOption("encoding,e", bpo::value<std::string>()-> default_value("win1252"),
"Character encoding used in OpenMW game messages:\n"
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default")
"\n\twin1252 - Western European (Latin) alphabet, used by default");
;
p_desc.add("ini", 1).add("cfg", 1);
@ -84,7 +84,6 @@ int wmain(int argc, wchar_t *wargv[]) {
.options(desc)
.positional(p_desc)
.run();
bpo::store(parsed, vm);
if(vm.count("help") || !vm.count("ini") || !vm.count("cfg")) {

@ -54,52 +54,51 @@ namespace NavMeshTool
using Fallback::FallbackMap;
bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");
result.add_options()
("help", "print help message")
addOption("version", "print version information and quit");
("version", "print version information and quit")
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)");
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)")
addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
"set local data directory (highest priority)");
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
"set local data directory (highest priority)")
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory")
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)");
("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)")
("encoding", bpo::value<std::string>()->
addOption("encoding", bpo::value<std::string>()->
default_value("win1252"),
"Character encoding used in OpenMW game messages:\n"
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default")
"\n\twin1252 - Western European (Latin) alphabet, used by default");
addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values");
("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values")
addOption("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),
"number of threads for parallel processing");
("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),
"number of threads for parallel processing")
addOption("process-interior-cells", bpo::value<bool>()->implicit_value(true)
->default_value(false), "build navmesh for interior cells");
("process-interior-cells", bpo::value<bool>()->implicit_value(true)
->default_value(false), "build navmesh for interior cells")
addOption("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)
->default_value(false), "remove tiles from cache that will not be used with current content profile");
("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)
->default_value(false), "remove tiles from cache that will not be used with current content profile")
addOption("write-binary-log", bpo::value<bool>()->implicit_value(true)
->default_value(false), "write progress in binary messages to be consumed by the launcher");
("write-binary-log", bpo::value<bool>()->implicit_value(true)
->default_value(false), "write progress in binary messages to be consumed by the launcher")
;
Files::ConfigurationManager::addCommonOptions(result);
return result;

@ -70,15 +70,16 @@ void readVFS(std::unique_ptr<VFS::Archive>&& anArchive, const std::filesystem::p
bool parseOptions (int argc, char** argv, std::vector<Files::MaybeQuotedPath> &files)
{
bpo::options_description desc("Ensure that OpenMW can use the provided NIF and BSA files\n\n"
"Usages:\n"
" niftool <nif files, BSA files, or directories>\n"
" Scan the file or directories for nif errors.\n\n"
"Allowed options");
desc.add_options()
("help,h", "print help message.")
("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
;
bpo::options_description desc(R"(Ensure that OpenMW can use the provided NIF and BSA files
Usages:
niftool <nif files, BSA files, or directories>
Scan the file or directories for nif errors.
Allowed options)");
auto addOption = desc.add_options();
addOption("help,h", "print help message.");
addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
//Default option if none provided
bpo::positional_options_description p;

@ -89,19 +89,19 @@ boost::program_options::variables_map CS::Editor::readConfiguration()
boost::program_options::variables_map variables;
boost::program_options::options_description desc("Syntax: openmw-cs <options>\nAllowed options");
desc.add_options()
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing())
("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""))
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
("encoding", boost::program_options::value<std::string>()->default_value("win1252"))
("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"))
("fallback-archive", boost::program_options::value<std::vector<std::string>>()->
default_value(std::vector<std::string>(), "fallback-archive")->multitoken())
("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values")
("script-blacklist", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
->multitoken(), "exclude specified script from the verifier (if the use of the blacklist is enabled)")
("script-blacklist-use", boost::program_options::value<bool>()->implicit_value(true)
auto addOption = desc.add_options();
addOption("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing());
addOption("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
addOption("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false));
addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
addOption("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"));
addOption("fallback-archive", boost::program_options::value<std::vector<std::string>>()->
default_value(std::vector<std::string>(), "fallback-archive")->multitoken());
addOption("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values");
addOption("script-blacklist", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
->multitoken(), "exclude specified script from the verifier (if the use of the blacklist is enabled)");
addOption("script-blacklist-use", boost::program_options::value<bool>()->implicit_value(true)
->default_value(true), "enable script blacklisting");
Files::ConfigurationManager::addCommonOptions(desc);

@ -678,7 +678,7 @@ CSMPrefs::Category& CSMPrefs::State::operator[] (const std::string& key)
void CSMPrefs::State::update (const Setting& setting)
{
emit (settingChanged (&setting));
emit settingChanged(&setting);
}
CSMPrefs::State& CSMPrefs::State::get()

@ -375,7 +375,8 @@ namespace CSMWorld
{ ColumnId_LevelledCreatureId,"Levelled Creature" },
{ -1, 0 } // end marker
// end marker
{ -1, 0 },
};
}
}

@ -267,7 +267,7 @@ const char* CSMWorld::DefaultGmsts::Floats[CSMWorld::DefaultGmsts::FloatCount] =
"fWereWolfStrength",
"fWereWolfUnarmored",
"fWereWolfWillPower",
"fWortChanceValue"
"fWortChanceValue",
};
const char * CSMWorld::DefaultGmsts::Ints[CSMWorld::DefaultGmsts::IntCount] =
@ -360,7 +360,7 @@ const char * CSMWorld::DefaultGmsts::Ints[CSMWorld::DefaultGmsts::IntCount] =
"iWereWolfBounty",
"iWereWolfFightMod",
"iWereWolfFleeMod",
"iWereWolfLevelToAttack"
"iWereWolfLevelToAttack",
};
const char * CSMWorld::DefaultGmsts::Strings[CSMWorld::DefaultGmsts::StringCount] =
@ -1538,7 +1538,7 @@ const char * CSMWorld::DefaultGmsts::Strings[CSMWorld::DefaultGmsts::StringCount
"sXTimes",
"sXTimesINT",
"sYes",
"sYourGold"
"sYourGold",
};
const char * CSMWorld::DefaultGmsts::OptionalFloats[CSMWorld::DefaultGmsts::OptionalFloatCount] =
@ -1584,7 +1584,7 @@ const char * CSMWorld::DefaultGmsts::OptionalFloats[CSMWorld::DefaultGmsts::Opti
"fWereWolfSpeed",
"fWereWolfStrength",
"fWereWolfUnarmored",
"fWereWolfWillPower"
"fWereWolfWillPower",
};
const char * CSMWorld::DefaultGmsts::OptionalInts[CSMWorld::DefaultGmsts::OptionalIntCount] =
@ -1592,7 +1592,7 @@ const char * CSMWorld::DefaultGmsts::OptionalInts[CSMWorld::DefaultGmsts::Option
"iWereWolfBounty",
"iWereWolfFightMod",
"iWereWolfFleeMod",
"iWereWolfLevelToAttack"
"iWereWolfLevelToAttack",
};
const char * CSMWorld::DefaultGmsts::OptionalStrings[CSMWorld::DefaultGmsts::OptionalStringCount] =
@ -1622,7 +1622,7 @@ const char * CSMWorld::DefaultGmsts::OptionalStrings[CSMWorld::DefaultGmsts::Opt
"sWerewolfAlarmMessage",
"sWerewolfPopup",
"sWerewolfRefusal",
"sWerewolfRestMessage"
"sWerewolfRestMessage",
};
const float CSMWorld::DefaultGmsts::FloatsDefaultValues[CSMWorld::DefaultGmsts::FloatCount] =
@ -1884,7 +1884,7 @@ const float CSMWorld::DefaultGmsts::FloatsDefaultValues[CSMWorld::DefaultGmsts::
150.0f, // fWereWolfStrength
100.0f, // fWereWolfUnarmored
1.0f, // fWereWolfWillPower
15.0f // fWortChanceValue
15.0f, // fWortChanceValue
};
const int CSMWorld::DefaultGmsts::IntsDefaultValues[CSMWorld::DefaultGmsts::IntCount] =
@ -1977,7 +1977,7 @@ const int CSMWorld::DefaultGmsts::IntsDefaultValues[CSMWorld::DefaultGmsts::IntC
10000, // iWereWolfBounty
100, // iWereWolfFightMod
100, // iWereWolfFleeMod
20 // iWereWolfLevelToAttack
20, // iWereWolfLevelToAttack
};
const float CSMWorld::DefaultGmsts::FloatLimits[CSMWorld::DefaultGmsts::FloatCount * 2] =
@ -2239,7 +2239,7 @@ const float CSMWorld::DefaultGmsts::FloatLimits[CSMWorld::DefaultGmsts::FloatCou
-FInf, FInf, // fWereWolfStrength
-FInf, FInf, // fWereWolfUnarmored
-FInf, FInf, // fWereWolfWillPower
0, FInf // fWortChanceValue
0, FInf, // fWortChanceValue
};
const int CSMWorld::DefaultGmsts::IntLimits[CSMWorld::DefaultGmsts::IntCount * 2] =
@ -2332,5 +2332,5 @@ const int CSMWorld::DefaultGmsts::IntLimits[CSMWorld::DefaultGmsts::IntCount * 2
IMin, IMax, // iWereWolfBounty
IMin, IMax, // iWereWolfFightMod
IMin, IMax, // iWereWolfFleeMod
IMin, IMax // iWereWolfLevelToAttack
IMin, IMax, // iWereWolfLevelToAttack
};

@ -140,7 +140,7 @@ namespace MWLua
{"TogglePostProcessorHUD", MWInput::A_TogglePostProcessorHUD},
{"ZoomIn", MWInput::A_ZoomIn},
{"ZoomOut", MWInput::A_ZoomOut}
{"ZoomOut", MWInput::A_ZoomOut},
}));
api["CONTROL_SWITCH"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, std::string_view>({
@ -150,7 +150,7 @@ namespace MWLua
{"Looking", "playerlooking"},
{"Magic", "playermagic"},
{"ViewMode", "playerviewswitch"},
{"VanityMode", "vanitymode"}
{"VanityMode", "vanitymode"},
}));
api["CONTROLLER_BUTTON"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, SDL_GameControllerButton>({
@ -168,7 +168,7 @@ namespace MWLua
{"DPadUp", SDL_CONTROLLER_BUTTON_DPAD_UP},
{"DPadDown", SDL_CONTROLLER_BUTTON_DPAD_DOWN},
{"DPadLeft", SDL_CONTROLLER_BUTTON_DPAD_LEFT},
{"DPadRight", SDL_CONTROLLER_BUTTON_DPAD_RIGHT}
{"DPadRight", SDL_CONTROLLER_BUTTON_DPAD_RIGHT},
}));
api["CONTROLLER_AXIS"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, int>({
@ -182,7 +182,7 @@ namespace MWLua
{"LookUpDown", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_LookUpDown)},
{"LookLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_LookLeftRight)},
{"MoveForwardBackward", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_MoveForwardBackward)},
{"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_MoveLeftRight)}
{"MoveLeftRight", SDL_CONTROLLER_AXIS_MAX + static_cast<int>(MWInput::A_MoveLeftRight)},
}));
api["KEY"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, SDL_Scancode>({
@ -293,7 +293,7 @@ namespace MWLua
{"Semicolon", SDL_SCANCODE_SEMICOLON},
{"Slash", SDL_SCANCODE_SLASH},
{"Space", SDL_SCANCODE_SPACE},
{"Tab", SDL_SCANCODE_TAB}
{"Tab", SDL_SCANCODE_TAB},
}));
return LuaUtil::makeReadOnly(api);

@ -18,92 +18,91 @@ namespace OpenMW
bpo::options_description desc("Syntax: openmw <options>\nAllowed options");
Files::ConfigurationManager::addCommonOptions(desc);
desc.add_options()
("help", "print help message")
("version", "print version information and quit")
auto addOption = desc.add_options();
addOption("help", "print help message");
addOption("version", "print version information and quit");
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)")
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)");
("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"set local data directory (highest priority)")
addOption("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"set local data directory (highest priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory")
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory");
("start", bpo::value<std::string>()->default_value(""),
"set initial cell")
addOption("start", bpo::value<std::string>()->default_value(""),
"set initial cell");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon")
addOption("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon");
("no-sound", bpo::value<bool>()->implicit_value(true)
->default_value(false), "disable all sounds")
addOption("no-sound", bpo::value<bool>()->implicit_value(true)
->default_value(false), "disable all sounds");
("script-all", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all scripts (excluding dialogue scripts) at startup")
addOption("script-all", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all scripts (excluding dialogue scripts) at startup");
("script-all-dialogue", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all dialogue scripts at startup")
addOption("script-all-dialogue", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all dialogue scripts at startup");
("script-console", bpo::value<bool>()->implicit_value(true)
->default_value(false), "enable console-only script functionality")
addOption("script-console", bpo::value<bool>()->implicit_value(true)
->default_value(false), "enable console-only script functionality");
("script-run", bpo::value<std::string>()->default_value(""),
"select a file containing a list of console commands that is executed on startup")
addOption("script-run", bpo::value<std::string>()->default_value(""),
"select a file containing a list of console commands that is executed on startup");
("script-warn", bpo::value<int>()->implicit_value (1)
addOption("script-warn", bpo::value<int>()->implicit_value (1)
->default_value (1),
"handling of warnings when compiling scripts\n"
"\t0 - ignore warning\n"
"\t1 - show warning but consider script as correctly compiled anyway\n"
"\t2 - treat warnings as errors")
"\t2 - treat warnings as errors");
("script-blacklist", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)")
addOption("script-blacklist", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)");
("script-blacklist-use", bpo::value<bool>()->implicit_value(true)
->default_value(true), "enable script blacklisting")
addOption("script-blacklist-use", bpo::value<bool>()->implicit_value(true)
->default_value(true), "enable script blacklisting");
("load-savegame", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"load a save game file on game startup (specify an absolute filename or a filename relative to the current working directory)")
addOption("load-savegame", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"load a save game file on game startup (specify an absolute filename or a filename relative to the current working directory)");
("skip-menu", bpo::value<bool>()->implicit_value(true)
->default_value(false), "skip main menu on game startup")
addOption("skip-menu", bpo::value<bool>()->implicit_value(true)
->default_value(false), "skip main menu on game startup");
("new-game", bpo::value<bool>()->implicit_value(true)
->default_value(false), "run new game sequence (ignored if skip-menu=0)")
addOption("new-game", bpo::value<bool>()->implicit_value(true)
->default_value(false), "run new game sequence (ignored if skip-menu=0)");
("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)")
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)");
("encoding", bpo::value<std::string>()->
addOption("encoding", bpo::value<std::string>()->
default_value("win1252"),
"Character encoding used in OpenMW game messages:\n"
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default")
"\n\twin1252 - Western European (Latin) alphabet, used by default");
("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values")
addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values");
("no-grab", bpo::value<bool>()->implicit_value(true)->default_value(false), "Don't grab mouse cursor")
addOption("no-grab", bpo::value<bool>()->implicit_value(true)->default_value(false), "Don't grab mouse cursor");
("export-fonts", bpo::value<bool>()->implicit_value(true)
->default_value(false), "Export Morrowind .fnt fonts to PNG image and XML file in current directory")
addOption("export-fonts", bpo::value<bool>()->implicit_value(true)
->default_value(false), "Export Morrowind .fnt fonts to PNG image and XML file in current directory");
("activate-dist", bpo::value <int> ()->default_value (-1), "activation distance override")
addOption("activate-dist", bpo::value <int> ()->default_value (-1), "activation distance override");
("random-seed", bpo::value <unsigned int> ()
addOption("random-seed", bpo::value <unsigned int> ()
->default_value(Misc::Rng::generateDefaultSeed()),
"seed value for random number generator")
;
"seed value for random number generator");
return desc;
}

@ -145,11 +145,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_then_find_path_should_return_path)
{
constexpr std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -196,11 +196,11 @@ namespace
mNavigator.reset(new NavigatorImpl(mSettings, std::make_unique<NavMeshDb>(":memory:", std::numeric_limits<std::uint64_t>::max())));
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -283,11 +283,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_changed_object_should_change_navmesh)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -370,21 +370,21 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, for_overlapping_heightfields_objects_should_use_higher)
{
const std::array<btScalar, 5 * 5> heightfieldData1 {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
CollisionShapeInstance heightfield1(makeSquareHeightfieldTerrainShape(heightfieldData1));
heightfield1.shape().setLocalScaling(btVector3(128, 128, 1));
const std::array<btScalar, 5 * 5> heightfieldData2 {{
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, // row 0
-25, -25, -25, -25, -25, // row 1
-25, -25, -25, -25, -25, // row 2
-25, -25, -25, -25, -25, // row 3
-25, -25, -25, -25, -25, // row 4
}};
CollisionShapeInstance heightfield2(makeSquareHeightfieldTerrainShape(heightfieldData2));
heightfield2.shape().setLocalScaling(btVector3(128, 128, 1));
@ -427,21 +427,21 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, only_one_heightfield_per_cell_is_allowed)
{
const std::array<float, 5 * 5> heightfieldData1 {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface1 = makeSquareHeightfieldSurface(heightfieldData1);
const int cellSize1 = mHeightfieldTileSize * (surface1.mSize - 1);
const std::array<float, 5 * 5> heightfieldData2 {{
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, // row 0
-25, -25, -25, -25, -25, // row 1
-25, -25, -25, -25, -25, // row 2
-25, -25, -25, -25, -25, // row 3
-25, -25, -25, -25, -25, // row 4
}};
const HeightfieldSurface surface2 = makeSquareHeightfieldSurface(heightfieldData2);
const int cellSize2 = mHeightfieldTileSize * (surface2.mSize - 1);
@ -465,22 +465,22 @@ namespace
osg::ref_ptr<Resource::BulletShape> bulletShape(new Resource::BulletShape);
std::array<btScalar, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
std::unique_ptr<btHeightfieldTerrainShape> shapePtr = makeSquareHeightfieldTerrainShape(heightfieldData);
shapePtr->setLocalScaling(btVector3(128, 128, 1));
bulletShape->mCollisionShape.reset(shapePtr.release());
std::array<btScalar, 5 * 5> heightfieldDataAvoid {{
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, // row 0
-25, -25, -25, -25, -25, // row 1
-25, -25, -25, -25, -25, // row 2
-25, -25, -25, -25, -25, // row 3
-25, -25, -25, -25, -25, // row 4
}};
std::unique_ptr<btHeightfieldTerrainShape> shapeAvoidPtr = makeSquareHeightfieldTerrainShape(heightfieldDataAvoid);
shapeAvoidPtr->setLocalScaling(btVector3(128, 128, 1));
@ -526,11 +526,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_water_ground_lower_than_water_with_only_swim_flag)
{
std::array<float, 5 * 5> heightfieldData {{
-50, -50, -50, -50, 0,
-50, -100, -150, -100, -50,
-50, -150, -200, -150, -100,
-50, -100, -150, -100, -100,
0, -50, -100, -100, -100,
-50, -50, -50, -50, 0, // row 0
-50, -100, -150, -100, -50, // row 1
-50, -150, -200, -150, -100, // row 2
-50, -100, -150, -100, -100, // row 3
0, -50, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -572,13 +572,13 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_water_when_ground_cross_water_with_swim_and_walk_flags)
{
std::array<float, 7 * 7> heightfieldData {{
0, 0, 0, 0, 0, 0, 0,
0, -100, -100, -100, -100, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -150, -200, -150, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -100, -100, -100, -100, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, // row 0
0, -100, -100, -100, -100, -100, 0, // row 1
0, -100, -150, -150, -150, -100, 0, // row 2
0, -100, -150, -200, -150, -100, 0, // row 3
0, -100, -150, -150, -150, -100, 0, // row 4
0, -100, -100, -100, -100, -100, 0, // row 5
0, 0, 0, 0, 0, 0, 0, // row 6
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -618,13 +618,13 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_water_when_ground_cross_water_with_max_int_cells_size_and_swim_and_walk_flags)
{
std::array<float, 7 * 7> heightfieldData {{
0, 0, 0, 0, 0, 0, 0,
0, -100, -100, -100, -100, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -150, -200, -150, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -100, -100, -100, -100, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, // row 0
0, -100, -100, -100, -100, -100, 0, // row 1
0, -100, -150, -150, -150, -100, 0, // row 2
0, -100, -150, -200, -150, -100, 0, // row 3
0, -100, -150, -150, -150, -100, 0, // row 4
0, -100, -100, -100, -100, -100, 0, // row 5
0, 0, 0, 0, 0, 0, 0, // row 6
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -664,13 +664,13 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, path_should_be_over_ground_when_ground_cross_water_with_only_walk_flag)
{
std::array<float, 7 * 7> heightfieldData {{
0, 0, 0, 0, 0, 0, 0,
0, -100, -100, -100, -100, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -150, -200, -150, -100, 0,
0, -100, -150, -150, -150, -100, 0,
0, -100, -100, -100, -100, -100, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, // row 0
0, -100, -100, -100, -100, -100, 0, // row 1
0, -100, -150, -150, -150, -100, 0, // row 2
0, -100, -150, -200, -150, -100, 0, // row 3
0, -100, -150, -150, -150, -100, 0, // row 4
0, -100, -100, -100, -100, -100, 0, // row 5
0, 0, 0, 0, 0, 0, 0, // row 6
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -710,11 +710,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_object_remove_and_update_then_find_path_should_return_path)
{
const std::array<btScalar, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
CollisionShapeInstance heightfield(makeSquareHeightfieldTerrainShape(heightfieldData));
heightfield.shape().setLocalScaling(btVector3(128, 128, 1));
@ -764,11 +764,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_heightfield_remove_and_update_then_find_path_should_return_path)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -818,12 +818,12 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_then_find_random_point_around_circle_should_return_position)
{
const std::array<float, 6 * 6> heightfieldData {{
0, 0, 0, 0, 0, 0,
0, -25, -25, -25, -25, -25,
0, -25, -1000, -1000, -100, -100,
0, -25, -1000, -1000, -100, -100,
0, -25, -100, -100, -100, -100,
0, -25, -100, -100, -100, -100,
0, 0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, -25, // row 1
0, -25, -1000, -1000, -100, -100, // row 2
0, -25, -1000, -1000, -100, -100, // row 3
0, -25, -100, -100, -100, -100, // row 4
0, -25, -100, -100, -100, -100, // row 5
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -852,11 +852,11 @@ namespace
mNavigator.reset(new NavigatorImpl(mSettings, std::make_unique<NavMeshDb>(":memory:", std::numeric_limits<std::uint64_t>::max())));
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -957,11 +957,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_then_raycast_should_return_position)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -982,11 +982,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, update_for_oscillating_object_that_does_not_change_navmesh_should_not_trigger_navmesh_update)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -1066,11 +1066,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, for_not_reachable_destination_find_path_should_provide_partial_path)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);
@ -1105,11 +1105,11 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, end_tolerance_should_extent_available_destinations)
{
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, -25, -100, -100, -100,
0, 0, 0, 0, 0, // row 0
0, -25, -25, -25, -25, // row 1
0, -25, -100, -100, -100, // row 2
0, -25, -100, -100, -100, // row 3
0, -25, -100, -100, -100, // row 4
}};
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
const int cellSize = mHeightfieldTileSize * (surface.mSize - 1);

@ -91,9 +91,9 @@ namespace
AreaType_ground, mSource, mObjectTransform);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-1, -1, 0,
-1, 1, 0,
1, -1, 0,
-1, -1, 0, // vertex 0
-1, 1, 0, // vertex 1
1, -1, 0, // vertex 2
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -112,9 +112,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
0, 0, 3,
0, 4, 3,
2, 0, 3,
0, 0, 3, // vertex 0
0, 4, 3, // vertex 1
2, 0, 3, // vertex 2
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -129,10 +129,10 @@ namespace
AreaType_ground, mSource, mObjectTransform);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-0.5, -0.5, 0,
-0.5, 0.5, 0,
0.5, -0.5, 0,
0.5, 0.5, 0,
-0.5, -0.5, 0, // vertex 0
-0.5, 0.5, 0, // vertex 1
0.5, -0.5, 0, // vertex 2
0.5, 0.5, 0, // vertex 3
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({0, 1, 2, 2, 1, 3}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground, AreaType_ground}));
@ -146,28 +146,28 @@ namespace
AreaType_ground, mSource, mObjectTransform);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-1, -1, -2,
-1, -1, 2,
-1, 1, -2,
-1, 1, 2,
1, -1, -2,
1, -1, 2,
1, 1, -2,
1, 1, 2,
-1, -1, -2, // vertex 0
-1, -1, 2, // vertex 1
-1, 1, -2, // vertex 2
-1, 1, 2, // vertex 3
1, -1, -2, // vertex 4
1, -1, 2, // vertex 5
1, 1, -2, // vertex 6
1, 1, 2, // vertex 7
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({
0, 1, 5,
0, 2, 3,
0, 4, 6,
1, 3, 7,
2, 6, 7,
3, 1, 0,
4, 5, 7,
5, 4, 0,
6, 2, 0,
7, 3, 2,
7, 5, 1,
7, 6, 4,
0, 1, 5, // triangle 0
0, 2, 3, // triangle 1
0, 4, 6, // triangle 2
1, 3, 7, // triangle 3
2, 6, 7, // triangle 4
3, 1, 0, // triangle 5
4, 5, 7, // triangle 6
5, 4, 0, // triangle 7
6, 2, 0, // triangle 8
7, 3, 2, // triangle 9
7, 5, 1, // triangle 10
7, 6, 4, // triangle 11
})) << recastMesh->getMesh().getIndices();
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>(12, AreaType_ground));
}
@ -193,34 +193,34 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-1, -1, -2,
-1, -1, 0,
-1, -1, 2,
-1, 1, -2,
-1, 1, 0,
-1, 1, 2,
1, -1, -2,
1, -1, 0,
1, -1, 2,
1, 1, -2,
1, 1, 0,
1, 1, 2,
-1, -1, -2, // vertex 0
-1, -1, 0, // vertex 1
-1, -1, 2, // vertex 2
-1, 1, -2, // vertex 3
-1, 1, 0, // vertex 4
-1, 1, 2, // vertex 5
1, -1, -2, // vertex 6
1, -1, 0, // vertex 7
1, -1, 2, // vertex 8
1, 1, -2, // vertex 9
1, 1, 0, // vertex 10
1, 1, 2, // vertex 11
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({
0, 2, 8,
0, 3, 5,
0, 6, 9,
2, 5, 11,
3, 9, 11,
5, 2, 0,
6, 8, 11,
7, 4, 1,
7, 4, 10,
8, 6, 0,
9, 3, 0,
11, 5, 3,
11, 8, 2,
11, 9, 6,
0, 2, 8, // triangle 0
0, 3, 5, // triangle 1
0, 6, 9, // triangle 2
2, 5, 11, // triangle 3
3, 9, 11, // triangle 4
5, 2, 0, // triangle 5
6, 8, 11, // triangle 6
7, 4, 1, // triangle 7
7, 4, 10, // triangle 8
8, 6, 0, // triangle 9
9, 3, 0, // triangle 10
11, 5, 3, // triangle 11
11, 8, 2, // triangle 12
11, 9, 6, // triangle 13
})) << recastMesh->getMesh().getIndices();
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>(14, AreaType_ground));
}
@ -240,9 +240,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
0, 0, 3,
0, 4, 3,
2, 0, 3,
0, 0, 3, // vertex 0
0, 4, 3, // vertex 1
2, 0, 3, // vertex 2
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -264,9 +264,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
1, 2, 12,
1, 10, 12,
3, 2, 12,
1, 2, 12, // vertex 0
1, 10, 12, // vertex 1
3, 2, 12, // vertex 2
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -286,12 +286,12 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-3, -3, 0,
-3, -2, 0,
-2, -3, 0,
-1, -1, 0,
-1, 1, 0,
1, -1, 0,
-3, -3, 0, // vertex 0
-3, -2, 0, // vertex 1
-2, -3, 0, // vertex 2
-1, -1, 0, // vertex 3
-1, 1, 0, // vertex 4
1, -1, 0, // vertex 5
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0, 5, 4, 3}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>(2, AreaType_ground));
@ -313,9 +313,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-3, -3, 0,
-3, -2, 0,
-2, -3, 0,
-3, -3, 0, // vertex 0
-3, -2, 0, // vertex 1
-2, -3, 0, // vertex 2
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -338,9 +338,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_THAT(recastMesh->getMesh().getVertices(), Pointwise(FloatNear(1e-5f), std::vector<float>({
0, -4.24264049530029296875f, 4.44089209850062616169452667236328125e-16f,
0, -3.535533905029296875f, -0.707106769084930419921875f,
0, -3.535533905029296875f, 0.707106769084930419921875f,
0, -4.24264049530029296875f, 4.44089209850062616169452667236328125e-16f, // vertex 0
0, -3.535533905029296875f, -0.707106769084930419921875f, // vertex 1
0, -3.535533905029296875f, 0.707106769084930419921875f, // vertex 2
}))) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({1, 2, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -363,9 +363,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_THAT(recastMesh->getMesh().getVertices(), Pointwise(FloatNear(1e-5f), std::vector<float>({
-4.24264049530029296875f, 0, 4.44089209850062616169452667236328125e-16f,
-3.535533905029296875f, 0, -0.707106769084930419921875f,
-3.535533905029296875f, 0, 0.707106769084930419921875f,
-4.24264049530029296875f, 0, 4.44089209850062616169452667236328125e-16f, // vertex 0
-3.535533905029296875f, 0, -0.707106769084930419921875f, // vertex 1
-3.535533905029296875f, 0, 0.707106769084930419921875f, // vertex 2
}))) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({1, 2, 0}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -388,9 +388,9 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_THAT(recastMesh->getMesh().getVertices(), Pointwise(FloatNear(1e-5f), std::vector<float>({
-1.41421353816986083984375f, -1.1102230246251565404236316680908203125e-16f, 0,
1.1102230246251565404236316680908203125e-16f, -1.41421353816986083984375f, 0,
1.41421353816986083984375f, 1.1102230246251565404236316680908203125e-16f, 0,
-1.41421353816986083984375f, -1.1102230246251565404236316680908203125e-16f, 0, // vertex 0
1.1102230246251565404236316680908203125e-16f, -1.41421353816986083984375f, 0, // vertex 1
1.41421353816986083984375f, 1.1102230246251565404236316680908203125e-16f, 0, // vertex 2
}))) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 0, 1}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground}));
@ -417,12 +417,12 @@ namespace
);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-3, -3, 0,
-3, -2, 0,
-2, -3, 0,
-1, -1, 0,
-1, 1, 0,
1, -1, 0,
-3, -3, 0, // vertex 0
-3, -2, 0, // vertex 1
-2, -3, 0, // vertex 2
-1, -1, 0, // vertex 3
-1, 1, 0, // vertex 4
1, -1, 0, // vertex 5
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0, 5, 4, 3}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_null, AreaType_ground}));
@ -449,10 +449,10 @@ namespace
builder.addObject(static_cast<const btCollisionShape&>(shape), btTransform::getIdentity(), AreaType_ground, mSource, mObjectTransform);
const auto recastMesh = std::move(builder).create(mVersion);
EXPECT_EQ(recastMesh->getMesh().getVertices(), std::vector<float>({
-1, -1, 0,
-1, 1, 0,
1, -1, 0,
1, 1, 0,
-1, -1, 0, // vertex 0
-1, 1, 0, // vertex 1
1, -1, 0, // vertex 2
1, 1, 0, // vertex 3
})) << recastMesh->getMesh().getVertices();
EXPECT_EQ(recastMesh->getMesh().getIndices(), std::vector<int>({2, 1, 0, 2, 1, 3}));
EXPECT_EQ(recastMesh->getMesh().getAreaTypes(), std::vector<AreaType>({AreaType_ground, AreaType_ground}));
@ -476,9 +476,9 @@ namespace
{
constexpr std::size_t size = 3;
constexpr std::array<float, size * size> heights {{
0, 1, 2,
3, 4, 5,
6, 7, 8,
0, 1, 2, // row 0
3, 4, 5, // row 1
6, 7, 8, // row 2
}};
const osg::Vec2i cellPosition(0, 0);
const int cellSize = 1000;
@ -493,11 +493,7 @@ namespace
expected.mLength = size;
expected.mMinHeight = minHeight;
expected.mMaxHeight = maxHeight;
expected.mHeights = {
0, 1, 2,
3, 4, 5,
6, 7, 8,
};
expected.mHeights.assign(heights.begin(), heights.end());
expected.mOriginalSize = 3;
expected.mMinX = 0;
expected.mMinY = 0;
@ -508,9 +504,9 @@ namespace
{
constexpr std::size_t size = 3;
constexpr std::array<float, size * size> heights {{
0, 1, 2,
3, 4, 5,
6, 7, 8,
0, 1, 2, // row 0
3, 4, 5, // row 1
6, 7, 8, // row 2
}};
const osg::Vec2i cellPosition(1, 2);
const int cellSize = 1000;
@ -525,11 +521,7 @@ namespace
expected.mLength = size;
expected.mMinHeight = minHeight;
expected.mMaxHeight = maxHeight;
expected.mHeights = {
0, 1, 2,
3, 4, 5,
6, 7, 8,
};
expected.mHeights.assign(heights.begin(), heights.end());
expected.mOriginalSize = 3;
expected.mMinX = 0;
expected.mMinY = 0;
@ -540,9 +532,9 @@ namespace
{
constexpr std::size_t size = 3;
constexpr std::array<float, 3 * 3> heights {{
0, 1, 2,
3, 4, 5,
6, 7, 8,
0, 1, 2, // row 0
3, 4, 5, // row 1
6, 7, 8, // row 2
}};
const osg::Vec2i cellPosition(0, 0);
const int cellSize = 1000;
@ -559,8 +551,8 @@ namespace
expected.mMinHeight = 0;
expected.mMaxHeight = 8;
expected.mHeights = {
4, 5,
7, 8,
4, 5, // row 0
7, 8, // row 1
};
expected.mOriginalSize = 3;
expected.mMinX = 1;

@ -61,11 +61,11 @@ struct ContentFileTest : public ::testing::Test
boost::program_options::variables_map variables;
boost::program_options::options_description desc("Allowed options");
desc.add_options()
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing())
("content", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon")
("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
auto addOption = desc.add_options();
addOption("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing());
addOption("content", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon");
addOption("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
Files::ConfigurationManager::addCommonOptions(desc);
mConfigurationManager.readConfiguration(variables, desc, true);

@ -50,7 +50,7 @@ add_component_dir (vfs
add_component_dir (resource
scenemanager keyframemanager imagemanager bulletshapemanager bulletshape niffilemanager objectcache multiobjectcache resourcesystem
resourcemanager stats animation foreachbulletobject
resourcemanager stats animation foreachbulletobject errormarker
)
add_component_dir (shader
@ -197,7 +197,7 @@ add_component_dir (esm4
add_component_dir (misc
constants utf8stream resourcehelpers rng messageformatparser weakcache thread
compression osguservalues errorMarker color tuplemeta tuplehelpers
compression osguservalues color tuplemeta tuplehelpers
)
add_component_dir (stereo

@ -10,7 +10,7 @@ const Attribute::AttributeID Attribute::sAttributeIds[Attribute::Length] = {
Attribute::Speed,
Attribute::Endurance,
Attribute::Personality,
Attribute::Luck
Attribute::Luck,
};
const std::string Attribute::sAttributeNames[Attribute::Length] = {
@ -21,7 +21,7 @@ const std::string Attribute::sAttributeNames[Attribute::Length] = {
"Speed",
"Endurance",
"Personality",
"Luck"
"Luck",
};
const std::string Attribute::sGmstAttributeIds[Attribute::Length] = {
@ -32,7 +32,7 @@ const std::string Attribute::sGmstAttributeIds[Attribute::Length] = {
"sAttributeSpeed",
"sAttributeEndurance",
"sAttributePersonality",
"sAttributeLuck"
"sAttributeLuck",
};
const std::string Attribute::sGmstAttributeDescIds[Attribute::Length] = {
@ -43,7 +43,7 @@ const std::string Attribute::sGmstAttributeDescIds[Attribute::Length] = {
"sSpdDesc",
"sEndDesc",
"sPerDesc",
"sLucDesc"
"sLucDesc",
};
const std::string Attribute::sAttributeIcons[Attribute::Length] = {
@ -54,5 +54,5 @@ const std::string Attribute::sAttributeIcons[Attribute::Length] = {
"icons\\k\\attribute_speed.dds",
"icons\\k\\attribute_endurance.dds",
"icons\\k\\attribute_personality.dds",
"icons\\k\\attribute_luck.dds"
"icons\\k\\attribute_luck.dds",
};

@ -160,7 +160,7 @@ namespace
"SummonBear",
"SummonBonewolf",
"SummonCreature04",
"SummonCreature05"
"SummonCreature05",
};
const int NumberOfHardcodedFlags = 143;

@ -177,12 +177,12 @@ void ConfigurationManager::addExtraConfigDirs(std::stack<std::filesystem::path>&
void ConfigurationManager::addCommonOptions(bpo::options_description& description)
{
description.add_options()
("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "")
->multitoken()->composing(), "additional config directories")
("replace", bpo::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")->multitoken()->composing(),
"settings where the values from the current source should replace those from lower-priority sources instead of being appended")
("user-data", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
auto addOption = description.add_options();
addOption("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "")
->multitoken()->composing(), "additional config directories");
addOption("replace", bpo::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")->multitoken()->composing(),
"settings where the values from the current source should replace those from lower-priority sources instead of being appended");
addOption("user-data", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"set user data directory (used for saves, screenshots, etc)");
}

@ -23,7 +23,7 @@ namespace fx
{"disable_underwater" , Technique::Flag_Disable_Underwater},
{"disable_abovewater" , Technique::Flag_Disable_Abovewater},
{"disable_sunglare" , Technique::Flag_Disable_SunGlare},
{"hidden" , Technique::Flag_Hidden}
{"hidden" , Technique::Flag_Hidden},
}};
constexpr std::array<std::pair<std::string_view, int>, 6> SourceFormat = {{
@ -63,7 +63,7 @@ namespace fx
{"depth_component16" , GL_DEPTH_COMPONENT16},
{"depth_component24" , GL_DEPTH_COMPONENT24},
{"depth_component32" , GL_DEPTH_COMPONENT32},
{"depth_component32f", GL_DEPTH_COMPONENT32F}
{"depth_component32f", GL_DEPTH_COMPONENT32F},
}};
constexpr std::array<std::pair<std::string_view, osg::Texture::InternalFormatMode>, 13> Compression = {{
@ -79,7 +79,7 @@ namespace fx
{"rgtc1" , osg::Texture::USE_RGTC1_COMPRESSION},
{"rgtc2" , osg::Texture::USE_RGTC2_COMPRESSION},
{"s3tc_dxt1c" , osg::Texture::USE_S3TC_DXT1c_COMPRESSION},
{"s3tc_dxt1a" , osg::Texture::USE_S3TC_DXT1a_COMPRESSION}
{"s3tc_dxt1a" , osg::Texture::USE_S3TC_DXT1a_COMPRESSION},
}};
constexpr std::array<std::pair<std::string_view, osg::Texture::WrapMode>, 6> WrapMode = {{
@ -87,7 +87,7 @@ namespace fx
{"clamp_to_edge" , osg::Texture::CLAMP_TO_EDGE},
{"clamp_to_border", osg::Texture::CLAMP_TO_BORDER},
{"repeat" , osg::Texture::REPEAT},
{"mirror" , osg::Texture::MIRROR}
{"mirror" , osg::Texture::MIRROR},
}};
constexpr std::array<std::pair<std::string_view, osg::Texture::FilterMode>, 6> FilterMode = {{
@ -96,7 +96,7 @@ namespace fx
{"linear_mipmap_nearest" , osg::Texture::LINEAR_MIPMAP_NEAREST},
{"nearest" , osg::Texture::NEAREST},
{"nearest_mipmap_linear" , osg::Texture::NEAREST_MIPMAP_LINEAR},
{"nearest_mipmap_nearest", osg::Texture::NEAREST_MIPMAP_NEAREST}
{"nearest_mipmap_nearest", osg::Texture::NEAREST_MIPMAP_NEAREST},
}};
constexpr std::array<std::pair<std::string_view, osg::BlendFunc::BlendFuncMode>, 15> BlendFunc = {{
@ -114,7 +114,7 @@ namespace fx
{"one_minus_constant_color" , osg::BlendFunc::ONE_MINUS_CONSTANT_COLOR},
{"constant_alpha" , osg::BlendFunc::CONSTANT_ALPHA},
{"one_minus_constant_alpha" , osg::BlendFunc::ONE_MINUS_CONSTANT_ALPHA},
{"zero" , osg::BlendFunc::ZERO}
{"zero" , osg::BlendFunc::ZERO},
}};
constexpr std::array<std::pair<std::string_view, osg::BlendEquation::Equation>, 8> BlendEquation = {{
@ -125,7 +125,7 @@ namespace fx
{"logic_op" , osg::BlendEquation::LOGIC_OP},
{"add" , osg::BlendEquation::FUNC_ADD},
{"subtract" , osg::BlendEquation::FUNC_SUBTRACT},
{"reverse_subtract" , osg::BlendEquation::FUNC_REVERSE_SUBTRACT}
{"reverse_subtract" , osg::BlendEquation::FUNC_REVERSE_SUBTRACT},
}};
}
}

File diff suppressed because it is too large Load Diff

@ -1,11 +0,0 @@
#ifndef OPENMW_COMPONENTS_MISC_ERRORMARKER_H
#define OPENMW_COMPONENTS_MISC_ERRORMARKER_H
#include <string>
namespace Misc
{
extern const std::string errorMarker;
}
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
#ifndef OPENMW_COMPONENTS_RESOURCE_ERRORMARKER_H
#define OPENMW_COMPONENTS_RESOURCE_ERRORMARKER_H
#include <string_view>
namespace Resource
{
struct ErrorMarker
{
static const std::string_view sValue;
};
}
#endif

@ -28,7 +28,6 @@
#include <components/misc/pathhelpers.hpp>
#include <components/misc/strings/algorithm.hpp>
#include <components/misc/algorithm.hpp>
#include <components/misc/errorMarker.hpp>
#include <components/misc/osguservalues.hpp>
#include <components/vfs/manager.hpp>
@ -53,6 +52,7 @@
#include "imagemanager.hpp"
#include "niffilemanager.hpp"
#include "objectcache.hpp"
#include "errormarker.hpp"
namespace
{
@ -759,7 +759,7 @@ namespace Resource
if (mVFS->exists(normalized))
return load(normalized, mVFS, mImageManager, mNifFileManager);
}
Files::IMemStream file(Misc::errorMarker.data(), Misc::errorMarker.size());
Files::IMemStream file(ErrorMarker::sValue.data(), ErrorMarker::sValue.size());
return loadNonNif("error_marker.osgt", file, mImageManager);
}();

@ -42,127 +42,159 @@ using namespace SceneUtil;
// fragment shader
//
#if 0
static const char fragmentShaderSource_withBaseTexture[] =
"uniform sampler2D baseTexture; \n"
"uniform sampler2DShadow shadowTexture; \n"
" \n"
"void main(void) \n"
"{ \n"
" vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n"
" vec4 color = texture2D( baseTexture, gl_TexCoord[0].xy ); \n"
" color *= mix( colorAmbientEmissive, gl_Color, shadow2DProj( shadowTexture, gl_TexCoord[1] ).r ); \n"
" gl_FragColor = color; \n"
"} \n";
const std::string fragmentShaderSource_withBaseTexture = R"glsl(
uniform sampler2D baseTexture;
uniform sampler2DShadow shadowTexture;
void main(void)
{
vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor;
vec4 color = texture2D( baseTexture, gl_TexCoord[0].xy );
color *= mix( colorAmbientEmissive, gl_Color, shadow2DProj( shadowTexture, gl_TexCoord[1] ).r );
gl_FragColor = color;
}
)glsl";
#else
static const char fragmentShaderSource_withBaseTexture[] =
"uniform sampler2D baseTexture; \n"
"uniform int baseTextureUnit; \n"
"uniform sampler2DShadow shadowTexture0; \n"
"uniform int shadowTextureUnit0; \n"
" \n"
"void main(void) \n"
"{ \n"
" vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n"
" vec4 color = texture2D( baseTexture, gl_TexCoord[baseTextureUnit].xy ); \n"
" color *= mix( colorAmbientEmissive, gl_Color, shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r ); \n"
" gl_FragColor = color; \n"
"} \n";
static const char fragmentShaderSource_withBaseTexture_twoShadowMaps[] =
"uniform sampler2D baseTexture; \n"
"uniform int baseTextureUnit; \n"
"uniform sampler2DShadow shadowTexture0; \n"
"uniform int shadowTextureUnit0; \n"
"uniform sampler2DShadow shadowTexture1; \n"
"uniform int shadowTextureUnit1; \n"
" \n"
"void main(void) \n"
"{ \n"
" vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n"
" vec4 color = texture2D( baseTexture, gl_TexCoord[baseTextureUnit].xy ); \n"
" float shadow0 = shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r; \n"
" float shadow1 = shadow2DProj( shadowTexture1, gl_TexCoord[shadowTextureUnit1] ).r; \n"
" color *= mix( colorAmbientEmissive, gl_Color, shadow0*shadow1 ); \n"
" gl_FragColor = color; \n"
"} \n";
const std::string fragmentShaderSource_withBaseTexture = R"glsl(
uniform sampler2D baseTexture;
uniform int baseTextureUnit;
uniform sampler2DShadow shadowTexture0;
uniform int shadowTextureUnit0;
void main(void)
{
vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor;
vec4 color = texture2D( baseTexture, gl_TexCoord[baseTextureUnit].xy );
color *= mix( colorAmbientEmissive, gl_Color, shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r );
gl_FragColor = color;
}
)glsl";
const std::string fragmentShaderSource_withBaseTexture_twoShadowMaps = R"glsl(
uniform sampler2D baseTexture;
uniform int baseTextureUnit;
uniform sampler2DShadow shadowTexture0;
uniform int shadowTextureUnit0;
uniform sampler2DShadow shadowTexture1;
uniform int shadowTextureUnit1;
void main(void)
{
vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor;
vec4 color = texture2D( baseTexture, gl_TexCoord[baseTextureUnit].xy );
float shadow0 = shadow2DProj( shadowTexture0, gl_TexCoord[shadowTextureUnit0] ).r;
float shadow1 = shadow2DProj( shadowTexture1, gl_TexCoord[shadowTextureUnit1] ).r;
color *= mix( colorAmbientEmissive, gl_Color, shadow0*shadow1 );
gl_FragColor = color;
}
)glsl";
#endif
std::string debugVertexShaderSource = "void main(void){gl_Position = gl_Vertex; gl_TexCoord[0]=gl_MultiTexCoord0;}";
std::string debugFragmentShaderSource =
"uniform sampler2D texture; \n"
" \n"
"void main(void) \n"
"{ \n"
const std::string debugVertexShaderSource = R"glsl(
void main(void)
{
gl_Position = gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
)glsl";
const std::string debugFragmentShaderSource = R"glsl(
uniform sampler2D texture;
void main(void)
{
)glsl"
#if 1
" float f = texture2D(texture, gl_TexCoord[0].xy).r; \n"
" \n"
" f = 256.0 * f; \n"
" float fC = floor( f ) / 256.0; \n"
" \n"
" f = 256.0 * fract( f ); \n"
" float fS = floor( f ) / 256.0; \n"
" \n"
" f = 256.0 * fract( f ); \n"
" float fH = floor( f ) / 256.0; \n"
" \n"
" fS *= 0.5; \n"
" fH = ( fH * 0.34 + 0.66 ) * ( 1.0 - fS ); \n"
" \n"
" vec3 rgb = vec3( ( fC > 0.5 ? ( 1.0 - fC ) : fC ), \n"
" abs( fC - 0.333333 ), \n"
" abs( fC - 0.666667 ) ); \n"
" \n"
" rgb = min( vec3( 1.0, 1.0, 1.0 ), 3.0 * rgb ); \n"
" \n"
" float fMax = max( max( rgb.r, rgb.g ), rgb.b ); \n"
" fMax = 1.0 / fMax; \n"
" \n"
" vec3 color = fMax * rgb; \n"
" \n"
" gl_FragColor = vec4( fS + fH * color, 1 ); \n"
R"glsl(
float f = texture2D(texture, gl_TexCoord[0].xy).r;
f = 256.0 * f;
float fC = floor( f ) / 256.0;
f = 256.0 * fract( f );
float fS = floor( f ) / 256.0;
f = 256.0 * fract( f );
float fH = floor( f ) / 256.0;
fS *= 0.5;
fH = ( fH * 0.34 + 0.66 ) * ( 1.0 - fS );
vec3 rgb = vec3( ( fC > 0.5 ? ( 1.0 - fC ) : fC ),
abs( fC - 0.333333 ),
abs( fC - 0.666667 ) );
rgb = min( vec3( 1.0, 1.0, 1.0 ), 3.0 * rgb );
float fMax = max( max( rgb.r, rgb.g ), rgb.b );
fMax = 1.0 / fMax;
vec3 color = fMax * rgb;
gl_FragColor = vec4( fS + fH * color, 1 );
)glsl"
#else
" gl_FragColor = texture2D(texture, gl_TexCoord[0].xy); \n"
R"glsl(
gl_FragColor = texture2D(texture, gl_TexCoord[0].xy);
)glsl"
#endif
"} \n";
std::string debugFrustumVertexShaderSource = "varying float depth; uniform mat4 transform; void main(void){gl_Position = transform * gl_Vertex; depth = gl_Position.z / gl_Position.w;}";
std::string debugFrustumFragmentShaderSource =
"varying float depth; \n"
" \n"
"void main(void) \n"
"{ \n"
R"glsl(
}
)glsl";
const std::string debugFrustumVertexShaderSource = R"glsl(
varying float depth;
uniform mat4 transform;
void main(void)
{
gl_Position = transform * gl_Vertex;
depth = gl_Position.z / gl_Position.w;
}
)glsl";
const std::string debugFrustumFragmentShaderSource = R"glsl(
varying float depth;
void main(void)
{
)glsl"
#if 1
" float f = depth; \n"
" \n"
" f = 256.0 * f; \n"
" float fC = floor( f ) / 256.0; \n"
" \n"
" f = 256.0 * fract( f ); \n"
" float fS = floor( f ) / 256.0; \n"
" \n"
" f = 256.0 * fract( f ); \n"
" float fH = floor( f ) / 256.0; \n"
" \n"
" fS *= 0.5; \n"
" fH = ( fH * 0.34 + 0.66 ) * ( 1.0 - fS ); \n"
" \n"
" vec3 rgb = vec3( ( fC > 0.5 ? ( 1.0 - fC ) : fC ), \n"
" abs( fC - 0.333333 ), \n"
" abs( fC - 0.666667 ) ); \n"
" \n"
" rgb = min( vec3( 1.0, 1.0, 1.0 ), 3.0 * rgb ); \n"
" \n"
" float fMax = max( max( rgb.r, rgb.g ), rgb.b ); \n"
" fMax = 1.0 / fMax; \n"
" \n"
" vec3 color = fMax * rgb; \n"
" \n"
" gl_FragColor = vec4( fS + fH * color, 1 ); \n"
R"glsl(
float f = depth;
f = 256.0 * f;
float fC = floor( f ) / 256.0;
f = 256.0 * fract( f );
float fS = floor( f ) / 256.0;
f = 256.0 * fract( f );
float fH = floor( f ) / 256.0;
fS *= 0.5;
fH = ( fH * 0.34 + 0.66 ) * ( 1.0 - fS );
vec3 rgb = vec3( ( fC > 0.5 ? ( 1.0 - fC ) : fC ),
abs( fC - 0.333333 ),
abs( fC - 0.666667 ) );
rgb = min( vec3( 1.0, 1.0, 1.0 ), 3.0 * rgb );
float fMax = max( max( rgb.r, rgb.g ), rgb.b );
fMax = 1.0 / fMax;
vec3 color = fMax * rgb;
gl_FragColor = vec4( fS + fH * color, 1 );
)glsl"
#else
" gl_FragColor = vec4(0.0, 0.0, 1.0, 0.0); \n"
R"glsl(
gl_FragColor = vec4(0.0, 0.0, 1.0, 0.0);
)glsl"
#endif
"} \n";
R"glsl(
}
)glsl";
template<class T>
class RenderLeafTraverser : public T

Loading…
Cancel
Save