Commit 874d192
authored
Avoid throwing in CGUIElement::SetFont when the font name is unknown (#4868)
#### Summary
Probe `CEGUI::FontManager::isFontPresent` before calling `setFont` in
`CGUIElement_Impl::SetFont`, so unknown font names return `false`
directly.
#### Motivation
Avoid an unnecessary throw on a hot path.
#### Checklist
* [x] Your code should follow the [coding
guidelines](https://wiki.multitheftauto.com/index.php?title=Coding_guidelines).
* [x] Smaller pull requests are easier to review. If your pull request
is beefy, your pull request should be reviewable commit-by-commit.1 parent fcce26d commit 874d192
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
401 | 407 | | |
402 | 408 | | |
403 | 409 | | |
| |||
0 commit comments