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 a9be52c41a.
This commit is contained in:
@@ -53,8 +53,8 @@ XUI_Font::~XUI_Font()
|
||||
VOID XUI_Font::GetTextExtent( const WCHAR* strText, FLOAT* pWidth,
|
||||
FLOAT* pHeight, BOOL bFirstLineOnly ) const
|
||||
{
|
||||
assert( pWidth != nullptr );
|
||||
assert( pHeight != nullptr );
|
||||
assert( pWidth != NULL );
|
||||
assert( pHeight != NULL );
|
||||
|
||||
// Set default text extent in output parameters
|
||||
int iWidth = 0;
|
||||
@@ -146,8 +146,8 @@ VOID XUI_Font::Begin()
|
||||
//m_pFontTexture->GetLevelDesc( 0, &TextureDesc ); // Get the description
|
||||
|
||||
// Set render state
|
||||
assert(m_fontData->m_pFontTexture != nullptr || m_fontData->m_iFontTexture > 0);
|
||||
if(m_fontData->m_pFontTexture != nullptr)
|
||||
assert(m_fontData->m_pFontTexture != NULL || m_fontData->m_iFontTexture > 0);
|
||||
if(m_fontData->m_pFontTexture != NULL)
|
||||
{
|
||||
pD3dDevice->SetTexture( 0, m_fontData->m_pFontTexture );
|
||||
}
|
||||
@@ -236,7 +236,7 @@ VOID XUI_Font::DrawShadowText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, DW
|
||||
VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor,
|
||||
const WCHAR* strText, DWORD dwFlags, FLOAT fMaxPixelWidth, bool darken /*= false*/ )
|
||||
{
|
||||
if( nullptr == strText ) return;
|
||||
if( NULL == strText ) return;
|
||||
if( L'\0' == strText[0] ) return;
|
||||
|
||||
// 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
|
||||
@@ -244,21 +244,21 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor,
|
||||
{
|
||||
if(RenderManager.IsWidescreen())
|
||||
{
|
||||
int iScaleX=static_cast<int>(m_fXScaleFactor);
|
||||
int iScaleX=(int)m_fXScaleFactor;
|
||||
int iOriginX;
|
||||
if(iScaleX%2==0)
|
||||
{
|
||||
iOriginX=static_cast<int>(fOriginX);
|
||||
iOriginX=(int)fOriginX;
|
||||
if(iOriginX%2==1)
|
||||
{
|
||||
fOriginX+=1.0f;
|
||||
}
|
||||
}
|
||||
int iScaleY=static_cast<int>(m_fYScaleFactor);
|
||||
int iScaleY=(int)m_fYScaleFactor;
|
||||
int iOriginY;
|
||||
if(iScaleY%2==0)
|
||||
{
|
||||
iOriginY=static_cast<int>(fOriginY);
|
||||
iOriginY=(int)fOriginY;
|
||||
if(iOriginY%2==1)
|
||||
{
|
||||
fOriginY+=1.0f;
|
||||
@@ -268,7 +268,7 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor,
|
||||
else
|
||||
{
|
||||
// 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 iOriginY=static_cast<int>(fOriginY);
|
||||
int iOriginY=(int)fOriginY;
|
||||
if(iOriginY%2==1)
|
||||
{
|
||||
fOriginY-=1.0f/3.0f;
|
||||
@@ -415,8 +415,8 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor,
|
||||
// Translate unprintable characters
|
||||
XUI_FontData::SChar sChar = m_fontData->getChar( letter );
|
||||
|
||||
FLOAT fOffset = m_fXScaleFactor * static_cast<FLOAT>(sChar.getOffset());
|
||||
FLOAT fAdvance = m_fXScaleFactor * static_cast<FLOAT>(sChar.getWAdvance());
|
||||
FLOAT fOffset = m_fXScaleFactor * ( FLOAT )sChar.getOffset();
|
||||
FLOAT fAdvance = m_fXScaleFactor * ( FLOAT )sChar.getWAdvance();
|
||||
// 4J Use the font max width otherwise scaling doesnt look right
|
||||
FLOAT fWidth = m_fXScaleFactor * (sChar.tu2() - sChar.tu1());//( FLOAT )pGlyph->wWidth;
|
||||
FLOAT fHeight = m_fYScaleFactor * m_fontData->getFontHeight();
|
||||
@@ -450,10 +450,10 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor,
|
||||
|
||||
// Add the vertices to draw this glyph
|
||||
|
||||
FLOAT tu1 = sChar.tu1() / static_cast<float>(m_fontData->getImageWidth());
|
||||
FLOAT tv1 = sChar.tv1() / static_cast<float>(m_fontData->getImageHeight());
|
||||
FLOAT tu2 = sChar.tu2() / static_cast<float>(m_fontData->getImageWidth());
|
||||
FLOAT tv2 = sChar.tv2() / static_cast<float>(m_fontData->getImageHeight());
|
||||
FLOAT tu1 = sChar.tu1() / (float)m_fontData->getImageWidth();
|
||||
FLOAT tv1 = sChar.tv1() / (float)m_fontData->getImageHeight();
|
||||
FLOAT tu2 = sChar.tu2() / (float)m_fontData->getImageWidth();
|
||||
FLOAT tv2 = sChar.tv2() / (float)m_fontData->getImageHeight();
|
||||
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
|
||||
Reference in New Issue
Block a user