45 if (loaderSpec.empty())
46 loaderSpec =
"Loader*";
107 for (
bool found = rFromGrp.
FindEntry(wildcard.c_str(), filename); found; found = rFromGrp.
FindNextEntry(wildcard.c_str(), filename))
111 std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
112 if (extension ==
"png" || extension ==
"jpg" || extension ==
"jpeg" || extension ==
"bmp") {
113 loaders.emplace(&rFromGrp, std::string(filename));
133 int iProgressBarHgt=15;
136 float fLogBoxFontZoom=1.0f;
138 if (options & Flag::BACKGROUND) {
143 if (options & Flag::TITLE) {
148 if (options & Flag::PROGRESS) {
150 pDraw->
DrawBoxDw(cgo.
Surface, iHIndent, cgo.
Hgt - iVIndent - iLogBoxHgt - iVMargin - iProgressBarHgt, cgo.
Wdt - iHIndent, cgo.
Hgt - iVIndent - iLogBoxHgt - iVMargin, 0xb0000000);
151 int iProgressBarWdt = cgo.
Wdt - iHIndent * 2 - 2;
158 pDraw->
DrawBoxDw(cgo.
Surface, iHIndent + 1, cgo.
Hgt - iVIndent - iLogBoxHgt - iVMargin - iProgressBarHgt + 1, iHIndent + 1 + iProgressBarWdt*iProgress / 100, cgo.
Hgt - iVIndent - iLogBoxHgt - iVMargin - 1, 0xb0ff0000);
161 cgo.
Wdt / 2, cgo.
Hgt - iVIndent - iLogBoxHgt - iVMargin - rProgressBarFont.GetLineHeight() / 2 - iProgressBarHgt / 2, 0xffffffff,
165 if (options & Flag::LOG) {
170 int iLineHgt = int(fLogBoxFontZoom*LogFont.
GetLineHeight());
if (!iLineHgt) iLineHgt = 5;
171 int iLinesVisible = (iLogBoxHgt - 2 * iLogBoxMargin) / iLineHgt;
172 int iX = iHIndent + iLogBoxMargin;
173 int iY = cgo.
Hgt - iVIndent - iLogBoxHgt + iLogBoxMargin;
175 for (
int i = -iLinesVisible; i < 0; ++i)
177 const char *szLine = pLog->
GetLine(i,
nullptr,
nullptr,
nullptr);
178 if (!szLine || !*szLine)
continue;
184 if (options & Flag::PROCESS) {
C4GraphicsResource GraphicsResource
const char * LoadResStr(const char *id)
bool LogFatal(const char *szMessage)
uint32_t UnsyncedRandom()
StdStrBuf FormatString(const char *szFmt,...)
char * GetExtension(char *szFilename)
virtual void FillBG(DWORD dwClr=0)=0
bool StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
void DrawFullScreen(C4Facet &cgo)
void DrawX(C4Surface *sfcTarget, float iX, float iY, float iWdt, float iHgt, int32_t iPhaseX=0, int32_t iPhaseY=0) const
bool Load(C4Group &hGroup, const char *szName, int iWdt, int iHgt, bool fNoErrIfNotFound, int iFlags)
StdCopyStrBuf ScenarioTitle
bool FindNextEntry(const char *wildcard, StdStrBuf *filename=nullptr, size_t *size=nullptr, bool start_at_filename=false)
bool FindEntry(const char *wildcard, StdStrBuf *filename=nullptr, size_t *size=nullptr)
C4Group * FindGroup(int32_t Contents, C4Group *pAfter=nullptr, bool fSamePrio=false)
std::map< C4Group *, const std::string > loaders
void SeekLoaderScreens(C4Group &rFromGrp, const std::string &wildcard)
void SetBlackScreen(bool fIsBlack)
void Draw(C4Facet &cgo, Flag options=Flag::ALL, int iProgress=0, class C4LogBuffer *pLog=nullptr, int Process=0)
bool Init(std::string szLoaderSpec)
C4FacetSurface fctBackground
const char * GetLine(int iLineIndex, CStdFont **ppFont, DWORD *pdwClr, bool *pNewParagraph) const
bool Open(C4Group &group, const char *filename) const
int GetLineHeight() const
bool GetTextExtent(const char *szText, int32_t &rsx, int32_t &rsy, bool fCheckMarkup=true)
const char * getData() const