aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp')
-rw-r--r--Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp b/Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp
index f6619fd5..d708af79 100644
--- a/Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp
+++ b/Minecraft.Client/Xbox/Font/XUI_FontRenderer.cpp
@@ -36,7 +36,7 @@ VOID XUI_FontRenderer::Term()
HRESULT XUI_FontRenderer::GetCaps( DWORD * pdwCaps )
{
- if( pdwCaps != nullptr )
+ if( pdwCaps != NULL )
{
// setting this means XUI calls the DrawCharsToDevice method
*pdwCaps = XUI_FONT_RENDERER_CAP_INTERNAL_GLYPH_CACHE | XUI_FONT_RENDERER_CAP_POINT_SIZE_RESPECTED | XUI_FONT_RENDERER_STYLE_DROPSHADOW;
@@ -50,7 +50,7 @@ HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescri
//float fXuiSize = fPointSize * ( 16.0f / 16.0f );
fXuiSize /= 4.0f;
fXuiSize = floor( fXuiSize );
- int xuiSize = static_cast<int>(fXuiSize * 4.0f);
+ int xuiSize = (int)(fXuiSize * 4.0f);
if( xuiSize < 1 ) xuiSize = 8;
// 4J Stu - We have fonts based on multiples of 8 or 12
@@ -60,8 +60,8 @@ HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescri
//app.DebugPrintf("point size is: %f, xuiSize is: %d\n", fPointSize, xuiSize);
- XUI_Font *font = nullptr;
- XUI_FontData *fontData = nullptr;
+ XUI_Font *font = NULL;
+ XUI_FontData *fontData = NULL;
FLOAT scale = 1;
eFontData efontdata;
@@ -77,17 +77,17 @@ HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescri
}
font = m_loadedFonts[efontdata][scale];
- if (font == nullptr)
+ if (font == NULL)
{
fontData = m_loadedFontData[efontdata];
- if (fontData == nullptr)
+ if (fontData == NULL)
{
SFontData *sfontdata;
switch (efontdata)
{
case eFontData_Mojangles_7: sfontdata = &SFontData::Mojangles_7; break;
case eFontData_Mojangles_11: sfontdata = &SFontData::Mojangles_11; break;
- default: sfontdata = nullptr; break;
+ default: sfontdata = NULL; break;
}
fontData = new XUI_FontData();
@@ -101,14 +101,14 @@ HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescri
}
font->IncRefCount();
- *phFont = static_cast<HFONTOBJ>(font);
+ *phFont = (HFONTOBJ)font;
return S_OK;
}
VOID XUI_FontRenderer::ReleaseFont( HFONTOBJ hFont )
{
- XUI_Font *xuiFont = static_cast<XUI_Font *>(hFont);
- if (xuiFont != nullptr)
+ XUI_Font *xuiFont = (XUI_Font*) hFont;
+ if (xuiFont != NULL)
{
xuiFont->DecRefCount();
if (xuiFont->refCount <= 0)
@@ -125,7 +125,7 @@ HRESULT XUI_FontRenderer::GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontM
{
if( hFont == 0 || pFontMetrics == 0 ) return E_INVALIDARG;
- XUI_Font *font = static_cast<XUI_Font *>(hFont);
+ XUI_Font *font = (XUI_Font *)hFont;
pFontMetrics->fLineHeight = (font->m_fontData->getFontYAdvance() + 1) * font->m_fYScaleFactor;
pFontMetrics->fMaxAscent = font->m_fontData->getMaxAscent() * font->m_fYScaleFactor;
@@ -142,7 +142,7 @@ HRESULT XUI_FontRenderer::GetCharMetrics( HFONTOBJ hFont, WCHAR wch, XUICharMetr
{
if (hFont == 0 || pCharMetrics == 0) return E_INVALIDARG;
- XUI_Font *font = static_cast<XUI_Font *>(hFont);
+ XUI_Font *font = (XUI_Font *)hFont;
XUI_FontData::SChar sChar = font->m_fontData->getChar(wch);
pCharMetrics->fMinX = sChar.getMinX() * font->m_fYScaleFactor;
@@ -156,7 +156,7 @@ HRESULT XUI_FontRenderer::GetCharMetrics( HFONTOBJ hFont, WCHAR wch, XUICharMetr
HRESULT XUI_FontRenderer::DrawCharToTexture( HFONTOBJ hFont, WCHAR wch, HXUIDC hDC, IXuiTexture * pTexture, UINT x, UINT y, UINT width, UINT height, UINT insetX, UINT insetY )
{
- if( hFont==0 || pTexture==nullptr ) return E_INVALIDARG;
+ if( hFont==0 || pTexture==NULL ) return E_INVALIDARG;
return( S_OK );
}
@@ -169,7 +169,7 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat
DWORD SamplerStateA[5];
XMVECTOR vconsts[20];
XMVECTOR pconsts[20];
- XUI_Font *font = static_cast<XUI_Font *>(hFont);
+ XUI_Font *font = (XUI_Font *)hFont;
// 4J-PB - if we're in 480 Widescreen mode, we need to ensure that the font characters are aligned on an even boundary if they are a 2x multiple
if(!RenderManager.IsHiDef())
@@ -184,19 +184,19 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat
if(iScaleX%2==0)
{
int iWorldX=pWorldViewProj->_41;
- pWorldViewProj->_41 = static_cast<float>(iWorldX & -2);
+ pWorldViewProj->_41 = (float)(iWorldX & -2);
}
if(iScaleY%2==0)
{
int iWorldY=pWorldViewProj->_42;
- pWorldViewProj->_42 = static_cast<float>(iWorldY & -2);
+ pWorldViewProj->_42 = (float)(iWorldY & -2);
}
}
else
{
// make x an even number for 480 4:3
int iWorldX=pWorldViewProj->_41;
- pWorldViewProj->_41 = static_cast<float>(iWorldX & -2);
+ pWorldViewProj->_41 = (float)(iWorldX & -2);
// 480 SD mode - y needs to be on a pixel boundary when multiplied by 1.5, so if it's an odd number, subtract 1/3 from it
int iWorldY=pWorldViewProj->_42;