Remove unnecessary parentheses
This commit is contained in:
parent
37575e4ed7
commit
62c376ffa5
@ -420,7 +420,7 @@ Image Texture::copyToImage() const
|
|||||||
// Handle the case where source pixels are flipped vertically
|
// Handle the case where source pixels are flipped vertically
|
||||||
if (m_pixelsFlipped)
|
if (m_pixelsFlipped)
|
||||||
{
|
{
|
||||||
src += static_cast<unsigned int>(srcPitch * static_cast<int>((m_size.y - 1)));
|
src += static_cast<unsigned int>(srcPitch * static_cast<int>(m_size.y - 1));
|
||||||
srcPitch = -srcPitch;
|
srcPitch = -srcPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,19 +73,19 @@ termios newTerminalConfig, oldTerminalConfig; // Terminal configurations
|
|||||||
|
|
||||||
bool altDown()
|
bool altDown()
|
||||||
{
|
{
|
||||||
return (keyMap[sf::Keyboard::LAlt] || keyMap[sf::Keyboard::RAlt]);
|
return keyMap[sf::Keyboard::LAlt] || keyMap[sf::Keyboard::RAlt];
|
||||||
}
|
}
|
||||||
bool controlDown()
|
bool controlDown()
|
||||||
{
|
{
|
||||||
return (keyMap[sf::Keyboard::LControl] || keyMap[sf::Keyboard::RControl]);
|
return keyMap[sf::Keyboard::LControl] || keyMap[sf::Keyboard::RControl];
|
||||||
}
|
}
|
||||||
bool shiftDown()
|
bool shiftDown()
|
||||||
{
|
{
|
||||||
return (keyMap[sf::Keyboard::LShift] || keyMap[sf::Keyboard::RShift]);
|
return keyMap[sf::Keyboard::LShift] || keyMap[sf::Keyboard::RShift];
|
||||||
}
|
}
|
||||||
bool systemDown()
|
bool systemDown()
|
||||||
{
|
{
|
||||||
return (keyMap[sf::Keyboard::LSystem] || keyMap[sf::Keyboard::RSystem]);
|
return keyMap[sf::Keyboard::LSystem] || keyMap[sf::Keyboard::RSystem];
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitFileDescriptors()
|
void uninitFileDescriptors()
|
||||||
|
@ -238,7 +238,7 @@ bool EglContext::makeCurrent(bool current)
|
|||||||
eglCheck(result = eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
|
eglCheck(result = eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (result != EGL_FALSE);
|
return result != EGL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ struct VulkanLibraryWrapper
|
|||||||
{
|
{
|
||||||
entryPoint = reinterpret_cast<T>(dlsym(library, name));
|
entryPoint = reinterpret_cast<T>(dlsym(library, name));
|
||||||
|
|
||||||
return (entryPoint != nullptr);
|
return entryPoint != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* library{};
|
void* library{};
|
||||||
|
@ -1229,7 +1229,7 @@ bool WindowImplX11::hasFocus() const
|
|||||||
int revertToReturn = 0;
|
int revertToReturn = 0;
|
||||||
XGetInputFocus(m_display, &focusedWindow, &revertToReturn);
|
XGetInputFocus(m_display, &focusedWindow, &revertToReturn);
|
||||||
|
|
||||||
return (m_window == focusedWindow);
|
return m_window == focusedWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ struct VulkanLibraryWrapper
|
|||||||
{
|
{
|
||||||
entryPoint = reinterpret_cast<T>(reinterpret_cast<void*>(GetProcAddress(library, name)));
|
entryPoint = reinterpret_cast<T>(reinterpret_cast<void*>(GetProcAddress(library, name)));
|
||||||
|
|
||||||
return (entryPoint != nullptr);
|
return entryPoint != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
HMODULE library{};
|
HMODULE library{};
|
||||||
@ -201,7 +201,7 @@ bool VulkanImplWin32::createVulkanSurface(const VkInstance& instance,
|
|||||||
surfaceCreateInfo.hinstance = GetModuleHandleA(nullptr);
|
surfaceCreateInfo.hinstance = GetModuleHandleA(nullptr);
|
||||||
surfaceCreateInfo.hwnd = windowHandle;
|
surfaceCreateInfo.hwnd = windowHandle;
|
||||||
|
|
||||||
return (vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS);
|
return vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sf::priv
|
} // namespace sf::priv
|
||||||
|
@ -207,8 +207,8 @@ std::vector<sf::Vector2i> touchPositions;
|
|||||||
- (bool)needsToFlipFrameForOrientation:(UIDeviceOrientation)orientation
|
- (bool)needsToFlipFrameForOrientation:(UIDeviceOrientation)orientation
|
||||||
{
|
{
|
||||||
sf::Vector2u size = self.sfWindow->getSize();
|
sf::Vector2u size = self.sfWindow->getSize();
|
||||||
return ((!UIDeviceOrientationIsLandscape(orientation) && size.x > size.y) ||
|
return (!UIDeviceOrientationIsLandscape(orientation) && size.x > size.y) ||
|
||||||
(UIDeviceOrientationIsLandscape(orientation) && size.y > size.x));
|
(UIDeviceOrientationIsLandscape(orientation) && size.y > size.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -113,7 +113,7 @@ GlFunctionPointer SFContext::getFunction(const char* name)
|
|||||||
if (!image)
|
if (!image)
|
||||||
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
|
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
|
||||||
|
|
||||||
return (image ? reinterpret_cast<GlFunctionPointer>(reinterpret_cast<intptr_t>(dlsym(image, name))) : nil);
|
return image ? reinterpret_cast<GlFunctionPointer>(reinterpret_cast<intptr_t>(dlsym(image, name))) : nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@
|
|||||||
else if ([[event characters] length] > 0)
|
else if ([[event characters] length] > 0)
|
||||||
{
|
{
|
||||||
unichar code = [[event characters] characterAtIndex:0];
|
unichar code = [[event characters] characterAtIndex:0];
|
||||||
return ((code < 0xF700) || (code > 0xF8FF));
|
return (code < 0xF700) || (code > 0xF8FF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -189,11 +189,11 @@ TEST_CASE("[Graphics] sf::Image")
|
|||||||
// Create the composited colour for via the alpha composite over operation
|
// Create the composited colour for via the alpha composite over operation
|
||||||
const auto a = static_cast<std::uint8_t>(source.a + (dest.a * (255 - source.a)) / 255);
|
const auto a = static_cast<std::uint8_t>(source.a + (dest.a * (255 - source.a)) / 255);
|
||||||
const auto r = static_cast<std::uint8_t>(
|
const auto r = static_cast<std::uint8_t>(
|
||||||
((source.r * source.a) + (((dest.r * dest.a) * (255 - source.a))) / 255) / a);
|
((source.r * source.a) + ((dest.r * dest.a) * (255 - source.a)) / 255) / a);
|
||||||
const auto g = static_cast<std::uint8_t>(
|
const auto g = static_cast<std::uint8_t>(
|
||||||
((source.g * source.a) + (((dest.g * dest.a) * (255 - source.a))) / 255) / a);
|
((source.g * source.a) + ((dest.g * dest.a) * (255 - source.a)) / 255) / a);
|
||||||
const auto b = static_cast<std::uint8_t>(
|
const auto b = static_cast<std::uint8_t>(
|
||||||
((source.b * source.a) + (((dest.b * dest.a) * (255 - source.a))) / 255) / a);
|
((source.b * source.a) + ((dest.b * dest.a) * (255 - source.a)) / 255) / a);
|
||||||
const sf::Color composite(r, g, b, a);
|
const sf::Color composite(r, g, b, a);
|
||||||
|
|
||||||
sf::Image image1;
|
sf::Image image1;
|
||||||
|
Loading…
Reference in New Issue
Block a user