I compile two binary in Linux MXE,and run both of them it Windows 10 x64. The x86 version seems run very slow in AI turn,almost keep 5 min+ when in week 2 ~ 3, take more time when day increase. But x64 version seems OK.
But both of my compile program contains a bug:some unit small icon contain light blue backgroup. some battle, like this:
May be my linux environment use the wrong image library to compile. I have no way to solve it. The daily x86 build is OK in this case. But x86 build AI is very slow too. Can daily build provide a windows x64 packge? After all the major windows system are x64. It will make bug less in x64 system.
I finally solve the blue background problem. The problem cause by MXE upgrade. MXE now upgrade SDL2 to 2.0.12 and SDL2_image to 2.0.5, while VCMI code coded in SDL 2.0.5-3 and 2.0.1-1.
The problem is in SDL_SetColorKey in a 8bit image with a palette. Both in .BMP file and .PNG file. I logged near SDL_SetColorKey, and ensured it was called properly. The reture code is 0, means it return successfully and SDL_GetColorKey return the right color key. But the transparent backgroup is still invalid.
I googled a lot, and finally find In newly SDL2 version. If palette color alpha is set, the SDL_SetColorKey is invalid. I still can not find where it set, but I make a trick to fix it in client/gui/SDL_Extensions.cpp 827 :
void CSDL_Ext::setDefaultColorKeyPresize(SDL_Surface * surface)
{
uint32_t key = mapColor(surface,Colors::DEFAULT_KEY_COLOR);
auto & color = surface->format->palette->colors[key];
// set color key only if exactly such color was found
if (color.r == Colors::DEFAULT_KEY_COLOR.r && color.g == Colors::DEFAULT_KEY_COLOR.g && color.b == Colors::DEFAULT_KEY_COLOR.b) {
SDL_SetColorKey(surface, SDL_TRUE, key);
+ surface->format->palette->colors[key].a = SDL_ALPHA_TRANSPARENT;
}
}
I recompile the VCMI and everything is OK, But I still do not know the essential reason. It remains to find out.