diff options
| author | ModMaker101 <119018978+ModMaker101@users.noreply.github.com> | 2026-03-07 21:56:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-08 09:56:03 +0700 |
| commit | a9be52c41a02d207233199e98898fe7483d7e817 (patch) | |
| tree | 71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/Common/UI/UIBitmapFont.cpp | |
| parent | 1be5faaea781402e7de06b263eeca4c688b7712c (diff) | |
Project modernization (#630)
* Fixed boats falling and a TP glitch #266
* Replaced every C-style cast with C++ ones
* Replaced every C-style cast with C++ ones
* Fixed boats falling and a TP glitch #266
* Updated NULL to nullptr and fixing some type issues
* Modernized and fixed a few bugs
- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.
* Fixing more conflicts
* Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.Client/Common/UI/UIBitmapFont.cpp')
| -rw-r--r-- | Minecraft.Client/Common/UI/UIBitmapFont.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.Client/Common/UI/UIBitmapFont.cpp b/Minecraft.Client/Common/UI/UIBitmapFont.cpp index afc2b139..e9d110b7 100644 --- a/Minecraft.Client/Common/UI/UIBitmapFont.cpp +++ b/Minecraft.Client/Common/UI/UIBitmapFont.cpp @@ -53,42 +53,42 @@ void UIAbstractBitmapFont::registerFont() IggyFontMetrics * RADLINK UIAbstractBitmapFont::GetFontMetrics_Callback(void *user_context,IggyFontMetrics *metrics) { - return ((UIAbstractBitmapFont *) user_context)->GetFontMetrics(metrics); + return static_cast<UIAbstractBitmapFont *>(user_context)->GetFontMetrics(metrics); } S32 RADLINK UIAbstractBitmapFont::GetCodepointGlyph_Callback(void *user_context,U32 codepoint) { - return ((UIAbstractBitmapFont *) user_context)->GetCodepointGlyph(codepoint); + return static_cast<UIAbstractBitmapFont *>(user_context)->GetCodepointGlyph(codepoint); } IggyGlyphMetrics * RADLINK UIAbstractBitmapFont::GetGlyphMetrics_Callback(void *user_context,S32 glyph,IggyGlyphMetrics *metrics) { - return ((UIAbstractBitmapFont *) user_context)->GetGlyphMetrics(glyph,metrics); + return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphMetrics(glyph,metrics); } rrbool RADLINK UIAbstractBitmapFont::IsGlyphEmpty_Callback(void *user_context,S32 glyph) { - return ((UIAbstractBitmapFont *) user_context)->IsGlyphEmpty(glyph); + return static_cast<UIAbstractBitmapFont *>(user_context)->IsGlyphEmpty(glyph); } F32 RADLINK UIAbstractBitmapFont::GetKerningForGlyphPair_Callback(void *user_context,S32 first_glyph,S32 second_glyph) { - return ((UIAbstractBitmapFont *) user_context)->GetKerningForGlyphPair(first_glyph,second_glyph); + return static_cast<UIAbstractBitmapFont *>(user_context)->GetKerningForGlyphPair(first_glyph,second_glyph); } rrbool RADLINK UIAbstractBitmapFont::CanProvideBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale) { - return ((UIAbstractBitmapFont *) user_context)->CanProvideBitmap(glyph,pixel_scale); + return static_cast<UIAbstractBitmapFont *>(user_context)->CanProvideBitmap(glyph,pixel_scale); } rrbool RADLINK UIAbstractBitmapFont::GetGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap) { - return ((UIAbstractBitmapFont *) user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap); + return static_cast<UIAbstractBitmapFont *>(user_context)->GetGlyphBitmap(glyph,pixel_scale,bitmap); } void RADLINK UIAbstractBitmapFont::FreeGlyphBitmap_Callback(void *user_context,S32 glyph,F32 pixel_scale,IggyBitmapCharacter *bitmap) { - return ((UIAbstractBitmapFont *) user_context)->FreeGlyphBitmap(glyph,pixel_scale,bitmap); + return static_cast<UIAbstractBitmapFont *>(user_context)->FreeGlyphBitmap(glyph,pixel_scale,bitmap); } UIBitmapFont::UIBitmapFont( SFontData &sfontdata ) @@ -321,7 +321,7 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte // 4J-PB - this was chopping off the top of the characters, so accented ones were losing a couple of pixels at the top // DaveK has reduced the height of the accented capitalised characters, and we've dropped this from 0.65 to 0.64 - bitmap->top_left_y = -((S32) m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent; + bitmap->top_left_y = -static_cast<S32>(m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent; bitmap->oversample = 0; bitmap->point_sample = true; @@ -351,7 +351,7 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte bitmap->stride_in_bytes = m_cFontData->getFontData()->m_uiGlyphMapX; // 4J-JEV: Additional information needed to release memory afterwards. - bitmap->user_context_for_free = NULL; + bitmap->user_context_for_free = nullptr; return true; } |
