Commit 93b4c828 authored by Camilla Berglund's avatar Camilla Berglund
Browse files

Fix VC++ build failure

Regression caused by 71c72db1.
parent 165171f9
......@@ -233,13 +233,6 @@ typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const c
y = t; \
}
// Helper for non-premultiplied alpha to premultiplied alpha conversion
static inline unsigned char _glfwMultiplyAlpha(unsigned char alpha,
unsigned char value)
{
return (unsigned char) ((value * (unsigned int) alpha) / 255);
}
//========================================================================
// Platform-independent structures
......
......@@ -588,12 +588,12 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
unsigned char* target = data;
for (i = 0; i < image->width * image->height; i++, source += 4)
{
unsigned char alpha = source[3];
unsigned int alpha = source[3];
*target++ = _glfwMultiplyAlpha(alpha, source[2]);
*target++ = _glfwMultiplyAlpha(alpha, source[1]);
*target++ = _glfwMultiplyAlpha(alpha, source[0]);
*target++ = alpha;
*target++ = (unsigned char) ((source[2] * alpha) / 255);
*target++ = (unsigned char) ((source[1] * alpha) / 255);
*target++ = (unsigned char) ((source[0] * alpha) / 255);
*target++ = (unsigned char) alpha;
}
cursor->wl.buffer =
......
......@@ -690,12 +690,12 @@ Cursor _glfwCreateCursorX11(const GLFWimage* image, int xhot, int yhot)
for (i = 0; i < image->width * image->height; i++, target++, source += 4)
{
unsigned char alpha = source[3];
unsigned int alpha = source[3];
*target = (alpha << 24) |
(_glfwMultiplyAlpha(alpha, source[0]) << 16) |
(_glfwMultiplyAlpha(alpha, source[1]) << 8) |
_glfwMultiplyAlpha(alpha, source[2]);
((unsigned char) ((source[0] * alpha) / 255) << 16) |
((unsigned char) ((source[1] * alpha) / 255) << 8) |
((unsigned char) ((source[2] * alpha) / 255) << 0);
}
cursor = XcursorImageLoadCursor(_glfw.x11.display, native);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment