Page 1 of 1

Black trace when moving around map in sdl2 client

Posted: Thu Feb 11, 2021 9:49 pm
by goduck777
I have a question about the SDL2 client. Most of the functions work fine, but an annoying issue is that, when I move around the map using right click, the country border and the city name will have black trace on top of it left, and finally become totally dark. It can recover if I move to a different region and then move back (refresh it?).

I remember I had this problem before in an older version, but it seems to be fixed in the Qt version. I wonder if this is a known issue in SDL2 version.

Version 2.6.3

Re: Black trace when moving around map in sdl2 client

Posted: Wed Feb 17, 2021 6:45 am
by goduck777
I found a fix for this bug. It seems to be related to a SDL bug though.

Code: Select all

diff -Naur a/client/gui-sdl2/canvas.c b/client/gui-sdl2/canvas.c
--- a/client/gui-sdl2/canvas.c> 2021-02-17 01:10:17.597121668 -0500
+++ b/client/gui-sdl2/canvas.c> 2021-02-17 01:10:37.549121428 -0500
@@ -91,6 +91,7 @@
   SDL_Rect src_rect = {src_x, src_y, width, height};
   SDL_Rect dest_rect = {dest_x, dest_y, width, height};
-
+  SDL_SetSurfaceBlendMode(src->surf, SDL_BLENDMODE_NONE);
   alphablit(src->surf, &src_rect, dest->surf, &dest_rect, 255);
 }
Can someone please help test it and merge it to the repository?