Noticias:

SMF - Just Installed!

Menú principal

Loading Mu Archangel 2 Main5.2

Publicado por Dakosmu, Abr 10, 2025, 01:29 AM

Tema anterior - Siguiente tema

Dakosmu

Loading Mu Archangel 2 Main5.2


UIMng.cpp


float CRenderNumber(float x, float y, int iNum, float fScale)
{
    EnableAlphaTest(1);

    float width, height;

    if (fScale < 0.3f)
    {
        return x;
    }

    width = 12.f * (fScale - 0.3f);
    height = 16.f * (fScale - 0.3f);

    char strText[32];
    itoa(iNum, strText, 10);
    int iLength = (int)strlen(strText);

    x -= width * iLength / 2;

    for (int i = 0; i < iLength; ++i)
    {
        float fU = (float)(strText[i] - 48) * 12.f / 128.f;
        RenderBitmap(31337, x, y, width, height, fU, 0.f, 12.f / 128.f, 14.f / 16.f, 1, 1, 0.0);
        x += width * 0.8f;
    }

    RenderBitmap(531126, x, y, width + 3, height, 0.f, 0.f, 9.f / 16.f, 14.f / 16.f, 1, 1, 0.0);

    return x;
}

void CUIMng::CreateTitleSceneUI()
{
    ReleaseTitleSceneUI();

    CInput& rInput = CInput::Instance();
    float fScaleX = (float)rInput.GetScreenWidth() / 800.0f;
    float fScaleY = (float)rInput.GetScreenHeight() / 600.0f;

    LoadBitmapA("Interface\\KMUA2_Bar.jpg", 31122, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Loading.tga", 531123, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_BarFrame.tga", 531124, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Back01.jpg", 531122, 0x2600, 0x2900, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Back02.jpg", 531125, 0x2600, 0x2900, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Porcento.tga", 531126, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\newui_number1.tga", 31337, 9729, 10496, 1, 0);

    m_pgbLoding = new CGaugeBar;
 
    RECT rc = { -36, 4, 656 + 36, 8 };
    m_pgbLoding->Create(4, 15, 31122, &rc, 0, 0, -1, true, fScaleX, fScaleY);
    m_pgbLoding->SetPosition(72, 540);
    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 Center;

    if (m_Resolution == 4 || m_Resolution == 8 || m_Resolution == 7 || m_Resolution == 6 || m_Resolution == 5)
    {
        Center = 0.0;
    }
    else
    {
        Center = -107;
    }

    RenderBitmap(531122, Center, -1.0, 427, 480, 0, 0, 1.0, 1.0, 1, 1, 0.0);//Back
    RenderBitmap(531125, Center + 427, -1.0, 427, 480, 0, 0, 1.0, 1.0, 1, 1, 0.0);//Back

    RenderBitmap(531123, 0.0, 406.0, 640.0, 74.0, 0, 0, 1.0, 0.94, 1, 1, 0.0);

    m_pgbLoding->SetValue(dwNow, dwTotal);
    m_pgbLoding->Render();

    float WH, rate, SizeNew, Porcento;
    double AnimX, AnimY;

    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;
    RenderBitmap(531124, SizeNew - 27, 391.0, 81.0, 81.0, AnimX, AnimY, WH, WH, 1, 1, 0.0);


    glColor3f(0.84, 0.85, 0.86);
    rate = 100.f / (float)dwTotal;
    Porcento = rate * dwNow;
    CRenderNumber(590, 454, Porcento, 1.0);
    glColor3f(1.0, 1.0, 1.0);

    ::EndBitmap();
    ::EndOpengl();
    ::glFlush();
    ::SwapBuffers(hDC);
}

ZzzScene.cpp

void WebzenScene(HDC hDC)
{
    CUIMng& rUIMng = CUIMng::Instance();

    OpenFont();
    ClearInput();

    rUIMng.CreateTitleSceneUI();
 
    FogEnable = false;
 
    ::EnableAlphaTest();
    OpenBasicData(hDC);

    g_pNewUISystem->LoadMainSceneInterface();

    CUIMng::Instance().RenderTitleSceneUI(hDC, 11, 11);

    rUIMng.ReleaseTitleSceneUI();

    DeleteBitmap(31122);
    DeleteBitmap(531123);
    DeleteBitmap(531124);
    DeleteBitmap(531122);
    DeleteBitmap(531125);
    DeleteBitmap(531126);
    DeleteBitmap(31337);

    g_ErrorReport.Write( "> Loading ok.\r\n");

    SceneFlag = LOG_IN_SCENE;    //
}

default: m_Resolution = 2; break;

by Regz

https://www.mediafire.com/file/18bpsbh8in8lcm0/Interface.rar/file

