mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-07 02:30:25 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -18,41 +18,44 @@ namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
void COpenGL3ExtensionHandler::initExtensionsOld()
|
||||
{
|
||||
auto extensions_string = reinterpret_cast<const char *>(GL.GetString(GL_EXTENSIONS));
|
||||
const char *pos = extensions_string;
|
||||
while (const char *next = strchr(pos, ' ')) {
|
||||
addExtension(std::string{pos, next});
|
||||
pos = next + 1;
|
||||
}
|
||||
addExtension(pos);
|
||||
extensionsLoaded();
|
||||
void COpenGL3ExtensionHandler::initExtensionsOld()
|
||||
{
|
||||
auto extensions_string = reinterpret_cast<const char *>(GL.GetString(GL_EXTENSIONS));
|
||||
const char *pos = extensions_string;
|
||||
while (const char *next = strchr(pos, ' ')) {
|
||||
addExtension(std::string{pos, next});
|
||||
pos = next + 1;
|
||||
}
|
||||
addExtension(pos);
|
||||
extensionsLoaded();
|
||||
}
|
||||
|
||||
void COpenGL3ExtensionHandler::initExtensionsNew()
|
||||
{
|
||||
int ext_count = GetInteger(GL_NUM_EXTENSIONS);
|
||||
for (int k = 0; k < ext_count; k++)
|
||||
addExtension(reinterpret_cast<const char *>(GL.GetStringi(GL_EXTENSIONS, k)));
|
||||
extensionsLoaded();
|
||||
}
|
||||
void COpenGL3ExtensionHandler::initExtensionsNew()
|
||||
{
|
||||
int ext_count = GetInteger(GL_NUM_EXTENSIONS);
|
||||
for (int k = 0; k < ext_count; k++)
|
||||
addExtension(reinterpret_cast<const char *>(GL.GetStringi(GL_EXTENSIONS, k)));
|
||||
extensionsLoaded();
|
||||
}
|
||||
|
||||
void COpenGL3ExtensionHandler::addExtension(std::string &&name) {
|
||||
Extensions.emplace(std::move(name));
|
||||
}
|
||||
void COpenGL3ExtensionHandler::addExtension(std::string &&name)
|
||||
{
|
||||
Extensions.emplace(std::move(name));
|
||||
}
|
||||
|
||||
bool COpenGL3ExtensionHandler::queryExtension(const std::string &name) const noexcept {
|
||||
return Extensions.find(name) != Extensions.end();
|
||||
}
|
||||
bool COpenGL3ExtensionHandler::queryExtension(const std::string &name) const noexcept
|
||||
{
|
||||
return Extensions.find(name) != Extensions.end();
|
||||
}
|
||||
|
||||
void COpenGL3ExtensionHandler::extensionsLoaded() {
|
||||
os::Printer::log((std::string("Loaded ") + std::to_string(Extensions.size()) + " extensions:").c_str(), ELL_DEBUG);
|
||||
for (const auto &it : Extensions)
|
||||
os::Printer::log((std::string(" ") + it).c_str(), ELL_DEBUG);
|
||||
for (size_t j = 0; j < IRR_OGLES_Feature_Count; ++j)
|
||||
FeatureAvailable[j] = queryExtension(getFeatureString(j));
|
||||
}
|
||||
void COpenGL3ExtensionHandler::extensionsLoaded()
|
||||
{
|
||||
os::Printer::log((std::string("Loaded ") + std::to_string(Extensions.size()) + " extensions:").c_str(), ELL_DEBUG);
|
||||
for (const auto &it : Extensions)
|
||||
os::Printer::log((std::string(" ") + it).c_str(), ELL_DEBUG);
|
||||
for (size_t j = 0; j < IRR_OGLES_Feature_Count; ++j)
|
||||
FeatureAvailable[j] = queryExtension(getFeatureString(j));
|
||||
}
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user