char load_percent_text[11][] = { "0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%" };
char load_percen = 0;
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (SUCCEEDED(SF->getRender()->BeginRender()))
{
static stFontInfo *pFont = NULL;
if (pFont == NULL)
{
pFont = SF->getRender()->CreateNewFont("Tahoma", 12, FCR_BORDER);
if (pFont == NULL) //WTF? Exit if not created
{
SF->getRender()->EndRender();
return true;
}
}
static int load_time = GetTickCount();
if (load_percen < 11)
{
if (load_time < GetTickCount())
{
load_time = GetTickCount() + 1000;
load_percen++;
if (load_percen == 11)
{
load_time += 3000; //show " Loaded!" 3 sec
}
}
pFont->Print(LoadPercentText[load_percen], D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
}
else if (load_percen == 11)
{
if (load_time < GetTickCount())
{
load_percen++;
}
pFont->Print(" Loaded!", D3DCOLOR_ARGB(255, 255, 255, 0), 500, 500, false);
}
SF->getRender()->EndRender();
};
return true;
};