(360) Some refactoring in fonts.cpp

This commit is contained in:
TwinAphex51224 2012-06-23 23:39:13 +02:00
parent d6fedb0522
commit a19e359362

View File

@ -322,11 +322,6 @@ static void xdk360_video_font_get_text_width(xdk360_video_font_t * font, const w
if (letter == L'\n') if (letter == L'\n')
break; break;
// Handle carriage return characters by ignoring them. This helps when
// displaying text from a file.
if( letter == L'\r' )
continue;
// Translate unprintable characters // Translate unprintable characters
const GLYPH_ATTR* pGlyph; const GLYPH_ATTR* pGlyph;
@ -588,7 +583,7 @@ static void xdk360_video_font_deinit(xdk360_video_font_t * font)
m_xprResource.Destroy(); m_xprResource.Destroy();
} }
void xdk360_console_deinit() void xdk360_console_deinit(void)
{ {
// Delete the memory we've allocated // Delete the memory we've allocated
if(video_console.m_Lines) if(video_console.m_Lines)
@ -679,13 +674,7 @@ void xdk360_console_format(LPCSTR strFormat, ... )
for( unsigned long i = 0; i < uStringLength; i++ ) for( unsigned long i = 0; i < uStringLength; i++ )
{ {
wchar_t wch; wchar_t wch;
int ret = MultiByteToWideChar( rarch_convert_char_to_wchar(&wch, &strMessage[i], sizeof(wch));
CP_ACP, // ANSI code page
0, // No flags
&strMessage[i], // Character to convert
1, // Convert one byte
&wch, // Target wide character buffer
1 ); // One wide character
xdk360_console_add( wch ); xdk360_console_add( wch );
} }
@ -706,11 +695,7 @@ void xdk360_video_font_begin (xdk360_video_font_t * font)
// Save state // Save state
if( font->m_bSaveState ) if( font->m_bSaveState )
{ {
// Note, we are not saving the texture, vertex, or pixel shader, pD3dDevice->GetRenderState( D3DRS_ALPHABLENDENABLE, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_ALPHABLENDENABLE ] );
// since it's not worth the performance. We're more interested
// in saving state that would cause hard to find problems.
pD3dDevice->GetRenderState( D3DRS_ALPHABLENDENABLE,
&font->m_dwSavedState[ SAVEDSTATE_D3DRS_ALPHABLENDENABLE ] );
pD3dDevice->GetRenderState( D3DRS_SRCBLEND, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_SRCBLEND ] ); pD3dDevice->GetRenderState( D3DRS_SRCBLEND, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_SRCBLEND ] );
pD3dDevice->GetRenderState( D3DRS_DESTBLEND, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_DESTBLEND ] ); pD3dDevice->GetRenderState( D3DRS_DESTBLEND, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_DESTBLEND ] );
pD3dDevice->GetRenderState( D3DRS_BLENDOP, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_BLENDOP ] ); pD3dDevice->GetRenderState( D3DRS_BLENDOP, &font->m_dwSavedState[ SAVEDSTATE_D3DRS_BLENDOP ] );