splash screen patches (from <Someone>)
- Show splash on "Help - About" with all version information - Show splash with news on startup (if show_splash is on of course). I made another small patch to the splash screen. Because the greenish background colour always seemed a little odd to me, I decided to make it transparent. Doing that, I found the following: - The splash picture was a 24-bit bitmap, although it had less than 256 colours. That makes the size of the final executable about 200K larger than necessary. I changed it to a 256-colour bitmap. I also changed the background colour to the default tile background colour, for consistency. The new bitmap is attached here. My excuses if the large file means a problem to anyone. - In Microsoft's documentation (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_2y9g.asp) is is stated that on Windows 95/98 "TransparentBlt contains a memory leak that can exhaust system resources." It is recommended to use different code to draw transparent bitmaps, to be precise: the alternative code that is already in nhapply_image_transparent(). I'm almost convinced that this is the cause for Betabug B08008 reported bij <Someone>. Can anyone confirm he is using 95/98? I decided for the easy way out and removed the code that uses TransparentBlt completely. I see not much reason to use it if it is a) buggy and b) we have an alternative that works perfectly. This is attached as trans.patch. - The rest of the patch only changes the BitBlt() in mhsplash.c to a nhapply_image_transparent().
This commit is contained in:
@@ -898,26 +898,7 @@ void nhapply_image_transparent(
|
||||
COLORREF cTransparent
|
||||
)
|
||||
{
|
||||
static BOOL MSIInit = FALSE;
|
||||
static HMODULE hMSIModule = NULL;
|
||||
static LPTRANSPARENTBLT pTransparentBlt = NULL;
|
||||
|
||||
if( !MSIInit ) {
|
||||
MSIInit = TRUE;
|
||||
hMSIModule = LoadLibrary(_T("Msimg32.dll"));
|
||||
if (hMSIModule) {
|
||||
pTransparentBlt = (LPTRANSPARENTBLT) GetProcAddress(hMSIModule, "TransparentBlt");
|
||||
}
|
||||
}
|
||||
|
||||
if ( pTransparentBlt )
|
||||
{
|
||||
(*pTransparentBlt)(
|
||||
hDC, x, y, width, height,
|
||||
sourceDC, s_x, s_y, s_width, s_height,
|
||||
cTransparent
|
||||
);
|
||||
} else {
|
||||
/* Don't use TransparentBlt; According to Microsoft, it contains a memory leak in Window 95/98. */
|
||||
HDC hdcMem, hdcBack, hdcObject, hdcSave;
|
||||
COLORREF cColor;
|
||||
HBITMAP bmAndBack, bmAndObject, bmAndMem, bmSave;
|
||||
@@ -992,5 +973,4 @@ void nhapply_image_transparent(
|
||||
DeleteDC(hdcBack);
|
||||
DeleteDC(hdcObject);
|
||||
DeleteDC(hdcSave);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user