Mirror
https://mega.nz/file/cb9l1Kwa#QBYUBsam2xRRUL2dJ-oANIPoJusNuJFY4eTQ3wZJSuY

Creditos
Odisk
Bon Dia

Dakosmu

Para WideScrem
float CRenderNumber(float x, float y, int iNum, float fScale)
{
    EnableAlphaTest(1);

    float width, height;

    if (fScale < 0.3f)
    {
        return x;
    }

    // Ajustar el ancho y alto para pantallas widescreen
    width = 12.f * (fScale - 0.3f);
    height = 16.f * (fScale - 0.3f);

    char strText[32];
    itoa(iNum, strText, 10);
    int iLength = (int)strlen(strText);

    x -= width * iLength / 2;

    for (int i = 0; i < iLength; ++i)
    {
        float fU = (float)(strText[i] - 48) * 12.f / 128.f;
        RenderBitmap(31337, x, y, width, height, fU, 0.f, 12.f / 128.f, 14.f / 16.f, 1, 1, 0.0);
        x += width * 0.8f;
    }

    RenderBitmap(531126, x, y, width + 3, height, 0.f, 0.f, 9.f / 16.f, 14.f / 16.f, 1, 1, 0.0);

    return x;
}

void CUIMng::CreateTitleSceneUI()
{
    ReleaseTitleSceneUI();

    CInput& rInput = CInput::Instance();
    float fScaleX = (float)rInput.GetScreenWidth() / 800.0f;
    float fScaleY = (float)rInput.GetScreenHeight() / 600.0f;

    LoadBitmapA("Interface\\KMUA2_Bar.jpg", 31122, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Loading.tga", 531123, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_BarFrame.tga", 531124, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Back01.jpg", 531122, 0x2600, 0x2900, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Back02.jpg", 531125, 0x2600, 0x2900, 1, 0);
    LoadBitmapA("Interface\\KMUA2_Porcento.tga", 531126, 0x2601, 0x2901, 1, 0);
    LoadBitmapA("Interface\\newui_number1.tga", 31337, 9729, 10496, 1, 0);

    m_pgbLoding = new CGaugeBar;

    // Ajustes para la posición en pantallas widescreen
    RECT rc = { -36 * fScaleX, 4 * fScaleY, (656 + 36) * fScaleX, 8 * fScaleY };
    m_pgbLoding->Create(4, 15, 31122, &rc, 0, 0, -1, true, fScaleX, fScaleY);
    m_pgbLoding->SetPosition(72 * fScaleX, 540 * fScaleY);
    m_pgbLoding->Show();

    m_nScene = UIM_SCENE_TITLE;
}

void CUIMng::RenderTitleSceneUI(HDC hDC, DWORD dwNow, DWORD dwTotal)
{
    ::BeginOpengl();
    ::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    ::BeginBitmap();

    float Center;

    // Ajustar el centro para pantallas widescreen
    Center = (m_Resolution == 4 || m_Resolution == 8 || m_Resolution == 7 || m_Resolution == 6 || m_Resolution == 5) ? 0.0 : -107 * (800.0f / rInput.GetScreenWidth());

    RenderBitmap(531122, Center, -1.0, 427 * fScaleX, 480 * fScaleY, 0, 0, 1.0, 1.0, 1, 1, 0.0); // Back
    RenderBitmap(531125, Center + 427 * fScaleX, -1.0, 427 * fScaleX, 480 * fScaleY, 0, 0, 1.0, 1.0, 1, 1, 0.0); // Back

    RenderBitmap(531123, 0.0, 406.0 * fScaleY, 640.0 * fScaleX, 74.0 * fScaleY, 0, 0, 1.0, 0.94, 1, 1, 0.0);

    m_pgbLoding->SetValue(dwNow, dwTotal);
    m_pgbLoding->Render();

    float WH, rate, SizeNew, Porcento;
    double AnimX, AnimY;

    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;
    RenderBitmap(531124, SizeNew - 27 * fScaleX, 391.0 * fScaleY, 81.0 * fScaleX, 81.0 * fScaleY, AnimX, AnimY, WH, WH, 1, 1, 0.0);

    glColor3f(0.84, 0.85, 0.86);
    rate = 100.f / (float)dwTotal;
    Porcento = rate * dwNow;
    CRenderNumber(590 * fScaleX, 454 * fScaleY, Porcento, 1.0);
    glColor3f(1.0, 1.0, 1.0);

    ::EndBitmap();
    ::EndOpengl();
    ::glFlush();
    ::SwapBuffers(hDC);
}
Bon Dia

Dakosmu


Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

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);
}
Bon Dia

🡱 🡳