void CUIMng::CreateTitleSceneUI()
{
ReleaseTitleSceneUI();
CInput& rInput = CInput::Instance();
float fScaleX = (float)rInput.GetScreenWidth() / 800.0f;
float fScaleY = (float)rInput.GetScreenHeight() / 600.0f;
LoadBitmapA("Custom\\Interface\\NL_Loading.tga", 531123, 0x2601, 0x2901, 1, 0);
LoadBitmapA("Custom\\Interface\\NL_BarFrame.tga", 531124, 0x2601, 0x2901, 1, 0);
LoadBitmapA("Custom\\Interface\\NL_Porcento.tga", 531126, 0x2601, 0x2901, 1, 0);
LoadBitmapA("Interface\\newui_number1.tga", 31337, 9729, 10496, 1, 0);
LoadBitmapA("Custom\\Interface\\NL_Back1.jpg", 531122, 0x2600, 0x2900, 1, 0);
LoadBitmapA("Custom\\Interface\\NL_Back2.jpg", 531125, 0x2600, 0x2900, 1, 0);
LoadBitmapA("Custom\\Interface\\NL_Bar.jpg", 31122, 0x2601, 0x2901, 1, 0);
m_pgbLoding = new CGaugeBar;
RECT rc = { -36, 4, 656 + 36, 10 };
m_pgbLoding->Create(4, 15, 31122, &rc, 0, 0, -1, true, fScaleX, fScaleY);
m_pgbLoding->SetPosition(72, 521);
m_pgbLoding->Show();
m_nScene = UIM_SCENE_TITLE;
}
void CUIMng::ReleaseTitleSceneUI()
{
SAFE_DELETE_ARRAY(m_asprTitle);
SAFE_DELETE(m_pgbLoding);
m_nScene = UIM_SCENE_NONE;
}
void CUIMng::RenderTitleSceneUI(HDC hDC, DWORD dwNow, DWORD dwTotal)
{
::BeginOpengl();
::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
::BeginBitmap();
float FT_Perspective = (float)(1024.f / (float)WindowHeight);
float FT_Width = (float)(2048.f / FT_Perspective);
float FT_Height = (float)(1024.f / FT_Perspective);
float iPos_x = 0 + ((WindowWidth - FT_Width) / 2.f);
float iPos_y = 0 + ((WindowHeight - FT_Height) / 2.f);
float width = (FT_Width / 2.f);
EnableAlphaTest(TRUE);
glAlphaFunc(GL_GREATER, 0.0f);
RenderBitmap(531122, iPos_x, iPos_y, width, FT_Height, 0.0, 0.0, 1.f, 1.f, 0, 0, 0.0);
RenderBitmap(531125, iPos_x + width, iPos_y, width, FT_Height, 0.0, 0.0, 1.f, 1.f, 0, 0, 0.0);
FT_Perspective = (float)(1024.f / (float)WindowWidth);
FT_Height = (float)(119.f / FT_Perspective);
iPos_x = 0;
iPos_y = WindowHeight - FT_Height;
RenderBitmap(531123, iPos_x, iPos_y, WindowWidth, FT_Height, 0.0, 0.0, 1.f, 119.f / 128.f, 0, 0, 0.0);
m_pgbLoding->SetValue(dwNow, dwTotal);
m_pgbLoding->Render();
//--
iPos_x = (42.f / FT_Perspective);
iPos_y = (WindowHeight - FT_Height) + (46.f / FT_Perspective);
FT_Width = (float)(WindowWidth - (84.f / FT_Perspective));
float relative = ((float)status_pgb / (float)total_pgb);
RenderBitmap(31122, iPos_x, iPos_y, FT_Width * relative, (8.f / FT_Perspective), 0.0, 0.0, 750.f / 1024.f, 1.f, 0, 0, 0.0);
float rate, SizeNew, Porcento;
double AnimX, AnimY;
float WH = 0.25;
int Anim = (int)(timeGetTime() * 0.5f) % 600 / 40;
AnimX = (double)(Anim % 4) * WH;
AnimY = (double)(Anim / 4) * WH;
rate = 580.f / (float)dwTotal;
SizeNew = rate * dwNow;
iPos_x += FT_Width * relative;
RenderBitmap(531124, iPos_x - (55.f / FT_Perspective), iPos_y - (42.f / FT_Perspective), (81.f / FT_Perspective), (81.f / FT_Perspective), AnimX, AnimY, WH, WH, 0, 0, 0.0);//Bar Frame
glColor3f(0.84, 0.85, 0.86);
rate = 100.f / (float)dwTotal;
Porcento = rate * dwNow;
CRenderNumber(GetWindowsX - 55.f, GetWindowsY - 26.f, Porcento, 1.0);
glColor3f(1.0, 1.0, 1.0);
glAlphaFunc(GL_GREATER, 0.25f);
::EndBitmap();
::EndOpengl();
::glFlush();
::SwapBuffers(hDC);
}