2
0
AlexVinS 11 жил өмнө
parent
commit
7b75b19d1a
1 өөрчлөгдсөн 7 нэмэгдсэн , 3 устгасан
  1. 7 3
      client/Graphics.cpp

+ 7 - 3
client/Graphics.cpp

@@ -265,9 +265,13 @@ void Graphics::loadHeroFlagsDetail(std::pair<std::vector<CDefEssential *> Graphi
 		}
 		for(auto & curImg : curImgs)
 		{
-			SDL_SetColorKey(curImg.bitmap, SDL_SRCCOLORKEY,
-				SDL_MapRGB(curImg.bitmap->format, 0, 255, 255)
-				);
+			#ifdef VCMI_SDL1
+			uint32_t key = SDL_MapRGB(curImg.bitmap->format, 0, 255, 255); 
+			#else
+			uint32_t key = SDL_MapRGBA(curImg.bitmap->format, 0, 255, 255, 0); 
+			#endif
+						
+			SDL_SetColorKey(curImg.bitmap, SDL_SRCCOLORKEY, key);
 			#ifndef VCMI_SDL1
 			SDL_SetSurfaceBlendMode(curImg.bitmap,SDL_BLENDMODE_NONE);
 			#endif