67 |
PG_Font* PG_Application::DefaultFont = NULL; |
PG_Font* PG_Application::DefaultFont = NULL; |
68 |
SDL_Surface* PG_Application::my_background = NULL; |
SDL_Surface* PG_Application::my_background = NULL; |
69 |
SDL_Surface* PG_Application::my_scaled_background = NULL; |
SDL_Surface* PG_Application::my_scaled_background = NULL; |
70 |
SDL_Color PG_Application::my_backcolor; |
PG_Color PG_Application::my_backcolor; |
71 |
int PG_Application::my_backmode = BKMODE_TILE; |
int PG_Application::my_backmode = BKMODE_TILE; |
72 |
bool PG_Application::disableDirtyUpdates = false; |
bool PG_Application::disableDirtyUpdates = false; |
73 |
|
|
435 |
PG_Rect fillrect = rect; |
PG_Rect fillrect = rect; |
436 |
|
|
437 |
if(!my_background) { |
if(!my_background) { |
438 |
SDL_Color c = my_backcolor; |
SDL_FillRect(screen, (SDL_Rect*)&fillrect, my_backcolor.MapRGB(screen->format)); |
|
SDL_FillRect(screen, (SDL_Rect*)&fillrect, SDL_MapRGB(screen->format, c.r, c.g, c.b)); |
|
439 |
return; |
return; |
440 |
} |
} |
441 |
if(my_backmode == BKMODE_STRETCH && |
if(my_backmode == BKMODE_STRETCH && |
629 |
PG_LogMSG("size: %i", DefaultFont->GetSize()); |
PG_LogMSG("size: %i", DefaultFont->GetSize()); |
630 |
|
|
631 |
my_background = theme->FindSurface("Background", "Background", "background"); |
my_background = theme->FindSurface("Background", "Background", "background"); |
632 |
my_backmode = theme->FindProperty("Background", "Background", "backmode"); |
theme->GetProperty("Background", "Background", "backmode", my_backmode); |
633 |
SDL_Color* bc = theme->FindColor("Background", "Background", "backcolor"); |
theme->GetColor("Background", "Background", "backcolor", my_backcolor); |
634 |
if(bc != NULL) { |
|
|
my_backcolor = *bc; |
|
|
} |
|
635 |
if(my_scaled_background) { |
if(my_scaled_background) { |
636 |
// Destroyed scaled background if present |
// Destroyed scaled background if present |
637 |
SDL_FreeSurface(my_scaled_background); |
SDL_FreeSurface(my_scaled_background); |
876 |
return (FindInChildObjects(PG_Widget::GetWidgetList(), id)); |
return (FindInChildObjects(PG_Widget::GetWidgetList(), id)); |
877 |
} |
} |
878 |
|
|
879 |
void PG_Application::SetFontColor(const SDL_Color& Color) { |
void PG_Application::SetFontColor(const PG_Color& Color) { |
880 |
DefaultFont->SetColor(Color); |
DefaultFont->SetColor(Color); |
881 |
} |
} |
882 |
|
|
|
void PG_Application::SetFontColor(int Red, int Green, int Blue) { |
|
|
SDL_Color Color; |
|
|
Color.r = Red; |
|
|
Color.g = Green; |
|
|
Color.b = Blue; |
|
|
SetFontColor(Color); |
|
|
} |
|
|
|
|
|
void PG_Application::SetFontColor(int c) { |
|
|
SDL_Color Color; |
|
|
Color.r = (c >> 16) & 0xff; |
|
|
Color.g = (c >> 8) & 0xff; |
|
|
Color.b = c & 0xff; |
|
|
SetFontColor(Color); |
|
|
} |
|
|
|
|
883 |
void PG_Application::SetFontAlpha(int Alpha) { |
void PG_Application::SetFontAlpha(int Alpha) { |
884 |
DefaultFont->SetAlpha(Alpha); |
DefaultFont->SetAlpha(Alpha); |
885 |
} |
} |