mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-06 04:04:53 +01:00
Fix overlay when avatar images are not configured.
(Otherwise, we'll crash after generating too many images.)
This commit is contained in:
parent
4083408bcb
commit
9f4cc05f2a
5 changed files with 101 additions and 39 deletions
|
|
@ -1465,14 +1465,26 @@ int LoadWindowsFontFromMem(const LOGFONT *lf)
|
|||
} else {
|
||||
PRINT_DEBUG("%s %s. otmfsType data: %d.\n", "Licensing failure. Cannot use font", lf->lfFaceName, metric->otmfsType);
|
||||
}
|
||||
} else {
|
||||
PRINT_DEBUG("%s %s.\n",
|
||||
"Steam_Overlay::LoadWindowsFontFromMem GetOutlineTextMetrics() (fill font metric struct) failed for",
|
||||
lf->lfFaceName);
|
||||
}
|
||||
|
||||
free(metric);
|
||||
metric = NULL;
|
||||
}
|
||||
} else {
|
||||
PRINT_DEBUG("%s %s.\n",
|
||||
"Steam_Overlay::LoadWindowsFontFromMem GetOutlineTextMetrics() (get struct size) failed for",
|
||||
lf->lfFaceName);
|
||||
}
|
||||
SelectObject(CBSTR.hDevice, oldFont);
|
||||
DeleteObject(hFont);
|
||||
} else {
|
||||
PRINT_DEBUG("%s %s.\n",
|
||||
"Steam_Overlay::LoadWindowsFontFromMem CreateFontIndirect() failed for",
|
||||
lf->lfFaceName);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
@ -1693,7 +1705,7 @@ void Steam_Overlay::CreateFonts()
|
|||
|
||||
DeleteDC(CBSTR.hDevice); // Order is important.
|
||||
DeleteObject(hBitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
ReleaseDC(oWND, oDC);
|
||||
#else
|
||||
|
|
@ -2099,7 +2111,7 @@ int Steam_Overlay::display_imgui_image(uint32_t displayImageType,
|
|||
"for user",
|
||||
userID.ConvertToUint64(),
|
||||
". Load OK.");
|
||||
} else{
|
||||
} else {
|
||||
PRINT_DEBUG("%s %d %s %" PRIu64 " %s\n",
|
||||
"Steam_Overlay::display_imgui_image Unable to get avatar image size",
|
||||
eAvatarSize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue