Commit 6f98c350 authored by Sunny Sachanandani's avatar Sunny Sachanandani

Xrender uses 16 bit color per channel. Fixed the color handling in...

Xrender uses 16 bit color per channel. Fixed the color handling in X11_RenderFillRects to match this. Xrender just works now for filling rectangles :D .
parent b4651b2a
...@@ -1001,10 +1001,10 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) ...@@ -1001,10 +1001,10 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
if(data->xrender_available == SDL_TRUE) if(data->xrender_available == SDL_TRUE)
{ {
XRenderColor xrender_foreground_color; XRenderColor xrender_foreground_color;
xrender_foreground_color.red = renderer->r; xrender_foreground_color.red = (unsigned short) ((renderer->r / 255.0) * 0xFFFF);
xrender_foreground_color.green = renderer->g; xrender_foreground_color.green = (unsigned short) ((renderer->g / 255.0) * 0xFFFF);
xrender_foreground_color.blue = renderer->b; xrender_foreground_color.blue = (unsigned short) ((renderer->b / 255.0) * 0xFFFF);
xrender_foreground_color.alpha = renderer->a; xrender_foreground_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF);
XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
&xrender_foreground_color, xrects, xcount); &xrender_foreground_color, xrects, xcount);
} }
......
Markdown is supported
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