Fixed extended ASCII support in BitmapText

This commit is contained in:
Chris Danford
2002-09-22 20:34:11 +00:00
parent bce306dcdc
commit e44141c8d3
6 changed files with 11 additions and 36 deletions
-10
View File
@@ -5,8 +5,6 @@ Fix
on Ez2, the Ranking doesn't save (AAA, AA, A, B e.t.c.)
but the score does, any ideas why?
timing window in INI
if you do an entire song in it. and save it'll crash
re-add texture hints
@@ -15,18 +13,10 @@ refresh rates screwed up
pump life meter
Don't unload textures after loading them once
SMANIAC difficulty BLUE DUDE! DO IT!
yes because basically these days, Oni challenge modes are defined as smaniac
Spig301: so really, challenge = smaniac
the CDTitles DWI style arent being read anymore.
faster IniFile (with std::map?)
fix movie texture crash
The "groove bar" reports at the results screen is broken.
+5 -2
View File
@@ -114,6 +114,9 @@ void BitmapText::SetText( CString sText )
strncpy( m_szText, sText, MAX_TEXT_CHARS );
m_szText[MAX_TEXT_CHARS-1] = '\0';
/*
Do NOT stop out all extended ASCII chars. Why was this here? -Chris
int iLength = strlen( m_szText );
//
@@ -124,7 +127,7 @@ void BitmapText::SetText( CString sText )
if( m_szText[i] < 0 || m_szText[i] > MAX_FONT_CHARS-1 )
m_szText[i] = ' ';
}
*/
//
// break the string into lines
//
@@ -224,7 +227,7 @@ void BitmapText::DrawPrimitives()
for( int j=0; j<iLineLength; j++ ) // for each character in the line
{
const char c = szLine[j];
const int iFrameNo = m_pFont->m_iCharToFrameNo[c];
const int iFrameNo = m_pFont->m_iCharToFrameNo[ (unsigned char)c ];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
throw RageException( "The font '%s' does not implement the character '%c'", m_sFontFilePath, c );
const int iCharWidth = m_pFont->m_iFrameNoToWidth[iFrameNo];
+2 -2
View File
@@ -45,8 +45,8 @@ protected:
Font* m_pFont;
// recalculate the items below on SetText()
TCHAR m_szText[MAX_TEXT_CHARS];
TCHAR* m_szTextLines[MAX_TEXT_LINES]; // pointers into m_szText
char m_szText[MAX_TEXT_CHARS];
char* m_szTextLines[MAX_TEXT_LINES]; // pointers into m_szText
int m_iLineLengths[MAX_TEXT_LINES]; // in characters
int m_iNumLines;
int m_iLineWidths[MAX_TEXT_LINES]; // in source pixels
+1 -1
View File
@@ -157,7 +157,7 @@ int Font::GetLineWidthInSourcePixels( const char *szLine, int iLength )
for( int i=0; i<iLength; i++ )
{
const char c = szLine[i];
const int iFrameNo = m_iCharToFrameNo[c];
const int iFrameNo = m_iCharToFrameNo[ (unsigned char)c ];
if( iFrameNo == -1 ) // this font doesn't impelemnt this character
throw RageException( "The font '%s' does not implement the character '%c'", m_sTexturePath, c );
+1 -1
View File
@@ -26,7 +26,7 @@ ScoreDisplayOni::ScoreDisplayOni()
LOG->Trace( "ScoreDisplayOni::ScoreDisplayOni()" );
// init the text
BitmapText::LoadFromTextureAndChars( THEME->GetPathTo("Graphics","gameplay score numbers"), "01234 :56789%." );
BitmapText::LoadFromNumbers( THEME->GetPathTo("Numbers","gameplay score numbers") );
TurnShadowOff();
}
+2 -20
View File
@@ -25,26 +25,8 @@ ScreenManager* SCREENMAN = NULL; // global and accessable from anywhere in our p
#define STATS_X THEME->GetMetricF("ScreenManager","StatsX")
#define STATS_Y THEME->GetMetricF("ScreenManager","StatsY")
#define CREDITS_P1_X THEME->GetMetricF("ScreenManager","CreditsP1X")
#define CREDITS_P1_Y THEME->GetMetricF("ScreenManager","CreditsP1Y")
#define CREDITS_P2_X THEME->GetMetricF("ScreenManager","CreditsP2X")
#define CREDITS_P2_Y THEME->GetMetricF("ScreenManager","CreditsP2Y")
float CREDITS_X( int p ) {
switch( p ) {
case PLAYER_1: return CREDITS_P1_X;
case PLAYER_2: return CREDITS_P2_X;
default: ASSERT(0); return 0;
}
}
float CREDITS_Y( int p ) {
switch( p ) {
case PLAYER_1: return CREDITS_P1_Y;
case PLAYER_2: return CREDITS_P2_Y;
default: ASSERT(0); return 0;
}
}
#define CREDITS_X( p ) THEME->GetMetricF("ScreenManager",ssprintf("CreditsP%dX",p+1))
#define CREDITS_Y( p ) THEME->GetMetricF("ScreenManager",ssprintf("CreditsP%dY",p+1))
ScreenManager::ScreenManager()