Commit 4d6d8851 authored by Gerhard Stein's avatar Gerhard Stein

Font color and typo fixes

parent 5951908d
......@@ -17,7 +17,7 @@ CAudioSettings::CAudioSettings() :
CBaseMenu(CRect<float>(0.1f, 0.24f, 0.8f, 0.4f) )
{
mpRate = new CGUIComboSelection( "rate",
mpRate = new CGUIComboSelection( "Rate",
g_pSound->getAvailableRateList());
mpMenuDialog->addControl( mpRate );
......@@ -28,17 +28,17 @@ CBaseMenu(CRect<float>(0.1f, 0.24f, 0.8f, 0.4f) )
filledStrList( 2, "8-bit", "16-bit" ) );
mpMenuDialog->addControl( mpDepth );
mpSBToggle = new CGUIComboSelection( "Soundcard",
filledStrList( 2, "pc speaker", "soundblaster" ) );
mpSBToggle = new CGUIComboSelection( "Card",
filledStrList( 2, "PC Speaker", "Soundblaster" ) );
mpMenuDialog->addControl( mpSBToggle );
mpSoundVolume = new CGUINumberControl( "Sound Volume",
mpSoundVolume = new CGUINumberControl( "Sound Vol",
0, SDL_MIX_MAXVOLUME, 8,
g_pSound->getSoundVolume() );
mpMenuDialog->addControl( mpSoundVolume );
mpMusicVolume = new CGUINumberControl( "Music Volume",
mpMusicVolume = new CGUINumberControl( "Music Vol",
0, SDL_MIX_MAXVOLUME, 8,
g_pSound->getMusicVolume() );
mpMenuDialog->addControl( mpMusicVolume );
......@@ -56,7 +56,7 @@ void CAudioSettings::init()
mpRate->setSelection( itoa(mAudioSpec.freq) );
mpStereo->enable( mAudioSpec.channels == 2 );
mpDepth->setSelection( mAudioSpec.format == AUDIO_S8 ? "8-bit" : "16-bit" );
mpSBToggle->setSelection( mSoundblaster ? "soundblaster" : "pc speaker" );
mpSBToggle->setSelection( mSoundblaster ? "Soundblaster" : "PC Speaker" );
}
......@@ -75,7 +75,7 @@ void CAudioSettings::release()
mAudioSpec.channels = mpStereo->isEnabled() ? 2 : 1;
mAudioSpec.format = mpDepth->getSelection() == "8-bit" ? AUDIO_S8 : AUDIO_S16;
mSoundblaster = ( mpSBToggle->getSelection() == "soundblaster" ? true : false );
mSoundblaster = ( mpSBToggle->getSelection() == "Soundblaster" ? true : false );
g_pSound->setSettings(mAudioSpec, mSoundblaster);
......
......@@ -37,8 +37,7 @@ private:
CVideoSettings::CVideoSettings() :
//CBaseMenu(CRect<float>(0.15f, 0.24f, 0.7f, 0.5f) )
CBaseMenu(CRect<float>(0.25f, 0.24f, 0.45f, 0.5f) )
CBaseMenu(CRect<float>(0.15f, 0.24f, 0.65f, 0.5f) )
{
// Create the fps config selection control
std::list<std::string> List;
......
......@@ -144,6 +144,18 @@ void CFont::setupColor( const Uint32 fgColor )
SDL_SetColors( mFontSurface, color, 0, 16);
}
Uint32 CFont::getFGColor()
{
// Here comes the main part. We have to manipulate the Surface the way it gets
// the given color
SDL_Color color[16];
memcpy( color, mFontSurface->format->palette->colors, 16*sizeof(SDL_Color) );
SDL_PixelFormat *pPixelformat = SDL_GetVideoSurface()->format;
// Change palette colors to the desired one
return SDL_MapRGB(pPixelformat, color[15].r, color[15].g, color[15].b);
}
SDL_Surface* CFont::fetchColoredTextSfc(const std::string& text, const Uint32 fgColor )
{
......@@ -154,6 +166,8 @@ SDL_Surface* CFont::fetchColoredTextSfc(const std::string& text, const Uint32 fg
SDL_Surface *pColoredTextSurface = CG_CreateRGBSurface(rect);
const Uint32 oldColor = getFGColor();
setupColor( fgColor );
drawFont( pColoredTextSurface, text, 0, 0);
......@@ -163,6 +177,7 @@ SDL_Surface* CFont::fetchColoredTextSfc(const std::string& text, const Uint32 fg
SDL_FreeSurface(pColoredTextSurface);
pColoredTextSurface = temp;
setupColor( oldColor );
return pColoredTextSurface;
}
......
......@@ -33,6 +33,8 @@ public:
void setupColor( const Uint32 fgColor );
Uint32 getFGColor();
/**
* Allocates a colored surface with the given Text printed in.
*/
......
......@@ -60,7 +60,7 @@ drawButton(&CGUIButton::drawNoStyle)
void CGUIButton::setupButtonSurface()
{
if( drawButton == &CGUIButton::drawNoStyle )
if( drawButton == &CGUIButton::drawNoStyle )
return;
CFont &Font = g_pGfxEngine->getFont(mFontID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment