OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4StartupGraphics Class Reference

#include <C4Startup.h>

Collaboration diagram for C4StartupGraphics:
[legend]

Public Member Functions

bool Init ()
 
bool InitFonts ()
 
CStdFontGetBlackFontByHeight (int32_t iHgt, float *pfZoom)
 

Public Attributes

C4FacetID fctPlrPropBG
 
C4FacetID fctAboutBG
 
C4FacetID fctDlgPaper
 
C4FacetID fctStartupLogo
 
C4FacetID fctMainButtons
 
C4FacetID fctMainButtonsDown
 
C4GUI::DynBarFacet barMainButtons
 
C4GUI::DynBarFacet barMainButtonsDown
 
C4FacetID fctBookScroll
 
C4GUI::ScrollBarFacets sfctBookScroll
 
C4GUI::ScrollBarFacets sfctBookScrollR
 
C4GUI::ScrollBarFacets sfctBookScrollG
 
C4GUI::ScrollBarFacets sfctBookScrollB
 
C4FacetID fctCrew
 
C4FacetID fctCrewClr
 
C4FacetID fctScenSelIcons
 
C4FacetID fctScenSelTitleOverlay
 
CStdFont BookFontCapt
 
CStdFont BookFont
 
CStdFont BookFontTitle
 
CStdFont BookSmallFont
 
C4FacetID fctContext
 
C4FacetID fctOptionsIcons
 
C4FacetID fctOptionsTabClip
 
C4FacetID fctNetGetRef
 

Detailed Description

Definition at line 36 of file C4Startup.h.

Member Function Documentation

CStdFont & C4StartupGraphics::GetBlackFontByHeight ( int32_t  iHgt,
float *  pfZoom 
)

Definition at line 98 of file C4Startup.cpp.

References BookFont, BookFontCapt, BookFontTitle, BookSmallFont, and CStdFont::GetLineHeight().

Referenced by C4MapFolderData::CreateGUIElements().

99 {
100  // get optimal font for given control size
101  CStdFont *pUseFont;
102  if (iHgt <= BookSmallFont.GetLineHeight()) pUseFont = &BookSmallFont;
103  else if (iHgt <= BookFont.GetLineHeight()) pUseFont = &BookFont;
104  else if (iHgt <= BookFontCapt.GetLineHeight()) pUseFont = &BookFontCapt;
105  else pUseFont = &BookFontTitle;
106  // determine zoom
107  if (pfZoom)
108  {
109  int32_t iLineHgt = pUseFont->GetLineHeight();
110  if (iLineHgt)
111  *pfZoom = (float) iHgt / (float) iLineHgt;
112  else
113  *pfZoom = 1.0f; // error
114  }
115  return *pUseFont;
116 }
CStdFont BookFontTitle
Definition: C4Startup.h:65
int GetLineHeight() const
Definition: C4FontLoader.h:132
CStdFont BookSmallFont
Definition: C4Startup.h:65
CStdFont BookFont
Definition: C4Startup.h:65
CStdFont BookFontCapt
Definition: C4Startup.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupGraphics::Init ( )

Definition at line 40 of file C4Startup.cpp.

References barMainButtons, barMainButtonsDown, fctAboutBG, fctBookScroll, fctContext, fctDlgPaper, fctMainButtons, fctMainButtonsDown, fctNetGetRef, fctOptionsIcons, fctOptionsTabClip, fctPlrPropBG, fctScenSelIcons, fctScenSelTitleOverlay, fctStartupLogo, Game, C4FacetSurface::GetFace(), GraphicsResource, C4Facet::Hgt, InitFonts(), C4GraphicsResource::ProgressIncrement, C4GraphicsResource::ProgressStart, C4FacetSurface::Set(), C4GUI::ScrollBarFacets::Set(), C4Surface::SetBackground(), C4GUI::DynBarFacet::SetHorizontal(), C4Game::SetInitProgress(), sfctBookScroll, sfctBookScrollB, sfctBookScrollG, sfctBookScrollR, C4Facet::Surface, and C4Facet::Wdt.

Referenced by C4Startup::EnsureLoaded().

41 {
44  // load startup specific graphics from gfxsys groupset
45  Game.SetInitProgress(38.0f);
46  if (!LoadFile(fctDlgPaper, "StartupDlgPaper")) return false;
47  if (!LoadFile(fctPlrPropBG, "StartupPlrPropBG")) return false;
48  if (!LoadFile(fctAboutBG, "StartupAboutBG")) return false;
50  if (!LoadFile(fctStartupLogo, "StartupLogo")) return false;
53  if (!LoadFile(fctMainButtons, "StartupBigButton")) return false;
55  if (!LoadFile(fctMainButtonsDown, "StartupBigButtonDown")) return false;
57  if (!LoadFile(fctBookScroll, "StartupBookScroll")) return false;
62  if (!LoadFile(fctContext, "StartupContext")) return false;
64  if (!LoadFile(fctScenSelIcons, "StartupScenSelIcons")) return false;
65  fctScenSelIcons.Wdt = fctScenSelIcons.Hgt; // icon width is determined by icon height
66  if (!LoadFile(fctScenSelTitleOverlay, "StartupScenSelTitleOv")) return false;
67  if (!LoadFile(fctOptionsIcons, "StartupOptionIcons")) return false;
69  if (!LoadFile(fctOptionsTabClip, "StartupTabClip")) return false;
70  if (!LoadFile(fctNetGetRef, "StartupNetGetRef")) return false;
71  fctNetGetRef.Wdt = 40;
72 #ifndef USE_CONSOLE
73  if (!InitFonts()) return false;
74 #endif
75  Game.SetInitProgress(100);
76  return true;
77 }
void SetInitProgress(float fToProgress)
Definition: C4Game.cpp:3389
C4FacetID fctStartupLogo
Definition: C4Startup.h:47
C4GUI::DynBarFacet barMainButtonsDown
Definition: C4Startup.h:51
C4FacetID fctDlgPaper
Definition: C4Startup.h:45
C4Game Game
Definition: C4Globals.cpp:52
C4GUI::ScrollBarFacets sfctBookScrollB
Definition: C4Startup.h:55
C4FacetID fctScenSelTitleOverlay
Definition: C4Startup.h:63
C4FacetID fctPlrPropBG
Definition: C4Startup.h:43
C4GraphicsResource GraphicsResource
void Set(const C4Facet &cpy)
Definition: C4FacetEx.h:46
C4FacetID fctScenSelIcons
Definition: C4Startup.h:61
C4GUI::ScrollBarFacets sfctBookScrollG
Definition: C4Startup.h:55
C4GUI::ScrollBarFacets sfctBookScrollR
Definition: C4Startup.h:55
C4FacetID fctOptionsIcons
Definition: C4Startup.h:71
C4FacetID fctMainButtonsDown
Definition: C4Startup.h:50
C4GUI::ScrollBarFacets sfctBookScroll
Definition: C4Startup.h:55
void Set(const C4Facet &rByFct, int32_t iPinIndex=0)
Definition: C4Gui.cpp:137
C4FacetID fctBookScroll
Definition: C4Startup.h:54
void SetHorizontal(C4Surface &rBySfc, int iHeight=0, int iBorderWidth=0)
Definition: C4Gui.cpp:120
float Hgt
Definition: C4Facet.h:120
C4FacetID fctContext
Definition: C4Startup.h:68
C4FacetID fctNetGetRef
Definition: C4Startup.h:74
C4Surface * Surface
Definition: C4Facet.h:119
C4FacetID fctOptionsTabClip
Definition: C4Startup.h:71
void SetBackground()
Definition: C4Surface.h:94
C4FacetID fctAboutBG
Definition: C4Startup.h:44
float Wdt
Definition: C4Facet.h:120
C4GUI::DynBarFacet barMainButtons
Definition: C4Startup.h:51
C4Surface & GetFace()
Definition: C4FacetEx.h:52
C4FacetID fctMainButtons
Definition: C4Startup.h:50

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4StartupGraphics::InitFonts ( )

Definition at line 80 of file C4Startup.cpp.

References BookFont, BookFontCapt, BookFontTitle, BookSmallFont, C4FontLoader::C4FT_Caption, C4FontLoader::C4FT_Main, C4FontLoader::C4FT_MainSmall, C4FontLoader::C4FT_Title, Config, C4GraphicsResource::Files, FontLoader, Game, C4Config::General, GraphicsResource, C4FontLoader::InitFont(), LogFatal(), C4ConfigGeneral::RXFontName, C4ConfigGeneral::RXFontSize, and C4Game::SetInitProgress().

Referenced by Init(), and C4Application::SetGameFont().

81 {
82  const char *szFont = Config.General.RXFontName;
84  { LogFatal("Font Error (1)"); return false; }
87  { LogFatal("Font Error (2)"); return false; }
90  { LogFatal("Font Error (3)"); return false; }
93  { LogFatal("Font Error (4)"); return false; }
94  return true;
95 }
void SetInitProgress(float fToProgress)
Definition: C4Game.cpp:3389
CStdFont BookFontTitle
Definition: C4Startup.h:65
C4Config Config
Definition: C4Config.cpp:837
C4Game Game
Definition: C4Globals.cpp:52
C4ConfigGeneral General
Definition: C4Config.h:252
C4GraphicsResource GraphicsResource
CStdFont BookSmallFont
Definition: C4Startup.h:65
bool LogFatal(const char *szMessage)
Definition: C4Log.cpp:230
CStdFont BookFont
Definition: C4Startup.h:65
char RXFontName[CFG_MaxString+1]
Definition: C4Config.h:42
C4FontLoader FontLoader
int32_t RXFontSize
Definition: C4Config.h:43
CStdFont BookFontCapt
Definition: C4Startup.h:65
bool InitFont(CStdFont *Font, const char *szFontName, FontType eType, int32_t iSize, C4GroupSet *pGfxGroups, bool fDoShadow=true)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

C4GUI::DynBarFacet C4StartupGraphics::barMainButtons

Definition at line 51 of file C4Startup.h.

Referenced by Init().

C4GUI::DynBarFacet C4StartupGraphics::barMainButtonsDown

Definition at line 51 of file C4Startup.h.

Referenced by C4StartupMainDlg::C4StartupMainDlg(), and Init().

CStdFont C4StartupGraphics::BookFontTitle
C4FacetID C4StartupGraphics::fctAboutBG

Definition at line 44 of file C4Startup.h.

Referenced by C4StartupAboutDlg::DrawElement(), and Init().

C4FacetID C4StartupGraphics::fctBookScroll

Definition at line 54 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctContext

Definition at line 68 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctCrew

Definition at line 58 of file C4Startup.h.

C4FacetID C4StartupGraphics::fctCrewClr

Definition at line 58 of file C4Startup.h.

C4FacetID C4StartupGraphics::fctDlgPaper

Definition at line 45 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctMainButtons

Definition at line 50 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctMainButtonsDown

Definition at line 50 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctNetGetRef

Definition at line 74 of file C4Startup.h.

Referenced by Init(), and C4StartupNetListEntry::SetRefQuery().

C4FacetID C4StartupGraphics::fctOptionsIcons
C4FacetID C4StartupGraphics::fctOptionsTabClip
C4FacetID C4StartupGraphics::fctPlrPropBG

Definition at line 43 of file C4Startup.h.

Referenced by C4StartupPlrPropertiesDlg::DrawElement(), and Init().

C4FacetID C4StartupGraphics::fctScenSelIcons

Definition at line 61 of file C4Startup.h.

Referenced by Init(), and C4ScenarioListLoader::Entry::Load().

C4FacetID C4StartupGraphics::fctScenSelTitleOverlay

Definition at line 63 of file C4Startup.h.

Referenced by Init().

C4FacetID C4StartupGraphics::fctStartupLogo

Definition at line 47 of file C4Startup.h.

Referenced by C4StartupMainDlg::DrawElement(), and Init().

C4GUI::ScrollBarFacets C4StartupGraphics::sfctBookScroll

Definition at line 55 of file C4Startup.h.

Referenced by Init().

C4GUI::ScrollBarFacets C4StartupGraphics::sfctBookScrollB

Definition at line 55 of file C4Startup.h.

Referenced by Init().

C4GUI::ScrollBarFacets C4StartupGraphics::sfctBookScrollG

Definition at line 55 of file C4Startup.h.

Referenced by Init().

C4GUI::ScrollBarFacets C4StartupGraphics::sfctBookScrollR

Definition at line 55 of file C4Startup.h.

Referenced by Init().


The documentation for this class was generated from the following files: