瀏覽代碼

Fixes color-keying after scaling bitmaps for world view display;

Fay 10 年之前
父節點
當前提交
1c6a7a923d
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      client/mapHandler.cpp

+ 2 - 0
client/mapHandler.cpp

@@ -1433,6 +1433,8 @@ SDL_Surface * CMapHandler::CMapCache::requestWorldViewCacheOrCreate(CMapHandler:
 		return cached;
 
 	auto scaled = CSDL_Ext::scaleSurfaceFast(fullSurface, fullSurface->w * scale, fullSurface->h * scale);
+	if (scaled->format && scaled->format->palette) // fix color keying, because SDL loses it at this point
+		CSDL_Ext::setColorKey(scaled, scaled->format->palette->colors[0]);
 	return cacheWorldViewEntry(type, key, scaled);
 }