Closed PaHgoM closed 10 months ago
You should post your OS etc.
Windows 7 x64
This happens because the dialog checks if the image has these particular color indices. The images for these models were saved with the maximum number of colors available, so the number is actually 0. The check fails and the code ignores your color changes.
Affected code here: https://github.com/SamVanheer/GoldSourceRebuild/blob/d72ddae5516c7d6a0f11bd16915a126e3c9bdb27/src/GameUI/OptionsSubMultiplayer.cpp#L672
@mikela-valve please fix this
Since my link is no longer valid i'll explain the cause of this bug in detail.
The Multiplayer dialog will only perform a remap if enough colors are available in the bitmap palette.
It does this by checking the biClrUsed
field in the BITMAPINFO
structure it reads from the file:
LPBITMAPINFO* lpbmi = ...;
if ( lpbmi->bmiHeader.biClrUsed > 223 )
{
PaletteHueReplace(lpbmi->bmiColors, topcolor, 192, 223);
}
if ( lpbmi->bmiHeader.biClrUsed > 191 )
PaletteHueReplace(lpbmi->bmiColors, bottomcolor, 160, 191);
Now here's the problem: the BITMAPINFO spec states the following:
If biClrUsed is zero, the array contains the maximum number of colors for the given bitdepth; that is, 2^biBitCount colors.
The code needs to be updated to handle the value being 0.
The original version of this code can be found in the Alien Swarm SDK: https://github.com/Nican/swarm-sdk/blob/b86cc6c4a04095488da6fcde917542329dafd746/src/game/client/swarm/gameui/optionssubmultiplayer.cpp#L2457-L2459
This also includes the code to perform remapping so if you need the code for anything, there it is.
@mikela-valve seems like a very easy fix.
Looking forward to see this one fixed.
May be the bug comes from the image bitmap files and not from the game interface.
This guy has done modifications on the portrait image to make it work again : https://gamebanana.com/guis/35187
This fix should be included in a next release because it is useful to choose your personal color in deathmatch.
(a little disappointed to see that this bug is not resolved in 6 years because it was working in very old versions of half-life...)
May be the bug comes from the image bitmap files and not from the game interface.
This guy has done modifications on the portrait image to make it work again : https://gamebanana.com/guis/35187
This fix should be included in a next release because it is useful to choose your personal color in deathmatch.
(a little disappointed to see that this bug is not resolved in 6 years because it was working in very old versions of half-life...)
Well, thanks for the link with the fixed images, still it would be more easy to fix the code that handles it, because the .bmp images were never modified, Solokiller has pointed the solution.
2023, still not fixed.
Fixed in HL anniversary update, so I guess I can close this.
Player color sliders does not change the preview picture. Screenshot attached/ . I think this maybe in all GoldSrc games. Sorry for bad english. Upd: Sliders don't work in software mode too