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/Xbox/Font/XUI_FontData.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/Xbox/Font/XUI_FontData.cpp')
| -rw-r--r-- | Minecraft.Client/Xbox/Font/XUI_FontData.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.Client/Xbox/Font/XUI_FontData.cpp b/Minecraft.Client/Xbox/Font/XUI_FontData.cpp index 7a70cdfb..88d77d09 100644 --- a/Minecraft.Client/Xbox/Font/XUI_FontData.cpp +++ b/Minecraft.Client/Xbox/Font/XUI_FontData.cpp @@ -68,7 +68,7 @@ float XUI_FontData::SChar::getMinX() float XUI_FontData::SChar::getMaxX() { - return (float) m_parent->m_fontData->getFontData()->m_uiGlyphWidth; + return static_cast<float>(m_parent->m_fontData->getFontData()->m_uiGlyphWidth); } float XUI_FontData::SChar::getMinY() @@ -83,7 +83,7 @@ float XUI_FontData::SChar::getMaxY() float XUI_FontData::SChar::getAdvance() { - return (float) m_parent->m_fontData->getWidth(m_glyphId); + return static_cast<float>(m_parent->m_fontData->getWidth(m_glyphId)); } int XUI_FontData::SChar::getGlyphId() @@ -157,11 +157,11 @@ XUI_FontData::SChar XUI_FontData::getChar(const wchar_t strChar) //-------------------------------------------------------------------------------------- XUI_FontData::XUI_FontData() { - m_pFontTexture = NULL; + m_pFontTexture = nullptr; m_iFontTexture = -1; m_dwNumGlyphs = 0L; - m_Glyphs = NULL; + m_Glyphs = nullptr; m_cMaxGlyph = 0; @@ -201,12 +201,12 @@ HRESULT XUI_FontData::Create( SFontData &sfontdata ) m_fontData = new CFontData( sfontdata, rawPixels.data ); - if (rawPixels.data != NULL) delete [] rawPixels.data; + if (rawPixels.data != nullptr) delete [] rawPixels.data; #if 0 { // 4J-JEV: Load in FontData (ABC) file, and initialize member variables from it. - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(nullptr); //wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/font/Mojangles_10.abc"); wsprintfW(szResourceLocator,L"section://%X,%s#%s%s%s",c_ModuleHandle,L"media", L"media/font/",strFontFileName.c_str(),L".abc"); @@ -349,7 +349,7 @@ HRESULT XUI_FontData::Create( int iFontTexture, const VOID* pFontData ) //-------------------------------------------------------------------------------------- VOID XUI_FontData::Destroy() { - if(m_pFontTexture!=NULL) + if(m_pFontTexture!=nullptr) { m_pFontTexture->Release(); delete m_pFontTexture; @@ -357,7 +357,7 @@ VOID XUI_FontData::Destroy() m_fontData->release(); - m_pFontTexture = NULL; + m_pFontTexture = nullptr; m_dwNumGlyphs = 0L; m_cMaxGlyph = 0; |
