Commit 08767009 authored by Maxime Bellengé's avatar Maxime Bellengé Committed by Alexandre Julliard

Make the icon choice algorithm really choose the best icon.

parent b47e54d2
...@@ -281,20 +281,16 @@ static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, const char *szXPMFile ...@@ -281,20 +281,16 @@ static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, const char *szXPMFile
{ {
if ((pIconDir->idEntries[i].wBitCount >= nMaxBits) && (pIconDir->idEntries[i].wBitCount <= 8)) if ((pIconDir->idEntries[i].wBitCount >= nMaxBits) && (pIconDir->idEntries[i].wBitCount <= 8))
{ {
if (pIconDir->idEntries[i].wBitCount > nMaxBits)
{
nMaxBits = pIconDir->idEntries[i].wBitCount; nMaxBits = pIconDir->idEntries[i].wBitCount;
nMax = 0;
}
}
if ((pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth) > nMax) if ((pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth) >= nMax)
{ {
lpName = MAKEINTRESOURCEW(pIconDir->idEntries[i].nID); lpName = MAKEINTRESOURCEW(pIconDir->idEntries[i].nID);
nMax = pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth; nMax = pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth;
} }
} }
} }
}
FreeResource(hResData); FreeResource(hResData);
} }
......
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