Fixed RTL credits + removed annoying debug print from there

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5905 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-09-06 17:41:05 +00:00
parent 3154a8c23b
commit 381ac727b0
3 changed files with 25 additions and 5 deletions

View File

@ -404,6 +404,19 @@ core::dimension2d<u32> ScalableFont::getDimension(const wchar_t* text) const
return dim; return dim;
} }
void ScalableFont::draw(const core::stringw& text,
const core::rect<s32>& position, video::SColor color,
bool hcenter, bool vcenter,
const core::rect<s32>* clip, bool ignoreRTL)
{
bool previousRTL = m_rtl;
if (ignoreRTL) m_rtl = false;
draw(text, position, color, hcenter, vcenter, clip);
if (ignoreRTL) m_rtl = previousRTL;
}
//! draws some text and clips it to the specified rectangle if wanted //! draws some text and clips it to the specified rectangle if wanted
void ScalableFont::draw(const core::stringw& text, void ScalableFont::draw(const core::stringw& text,
const core::rect<s32>& position, video::SColor color, const core::rect<s32>& position, video::SColor color,

View File

@ -97,6 +97,10 @@ public:
video::SColor color, bool hcenter=false, video::SColor color, bool hcenter=false,
bool vcenter=false, const core::rect<s32>* clip=0); bool vcenter=false, const core::rect<s32>* clip=0);
virtual void draw(const core::stringw& text, const core::rect<s32>& position,
video::SColor color, bool hcenter,
bool vcenter, const core::rect<s32>* clip, bool ignoreRTL);
//! returns the dimension of a text //! returns the dimension of a text
virtual core::dimension2d<u32> getDimension(const wchar_t* text) const; virtual core::dimension2d<u32> getDimension(const wchar_t* text) const;

View File

@ -180,7 +180,7 @@ void CreditsScreen::loadedFromFile()
while (getWideLine( file, &line )) while (getWideLine( file, &line ))
{ {
stringc cversion = line.c_str(); stringc cversion = line.c_str();
printf("CREDITS line : %s\n", cversion.c_str()); //printf("CREDITS line : %s\n", cversion.c_str());
line = line.trim(); line = line.trim();
@ -347,7 +347,7 @@ void CreditsScreen::onUpdate(float elapsed_time, irr::video::IVideoDriver*)
GUIEngine::getFont()->draw(m_sections[m_curr_section].m_entries[m_curr_element].m_name.c_str(), GUIEngine::getFont()->draw(m_sections[m_curr_section].m_entries[m_curr_element].m_name.c_str(),
core::rect< s32 >( x + text_offset, y+h/6, x+w+text_offset, y+h/3 ), color, core::rect< s32 >( x + text_offset, y+h/6, x+w+text_offset, y+h/3 ), color,
false /* center h */, true /* center v */ ); false /* center h */, true /* center v */, NULL, true /* ignore RTL */ );
const int subamount = m_sections[m_curr_section].m_entries[m_curr_element].m_subentries.size(); const int subamount = m_sections[m_curr_section].m_entries[m_curr_element].m_subentries.size();
int suby = y+h/3; int suby = y+h/3;
@ -357,7 +357,7 @@ void CreditsScreen::onUpdate(float elapsed_time, irr::video::IVideoDriver*)
GUIEngine::getFont()->draw(m_sections[m_curr_section].m_entries[m_curr_element].m_subentries[i].c_str(), GUIEngine::getFont()->draw(m_sections[m_curr_section].m_entries[m_curr_element].m_subentries[i].c_str(),
core::rect< s32 >( x + 32, suby + text_offset/(1+1), x+w+32, suby+h/8 + text_offset/(1+1) ), core::rect< s32 >( x + 32, suby + text_offset/(1+1), x+w+32, suby+h/8 + text_offset/(1+1) ),
color, color,
false/* center h */, true /* center v */ ); false/* center h */, true /* center v */, NULL, true /* ignore RTL */ );
suby += inc; suby += inc;
} }
@ -380,11 +380,14 @@ void CreditsScreen::onUpdate(float elapsed_time, irr::video::IVideoDriver*)
// move on // move on
m_curr_element++; m_curr_element++;
if(m_curr_element >= (int)m_sections[m_curr_section].m_entries.size()) if (m_curr_element >= (int)m_sections[m_curr_section].m_entries.size())
{
time_before_next_step = TIME_SECTION_FADE; time_before_next_step = TIME_SECTION_FADE;
}
else else
{ {
m_time_element = 1.6f + (int)m_sections[m_curr_section].m_entries[m_curr_element].m_subentries.size()*0.5f; const int count = (int)m_sections[m_curr_section].m_entries[m_curr_element].m_subentries.size();
m_time_element = 2.0f + count*0.6f;
time_before_next_step = m_time_element; time_before_next_step = m_time_element;
} }
} }