Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1333 lines
44 KiB
C++
1333 lines
44 KiB
C++
// CommonInterface.cpp: implementation of the CCommonInterface class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#include "ijl.h"
|
||
#include "ClientMain.h"
|
||
#include "CommonInterface.h"
|
||
#include "FrameTimer.h"
|
||
#include "WinInput.h"
|
||
#include "GUIButtonManager.h"
|
||
#include "GUITooltipManager.h"
|
||
|
||
#include "GUITextEdit.h"
|
||
|
||
#include "GUIMessageBoxManager.h"
|
||
|
||
//////////////////////////////////////////////////////////////////////
|
||
// Construction/Destruction
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
CCommonInterface::CCommonInterface()
|
||
{
|
||
int i;
|
||
for(i = 0; i < 12; i++)
|
||
{
|
||
m_lpFullScreenSprite[i] = NULL;
|
||
}
|
||
for(i = 0; i < 9; i++)
|
||
{
|
||
m_lpFullScreenTexture[i] = NULL;
|
||
}
|
||
for(i = 0; i < 5; i++)
|
||
{
|
||
m_lpMainTexture[i] = NULL;
|
||
}
|
||
for(i = 0; i < 6; i++)
|
||
{
|
||
m_lpMainSprite[i] = NULL;
|
||
}
|
||
for(i = 0; i < 15; i++)
|
||
{
|
||
m_lpNationSprite[i] = NULL;
|
||
}
|
||
for(i = 0; i < 13; i++)
|
||
{
|
||
m_lpNationTexture[i] = NULL;
|
||
}
|
||
|
||
m_lpNationButton[0] = NULL;
|
||
m_lpNationButton[1] = NULL;
|
||
m_lpNationTooltip[0] = NULL;
|
||
m_lpNationTooltip[1] = NULL;
|
||
m_lpScroll = NULL;
|
||
m_lstNotice.clear();
|
||
m_lpMainButton = NULL;
|
||
|
||
m_lpCursor = NULL;
|
||
|
||
m_lpNumber = NULL;
|
||
m_lpStackNumber = NULL;
|
||
|
||
m_dwNationOverMouse = 0xFFFFFFFF;
|
||
m_dwNationSelect = 0xFFFFFFFF;
|
||
m_dwFadeMode = 0xFFFFFFFF;
|
||
}
|
||
|
||
CCommonInterface::~CCommonInterface()
|
||
{
|
||
Destroy();
|
||
}
|
||
|
||
void CCommonInterface::CreateFullScreen()
|
||
{
|
||
int i;
|
||
for(i = 0; i < 12; i++)
|
||
{
|
||
if(m_lpFullScreenSprite[i]) { delete m_lpFullScreenSprite[i]; m_lpFullScreenSprite[i] = NULL; }
|
||
m_lpFullScreenSprite[i] = new CSprite;
|
||
}
|
||
|
||
for(i = 0; i < 9; i++)
|
||
{
|
||
if(m_lpFullScreenTexture[i]) { delete m_lpFullScreenTexture[i]; m_lpFullScreenTexture[i] = NULL; }
|
||
m_lpFullScreenTexture[i] = new CTexture;
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::DestroyFullScreen()
|
||
{
|
||
int i;
|
||
for(i = 0; i < 12; i++)
|
||
{
|
||
if(m_lpFullScreenSprite[i]) { delete m_lpFullScreenSprite[i]; m_lpFullScreenSprite[i] = NULL; }
|
||
}
|
||
for(i = 0; i < 9; i++)
|
||
{
|
||
if(m_lpFullScreenTexture[i]) { delete m_lpFullScreenTexture[i]; m_lpFullScreenTexture[i] = NULL; }
|
||
}
|
||
}
|
||
|
||
BOOL CCommonInterface::InitLogo()
|
||
{
|
||
CreateFullScreen();
|
||
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpFullScreenTexture[0]->Load("logo_01.dds");
|
||
m_lpFullScreenTexture[1]->Load("logo_02.dds");
|
||
m_lpFullScreenTexture[2]->Load("logo_03.dds");
|
||
m_lpFullScreenTexture[3]->Load("logo_04_08_12.dds");
|
||
m_lpFullScreenTexture[4]->Load("logo_05.dds");
|
||
m_lpFullScreenTexture[5]->Load("logo_06.dds");
|
||
m_lpFullScreenTexture[6]->Load("logo_07.dds");
|
||
m_lpFullScreenTexture[7]->Load("logo_09_10.dds");
|
||
m_lpFullScreenTexture[8]->Load("logo_11.dds");
|
||
|
||
m_lpFullScreenSprite[0]->Create(0, 0, 0, 0, 256, 256, m_lpFullScreenTexture[0]);
|
||
m_lpFullScreenSprite[1]->Create(256, 0, 0, 0, 256, 256, m_lpFullScreenTexture[1]);
|
||
m_lpFullScreenSprite[2]->Create(512, 0, 0, 0, 256, 256, m_lpFullScreenTexture[2]);
|
||
m_lpFullScreenSprite[3]->Create(768, 0, 0, 0, 32, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[4]->Create(0, 256, 0, 0, 256, 256, m_lpFullScreenTexture[4]);
|
||
m_lpFullScreenSprite[5]->Create(256, 256, 0, 0, 256, 256, m_lpFullScreenTexture[5]);
|
||
m_lpFullScreenSprite[6]->Create(512, 256, 0, 0, 256, 256, m_lpFullScreenTexture[6]);
|
||
m_lpFullScreenSprite[7]->Create(768, 256, 32, 0, 64, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[8]->Create(0, 512, 0, 0, 256, 88, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[9]->Create(256, 512, 0, 88, 256, 176, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[10]->Create(512, 512, 0, 0, 256, 88, m_lpFullScreenTexture[8]);
|
||
m_lpFullScreenSprite[11]->Create(768, 512, 64, 0, 96, 88, m_lpFullScreenTexture[3]);
|
||
|
||
m_dwLogoTimer = CFrameTimer::Regist(0.3f);
|
||
g_ClientMain.m_dwClientMode = CLIENT_LOGO;
|
||
|
||
FadeIn();
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CCommonInterface::UpdateLogo(void)
|
||
{
|
||
if(m_dwFadeMode == FADE_IN && m_lScreenFade <= FADE_END) return;
|
||
if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
if(m_lScreenFade <= FADE_START)
|
||
{
|
||
Destroy();
|
||
InitMain();
|
||
}
|
||
|
||
return;
|
||
}
|
||
|
||
if(g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsRightMousePress() || (CFrameTimer::GetUpdateTimer(m_dwLogoTimer) >= 1.0f))
|
||
{
|
||
FadeOut();
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::RenderLogo(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
|
||
|
||
if(m_dwFadeMode == FADE_IN)
|
||
{
|
||
m_lScreenFade += fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_END)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
else
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
} else if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
m_lScreenFade -= fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_START)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
BOOL CCommonInterface::InitMain(void)
|
||
{
|
||
CreateFullScreen();
|
||
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpFullScreenTexture[0]->Load("main01.dds");
|
||
m_lpFullScreenTexture[1]->Load("main02.dds");
|
||
m_lpFullScreenTexture[2]->Load("main03.dds");
|
||
m_lpFullScreenTexture[3]->Load("main04_08_12.dds");
|
||
m_lpFullScreenTexture[4]->Load("main05.dds");
|
||
m_lpFullScreenTexture[5]->Load("main06.dds");
|
||
m_lpFullScreenTexture[6]->Load("main07.dds");
|
||
m_lpFullScreenTexture[7]->Load("main09_10.dds");
|
||
m_lpFullScreenTexture[8]->Load("main11.dds");
|
||
|
||
m_lpMainTexture[0] = new CTexture;
|
||
m_lpMainTexture[0]->Load("news01.dds");
|
||
m_lpMainTexture[1] = new CTexture;
|
||
m_lpMainTexture[1]->Load("news02.dds");
|
||
m_lpMainTexture[2] = new CTexture;
|
||
m_lpMainTexture[2]->Load("news03.dds");
|
||
m_lpMainTexture[3] = new CTexture;
|
||
m_lpMainTexture[3]->Load("news04.dds");
|
||
m_lpMainTexture[4] = new CTexture;
|
||
m_lpMainTexture[4]->Load("news05.dds");
|
||
|
||
|
||
m_lpFullScreenSprite[0]->Create(0, 0, 0, 0, 256, 256, m_lpFullScreenTexture[0]);
|
||
m_lpFullScreenSprite[1]->Create(256, 0, 0, 0, 256, 256, m_lpFullScreenTexture[1]);
|
||
m_lpFullScreenSprite[2]->Create(512, 0, 0, 0, 256, 256, m_lpFullScreenTexture[2]);
|
||
m_lpFullScreenSprite[3]->Create(768, 0, 0, 0, 32, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[4]->Create(0, 256, 0, 0, 256, 256, m_lpFullScreenTexture[4]);
|
||
m_lpFullScreenSprite[5]->Create(256, 256, 0, 0, 256, 256, m_lpFullScreenTexture[5]);
|
||
m_lpFullScreenSprite[6]->Create(512, 256, 0, 0, 256, 256, m_lpFullScreenTexture[6]);
|
||
m_lpFullScreenSprite[7]->Create(768, 256, 32, 0, 64, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[8]->Create(0, 512, 0, 0, 256, 88, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[9]->Create(256, 512, 0, 88, 256, 176, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[10]->Create(512, 512, 0, 0, 256, 88, m_lpFullScreenTexture[8]);
|
||
m_lpFullScreenSprite[11]->Create(768, 512, 64, 0, 96, 88, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpMainSprite[0] = new CSprite;
|
||
m_lpMainSprite[0]->Create(89, 189, 0, 0, 256, 256, m_lpMainTexture[0]);
|
||
m_lpMainSprite[1] = new CSprite;
|
||
m_lpMainSprite[1]->Create(345, 189, 0, 0, 205, 256, m_lpMainTexture[3]);
|
||
m_lpMainSprite[2] = new CSprite;
|
||
m_lpMainSprite[2]->Create(550, 189, 0, 0, 256, 256, m_lpMainTexture[1]);
|
||
m_lpMainSprite[3] = new CSprite;
|
||
m_lpMainSprite[3]->Create(89, 445, 0, 0, 256, 93, m_lpMainTexture[2]);
|
||
m_lpMainSprite[4] = new CSprite;
|
||
m_lpMainSprite[4]->Create(345, 445, 0, 0, 205, 89, m_lpMainTexture[4]);
|
||
m_lpMainSprite[5] = new CSprite;
|
||
m_lpMainSprite[5]->Create(550, 445, 0, 93, 256, 186, m_lpMainTexture[2]);
|
||
|
||
m_lpMainButton = new CGUIButton;
|
||
m_lpMainButton->m_lpNormalButton = new CSprite;
|
||
m_lpMainButton->m_lpNormalButton->Create(606, 537, 0, 94, 144, 148, m_lpMainTexture[4]);
|
||
m_lpMainButton->m_lpOnMouseButton = new CSprite;
|
||
m_lpMainButton->m_lpOnMouseButton->Create(606, 537, 0, 148, 144, 202, m_lpMainTexture[4]);
|
||
m_lpMainButton->m_lpClickMouseButton = new CSprite;
|
||
m_lpMainButton->m_lpClickMouseButton->Create(606, 537, 0, 202, 144, 256, m_lpMainTexture[4]);
|
||
m_lpMainButton->ShowButton(FALSE);
|
||
|
||
g_ClientMain.m_dwClientMode = CLIENT_MAIN;
|
||
|
||
char strFilePath[MAX_PATH], *strNotice;
|
||
sprintf(strFilePath, "%s\\Notice.dat", g_ClientMain.m_strClientPath);
|
||
FILE *fp = fopen(strFilePath,"r");
|
||
if(fp)
|
||
{
|
||
for(;;)
|
||
{
|
||
strNotice = new char[MAX_PATH];
|
||
if(fgets(strNotice, MAX_PATH, fp))
|
||
{
|
||
m_lstNotice.push_back(strNotice);
|
||
} else
|
||
{
|
||
delete[] strNotice;
|
||
break;
|
||
}
|
||
}
|
||
fclose(fp);
|
||
}
|
||
|
||
m_lpScroll = new CGUIScroll;
|
||
m_lpScroll->m_lpBarButton = new CGUIButton;
|
||
m_lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
||
m_lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
||
m_lpScroll->m_lpBarButton->m_lpNormalButton->Create(730, 270, 0, 186, 10, 209, m_lpMainTexture[2]);
|
||
m_lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
||
m_lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(730, 270, 0, 186, 10, 209, m_lpMainTexture[2]);
|
||
|
||
m_dwStartNotice = 0;
|
||
m_lpScroll->m_lValue = (long *)&m_dwStartNotice;
|
||
m_lpScroll->SetMove(0, 0);
|
||
m_lpScroll->SetPosition(730, 270);
|
||
m_lpScroll->SetEdge(0, 0, 11, 235);
|
||
if(m_lstNotice.size() > 15)
|
||
m_lpScroll->SetRange(0, m_lstNotice.size() - 15);
|
||
else
|
||
m_lpScroll->SetRange(0, 0);
|
||
|
||
FadeIn();
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CCommonInterface::UpdateMain(void)
|
||
{
|
||
if(m_dwFadeMode == FADE_IN && m_lScreenFade <= FADE_END && m_lItemFade <= FADE_END) return;
|
||
if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
if(m_lScreenFade <= FADE_START && m_lItemFade <= FADE_START)
|
||
{
|
||
Destroy();
|
||
g_ClientMain.EnterClient();
|
||
}
|
||
|
||
return;
|
||
}
|
||
|
||
m_lpMainButton->Update();
|
||
m_lpScroll->Update();
|
||
g_MessageBoxManager.Update();
|
||
|
||
if(g_ClientMain.m_Network.m_bLoginSuccess)
|
||
{
|
||
m_lpMainButton->ShowButton(TRUE);
|
||
|
||
if(m_lpMainButton->m_nState == BUTTON_CLICK)
|
||
{
|
||
FadeOut();
|
||
}
|
||
} else
|
||
{
|
||
g_ClientMain.ProcessLogin();
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::RenderMain(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
|
||
|
||
if(m_dwFadeMode == FADE_IN)
|
||
{
|
||
m_lScreenFade += fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_END)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
else
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
if(m_lScreenFade <= FADE_END) return;
|
||
|
||
m_lItemFade += fUpdate;
|
||
|
||
for(i = 0; i < 6; i++)
|
||
{
|
||
if(m_lItemFade > FADE_END)
|
||
{
|
||
m_lpMainSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
else
|
||
{
|
||
m_lpMainSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
if(m_lstNotice.size())
|
||
{
|
||
RECT rcRect;
|
||
long lEnd;
|
||
if(m_lstNotice.size() > 15) lEnd = 15; else lEnd = m_lstNotice.size();
|
||
for(i = 0; i < lEnd; i++)
|
||
{
|
||
if(m_lItemFade > FADE_END)
|
||
{
|
||
SetRect(&rcRect, 112, 272 + i * 16, 717, 272 + 16 + i * 16);
|
||
g_TextEdit.DrawText(m_lstNotice[i + m_dwStartNotice], &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||
}
|
||
else
|
||
{
|
||
SetRect(&rcRect, 112, 272 + i * 16, 717, 272 + 16 + i * 16);
|
||
g_TextEdit.DrawText(m_lstNotice[i + m_dwStartNotice], &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f)));
|
||
}
|
||
}
|
||
|
||
if(m_lItemFade > FADE_END)
|
||
{
|
||
m_lpScroll->Render(lpD3DDevice, 255);
|
||
}
|
||
else
|
||
{
|
||
m_lpScroll->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
if(m_lItemFade <= FADE_END) return;
|
||
|
||
m_lpMainButton->Render(lpD3DDevice);
|
||
g_MessageBoxManager.Render(lpD3DDevice);
|
||
} else if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
m_lScreenFade -= fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_START)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
m_lItemFade -= fUpdate;
|
||
|
||
for(i = 0; i < 6; i++)
|
||
{
|
||
if(m_lItemFade > FADE_START)
|
||
{
|
||
m_lpMainSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
if(m_lstNotice.size())
|
||
{
|
||
RECT rcRect;
|
||
long lEnd;
|
||
if(m_lstNotice.size() > 15) lEnd = 15; else lEnd = m_lstNotice.size();
|
||
for(i = 0; i < lEnd; i++)
|
||
{
|
||
if(m_lItemFade > FADE_START)
|
||
{
|
||
SetRect(&rcRect, 112, 272 + i * 16, 717, 272 + 16 + i * 16);
|
||
g_TextEdit.DrawText(m_lstNotice[i + m_dwStartNotice], &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f)));
|
||
}
|
||
}
|
||
|
||
if(m_lItemFade > FADE_START)
|
||
{
|
||
m_lpScroll->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
BOOL CCommonInterface::InitNationSelect(void)
|
||
{
|
||
CreateFullScreen();
|
||
|
||
// <20><> <20><>
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpFullScreenTexture[0]->Load("kslct_01.dds");
|
||
m_lpFullScreenTexture[1]->Load("kslct_02.dds");
|
||
m_lpFullScreenTexture[2]->Load("kslct_03.dds");
|
||
m_lpFullScreenTexture[3]->Load("kslct_04_08_12.dds");
|
||
m_lpFullScreenTexture[4]->Load("kslct_05.dds");
|
||
m_lpFullScreenTexture[5]->Load("kslct_06.dds");
|
||
m_lpFullScreenTexture[6]->Load("kslct_07.dds");
|
||
m_lpFullScreenTexture[7]->Load("kslct_09_10.dds");
|
||
m_lpFullScreenTexture[8]->Load("kslct_11.dds");
|
||
|
||
m_lpFullScreenSprite[0]->Create(0, 0, 0, 0, 256, 256, m_lpFullScreenTexture[0]);
|
||
m_lpFullScreenSprite[1]->Create(256, 0, 0, 0, 256, 256, m_lpFullScreenTexture[1]);
|
||
m_lpFullScreenSprite[2]->Create(512, 0, 0, 0, 256, 256, m_lpFullScreenTexture[2]);
|
||
m_lpFullScreenSprite[3]->Create(768, 0, 0, 0, 32, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[4]->Create(0, 256, 0, 0, 256, 256, m_lpFullScreenTexture[4]);
|
||
m_lpFullScreenSprite[5]->Create(256, 256, 0, 0, 256, 256, m_lpFullScreenTexture[5]);
|
||
m_lpFullScreenSprite[6]->Create(512, 256, 0, 0, 256, 256, m_lpFullScreenTexture[6]);
|
||
m_lpFullScreenSprite[7]->Create(768, 256, 32, 0, 64, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[8]->Create(0, 512, 0, 0, 256, 88, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[9]->Create(256, 512, 0, 88, 256, 176, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[10]->Create(512, 512, 0, 0, 256, 88, m_lpFullScreenTexture[8]);
|
||
m_lpFullScreenSprite[11]->Create(768, 512, 64, 0, 96, 88, m_lpFullScreenTexture[3]);
|
||
|
||
// <20>ؽ<EFBFBD><D8BD><EFBFBD> <20>ε<EFBFBD>
|
||
m_lpNationTexture[0] = new CTexture;
|
||
m_lpNationTexture[0]->Load("kt_01_0.dds");
|
||
m_lpNationTexture[1] = new CTexture;
|
||
m_lpNationTexture[1]->Load("kt_02_0.dds");
|
||
m_lpNationTexture[2] = new CTexture;
|
||
m_lpNationTexture[2]->Load("kt_01_1.dds");
|
||
m_lpNationTexture[3] = new CTexture;
|
||
m_lpNationTexture[3]->Load("kt_02_1.dds");
|
||
m_lpNationTexture[4] = new CTexture;
|
||
m_lpNationTexture[4]->Load("mk_01_0.dds");
|
||
m_lpNationTexture[5] = new CTexture;
|
||
m_lpNationTexture[5]->Load("mk_02_0.dds");
|
||
m_lpNationTexture[6] = new CTexture;
|
||
m_lpNationTexture[6]->Load("mk_01_1.dds");
|
||
m_lpNationTexture[7] = new CTexture;
|
||
m_lpNationTexture[7]->Load("mk_02_1.dds");
|
||
m_lpNationTexture[12] = new CTexture;
|
||
m_lpNationTexture[12]->Load("kslct_13.dds");
|
||
|
||
// <20><><EFBFBD><EFBFBD> ī<><C4AB> & <20><><EFBFBD><EFBFBD>
|
||
m_lpNationSprite[0] = new CSprite;
|
||
m_lpNationSprite[0]->Create(45, 81, 0, 0, 256, 256, m_lpNationTexture[0]);
|
||
m_lpNationSprite[1] = new CSprite;
|
||
m_lpNationSprite[1]->Create(45, 337, 0, 0, 256, 256, m_lpNationTexture[1]);
|
||
m_lpNationSprite[2] = new CSprite;
|
||
m_lpNationSprite[2]->Create(45, 81, 0, 0, 256, 256, m_lpNationTexture[2]);
|
||
m_lpNationSprite[3] = new CSprite;
|
||
m_lpNationSprite[3]->Create(45, 337, 0, 0, 256, 256, m_lpNationTexture[3]);
|
||
m_lpNationTooltip[0] = new CGUITooltipButton;
|
||
m_lpNationTooltip[0]->InitTooltip(g_StringTable.m_strString[30]);
|
||
m_lpNationTooltip[0]->SetRect(50, 84, 271, 498);
|
||
g_TooltipManager.AddTooltip(m_lpNationTooltip[0]);
|
||
|
||
m_lpNationSprite[5] = new CSprite;
|
||
m_lpNationSprite[5]->Create(286, 81, 0, 0, 256, 256, m_lpNationTexture[4]);
|
||
m_lpNationSprite[6] = new CSprite;
|
||
m_lpNationSprite[6]->Create(286, 337, 0, 0, 256, 256, m_lpNationTexture[5]);
|
||
m_lpNationSprite[7] = new CSprite;
|
||
m_lpNationSprite[7]->Create(286, 81, 0, 0, 256, 256, m_lpNationTexture[6]);
|
||
m_lpNationSprite[8] = new CSprite;
|
||
m_lpNationSprite[8]->Create(286, 337, 0, 0, 256, 256, m_lpNationTexture[7]);
|
||
m_lpNationTooltip[1] = new CGUITooltipButton;
|
||
m_lpNationTooltip[1]->InitTooltip(g_StringTable.m_strString[31]);
|
||
m_lpNationTooltip[1]->SetRect(291, 84, 512, 498);
|
||
g_TooltipManager.AddTooltip(m_lpNationTooltip[1]);
|
||
|
||
// <20><>ư
|
||
m_lpNationButton[0] = new CGUIButton;
|
||
m_lpNationButton[0]->m_lpNormalButton = new CSprite;
|
||
m_lpNationButton[0]->m_lpNormalButton->Create(279, 539, 0, 139, 86, 176, m_lpNationTexture[12]);
|
||
m_lpNationButton[0]->m_lpOnMouseButton = new CSprite;
|
||
m_lpNationButton[0]->m_lpOnMouseButton->Create(279, 539, 0, 176, 86, 213, m_lpNationTexture[12]);
|
||
m_lpNationButton[0]->m_lpClickMouseButton = new CSprite;
|
||
m_lpNationButton[0]->m_lpClickMouseButton->Create(279, 539, 0, 213, 86, 250, m_lpNationTexture[12]);
|
||
g_ButtonManager.AddButton(m_lpNationButton[0]);
|
||
|
||
m_lpNationButton[1] = new CGUIButton;
|
||
m_lpNationButton[1]->m_lpNormalButton = new CSprite;
|
||
m_lpNationButton[1]->m_lpNormalButton->Create(439, 539, 86, 139, 172, 176, m_lpNationTexture[12]);
|
||
m_lpNationButton[1]->m_lpOnMouseButton = new CSprite;
|
||
m_lpNationButton[1]->m_lpOnMouseButton->Create(439, 539, 86, 176, 172, 213, m_lpNationTexture[12]);
|
||
m_lpNationButton[1]->m_lpClickMouseButton = new CSprite;
|
||
m_lpNationButton[1]->m_lpClickMouseButton->Create(439, 539, 86, 213, 172, 250, m_lpNationTexture[12]);
|
||
g_ButtonManager.AddButton(m_lpNationButton[1]);
|
||
|
||
// <20><><EFBFBD><EFBFBD>
|
||
m_lpNationSprite[4] = new CSprite;
|
||
m_lpNationSprite[4]->Create(118, 132, 0, 0, 89, 135, m_lpNationTexture[12]);
|
||
m_lpNationSprite[9] = new CSprite;
|
||
m_lpNationSprite[9]->Create(357, 132, 89, 0, 178, 135, m_lpNationTexture[12]);
|
||
|
||
g_ClientMain.m_dwClientMode = CLIENT_NATIONSELECT;
|
||
|
||
FadeIn();
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CCommonInterface::UpdateNationSelect(void)
|
||
{
|
||
if(m_dwFadeMode == FADE_IN && m_lScreenFade <= FADE_END && m_lItemFade <= FADE_END) return;
|
||
if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
if(m_lScreenFade <= FADE_START && m_lItemFade <= FADE_START)
|
||
{
|
||
Destroy();
|
||
if(m_dwNationSelect == 0xFFFFFFFF)
|
||
{
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||
SendMessage(g_ClientMain.m_hWnd, WM_DESTROY, 0, 0);
|
||
g_ClientMain.m_dwClientMode = CLIENT_END;
|
||
} else
|
||
{
|
||
g_ClientMain.CreateNationInterface(m_dwNationSelect);
|
||
g_ClientMain.m_lpInterface->InitChrSelect();
|
||
}
|
||
}
|
||
|
||
return;
|
||
}
|
||
|
||
g_ButtonManager.Update();
|
||
g_TooltipManager.Update();
|
||
|
||
if(g_DeviceInput.InRect(50, 84, 271, 498))
|
||
{
|
||
m_dwNationOverMouse = NATION_HUMAN;
|
||
|
||
if(g_DeviceInput.GetIsLeftMouseUp()) m_dwNationSelect = m_dwNationOverMouse;
|
||
} else if(g_DeviceInput.InRect(291, 84, 512, 498))
|
||
{
|
||
m_dwNationOverMouse = NATION_AKHAN;
|
||
|
||
if(g_DeviceInput.GetIsLeftMouseUp()) m_dwNationSelect = m_dwNationOverMouse;
|
||
} else
|
||
{
|
||
m_dwNationOverMouse = 0xFFFFFFFF;
|
||
}
|
||
|
||
if(m_lpNationButton[0]->m_nState == BUTTON_CLICK)
|
||
// if(m_lpNationButton[0]->m_nState == BUTTON_CLICK && m_dwNationSelect == NATION_HUMAN)
|
||
{
|
||
FadeOut();
|
||
} else if(m_lpNationButton[1]->m_nState == BUTTON_CLICK)
|
||
{
|
||
FadeOut();
|
||
|
||
m_dwNationSelect = 0xFFFFFFFF;
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::RenderNationSelect(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
|
||
|
||
if(m_dwFadeMode == FADE_IN)
|
||
{
|
||
m_lScreenFade += fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_END)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
else
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
if(m_lScreenFade <= FADE_END) return;
|
||
|
||
m_lItemFade += fUpdate;
|
||
|
||
if(m_lItemFade > FADE_END)
|
||
{
|
||
if(m_dwNationOverMouse == NATION_HUMAN || m_dwNationSelect == NATION_HUMAN)
|
||
{
|
||
m_lpNationSprite[2]->Render(lpD3DDevice);
|
||
m_lpNationSprite[3]->Render(lpD3DDevice);
|
||
|
||
if(m_dwNationSelect == NATION_HUMAN)
|
||
{
|
||
m_lpNationSprite[4]->Render(lpD3DDevice);
|
||
}
|
||
} else
|
||
{
|
||
m_lpNationSprite[0]->Render(lpD3DDevice);
|
||
m_lpNationSprite[1]->Render(lpD3DDevice);
|
||
}
|
||
|
||
if(m_dwNationOverMouse == NATION_AKHAN || m_dwNationSelect == NATION_AKHAN)
|
||
{
|
||
m_lpNationSprite[7]->Render(lpD3DDevice);
|
||
m_lpNationSprite[8]->Render(lpD3DDevice);
|
||
|
||
if(m_dwNationSelect == NATION_AKHAN)
|
||
{
|
||
m_lpNationSprite[9]->Render(lpD3DDevice);
|
||
}
|
||
} else
|
||
{
|
||
m_lpNationSprite[5]->Render(lpD3DDevice);
|
||
m_lpNationSprite[6]->Render(lpD3DDevice);
|
||
}
|
||
} else
|
||
{
|
||
m_lpNationSprite[0]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[1]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
|
||
m_lpNationSprite[5]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[6]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
|
||
if(m_lItemFade <= FADE_END) return;
|
||
|
||
m_lpNationButton[0]->Render(lpD3DDevice);
|
||
m_lpNationButton[1]->Render(lpD3DDevice);
|
||
|
||
g_TooltipManager.Render(lpD3DDevice);
|
||
} else if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
m_lScreenFade -= fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_START)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
|
||
m_lItemFade -= fUpdate;
|
||
|
||
if(m_lItemFade > FADE_START)
|
||
{
|
||
if(m_dwNationOverMouse == NATION_HUMAN || m_dwNationSelect == NATION_HUMAN)
|
||
{
|
||
m_lpNationSprite[2]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[3]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
|
||
if(m_dwNationSelect == NATION_HUMAN)
|
||
{
|
||
m_lpNationSprite[4]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
} else
|
||
{
|
||
m_lpNationSprite[0]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[1]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
|
||
if(m_dwNationOverMouse == NATION_AKHAN || m_dwNationSelect == NATION_AKHAN)
|
||
{
|
||
m_lpNationSprite[7]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[8]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
|
||
if(m_dwNationSelect == NATION_AKHAN)
|
||
{
|
||
m_lpFullScreenSprite[9]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
} else
|
||
{
|
||
m_lpNationSprite[5]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
m_lpNationSprite[6]->Render(lpD3DDevice, (unsigned char)(((float)m_lItemFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::Destroy()
|
||
{
|
||
int i;
|
||
for(i = 0; i < 6;i ++)
|
||
{
|
||
if(m_lpMainSprite[i])
|
||
{
|
||
delete m_lpMainSprite[i];
|
||
m_lpMainSprite[i] = NULL;
|
||
}
|
||
}
|
||
for(i = 0; i < 5;i ++)
|
||
{
|
||
if(m_lpMainTexture[i])
|
||
{
|
||
delete m_lpMainTexture[i];
|
||
m_lpMainTexture[i] = NULL;
|
||
}
|
||
}
|
||
if(m_lstNotice.size())
|
||
{
|
||
vector<char *>::iterator it;
|
||
char *lpDelete;
|
||
for(it = m_lstNotice.begin(); it != m_lstNotice.end();)
|
||
{
|
||
lpDelete = (*it);
|
||
it = m_lstNotice.erase(it);
|
||
delete[] lpDelete;
|
||
}
|
||
m_lstNotice.clear();
|
||
}
|
||
if(m_lpScroll) { delete m_lpScroll; m_lpScroll = NULL; }
|
||
for(i = 0; i < 15; i++)
|
||
{
|
||
if(m_lpNationSprite[i])
|
||
{
|
||
delete m_lpNationSprite[i];
|
||
m_lpNationSprite[i] = NULL;
|
||
}
|
||
}
|
||
for(i = 0; i < 13; i++)
|
||
{
|
||
if(m_lpNationTexture[i])
|
||
{
|
||
delete m_lpNationTexture[i];
|
||
m_lpNationTexture[i] = NULL;
|
||
}
|
||
}
|
||
|
||
if(m_lpNumber) { delete m_lpNumber; m_lpNumber = NULL; }
|
||
if(m_lpStackNumber) { delete m_lpStackNumber; m_lpStackNumber = NULL; }
|
||
if(m_lpCursor) { delete m_lpCursor; m_lpCursor = NULL; }
|
||
|
||
g_TooltipManager.DestroyAllTooltip();
|
||
g_ButtonManager.DestroyAllButton();
|
||
DestroyFullScreen();
|
||
}
|
||
|
||
void CCommonInterface::RenderRect(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned long dwColor, unsigned char cAlpha)
|
||
{
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = dwColor;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = x1;
|
||
pVertices[2].v.x = pVertices[3].v.x = x2;
|
||
pVertices[0].v.y = pVertices[2].v.y = y1;
|
||
pVertices[1].v.y = pVertices[3].v.y = y2;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, NULL);
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|
||
|
||
char *CCommonInterface::GetClassName(unsigned short wClass)
|
||
{
|
||
if(1 <= wClass && wClass <= 24)
|
||
return (char *)&g_StringTable.m_strString[450 + wClass];
|
||
else
|
||
return (char *)&g_StringTable.m_strString[450];
|
||
}
|
||
|
||
void CCommonInterface::RenderNum(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned long dwNum, RECT *lpRect)
|
||
{
|
||
char Temp[MAX_PATH];
|
||
sprintf(Temp, "%d", dwNum);
|
||
g_TextEdit.DrawText(Temp, lpRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||
}
|
||
|
||
BOOL CCommonInterface::InitHelp()
|
||
{
|
||
CreateFullScreen();
|
||
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpFullScreenTexture[0]->Load("help01.dds");
|
||
m_lpFullScreenTexture[1]->Load("help02.dds");
|
||
m_lpFullScreenTexture[2]->Load("help03.dds");
|
||
m_lpFullScreenTexture[3]->Load("help04_08_12.dds");
|
||
m_lpFullScreenTexture[4]->Load("help05.dds");
|
||
m_lpFullScreenTexture[5]->Load("help06.dds");
|
||
m_lpFullScreenTexture[6]->Load("help07.dds");
|
||
m_lpFullScreenTexture[7]->Load("help09_10.dds");
|
||
m_lpFullScreenTexture[8]->Load("help11.dds");
|
||
|
||
m_lpFullScreenSprite[0]->Create(0, 0, 0, 0, 256, 256, m_lpFullScreenTexture[0]);
|
||
m_lpFullScreenSprite[1]->Create(256, 0, 0, 0, 256, 256, m_lpFullScreenTexture[1]);
|
||
m_lpFullScreenSprite[2]->Create(512, 0, 0, 0, 256, 256, m_lpFullScreenTexture[2]);
|
||
m_lpFullScreenSprite[3]->Create(768, 0, 0, 0, 32, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[4]->Create(0, 256, 0, 0, 256, 256, m_lpFullScreenTexture[4]);
|
||
m_lpFullScreenSprite[5]->Create(256, 256, 0, 0, 256, 256, m_lpFullScreenTexture[5]);
|
||
m_lpFullScreenSprite[6]->Create(512, 256, 0, 0, 256, 256, m_lpFullScreenTexture[6]);
|
||
m_lpFullScreenSprite[7]->Create(768, 256, 32, 0, 64, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[8]->Create(0, 512, 0, 0, 256, 88, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[9]->Create(256, 512, 0, 88, 256, 176, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[10]->Create(512, 512, 0, 0, 256, 88, m_lpFullScreenTexture[8]);
|
||
m_lpFullScreenSprite[11]->Create(768, 512, 64, 0, 96, 88, m_lpFullScreenTexture[3]);
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CCommonInterface::RenderHelp(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
}
|
||
|
||
BOOL CCommonInterface::InitLoading(void)
|
||
{
|
||
CreateFullScreen();
|
||
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpFullScreenTexture[0]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[1]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[2]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[3]->Load("ld04_08_12.dds");
|
||
m_lpFullScreenTexture[4]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[5]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[6]->Load("ld01.dds");
|
||
m_lpFullScreenTexture[7]->Load("ld09_10.dds");
|
||
m_lpFullScreenTexture[8]->Load("ld11.dds");
|
||
|
||
m_lpFullScreenSprite[0]->Create(0, 0, 0, 0, 256, 256, m_lpFullScreenTexture[0]);
|
||
m_lpFullScreenSprite[1]->Create(256, 0, 0, 0, 256, 256, m_lpFullScreenTexture[1]);
|
||
m_lpFullScreenSprite[2]->Create(512, 0, 0, 0, 256, 256, m_lpFullScreenTexture[2]);
|
||
m_lpFullScreenSprite[3]->Create(768, 0, 0, 0, 32, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[4]->Create(0, 256, 0, 0, 256, 256, m_lpFullScreenTexture[4]);
|
||
m_lpFullScreenSprite[5]->Create(256, 256, 0, 0, 256, 256, m_lpFullScreenTexture[5]);
|
||
m_lpFullScreenSprite[6]->Create(512, 256, 0, 0, 256, 256, m_lpFullScreenTexture[6]);
|
||
m_lpFullScreenSprite[7]->Create(768, 256, 32, 0, 64, 256, m_lpFullScreenTexture[3]);
|
||
|
||
m_lpFullScreenSprite[8]->Create(0, 512, 0, 0, 256, 88, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[9]->Create(256, 512, 0, 88, 256, 176, m_lpFullScreenTexture[7]);
|
||
m_lpFullScreenSprite[10]->Create(512, 512, 0, 0, 256, 88, m_lpFullScreenTexture[8]);
|
||
m_lpFullScreenSprite[11]->Create(768, 512, 64, 0, 96, 88, m_lpFullScreenTexture[3]);
|
||
|
||
FadeOut();
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CCommonInterface::RenderLoading(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
if(m_lScreenFade < FADE_START) return;
|
||
|
||
// float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
|
||
|
||
if(m_dwFadeMode == FADE_OUT)
|
||
{
|
||
m_lScreenFade -= 3;
|
||
// m_lScreenFade -= fUpdate;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_START)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
} else if(m_dwFadeMode == FADE_IN)
|
||
{
|
||
m_lScreenFade +=3;
|
||
|
||
for(int i = 0; i < 12; i++)
|
||
{
|
||
if(m_lScreenFade > FADE_END)
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice);
|
||
}
|
||
else
|
||
{
|
||
m_lpFullScreenSprite[i]->Render(lpD3DDevice, (unsigned char)(((float)m_lScreenFade / FADE_END) * 255.0f));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::DestroyMain()
|
||
{
|
||
vector<char *>::iterator it;
|
||
char *lpDelete;
|
||
for(it = m_lstNotice.begin(); it != m_lstNotice.end();)
|
||
{
|
||
lpDelete = (*it);
|
||
it = m_lstNotice.erase(it);
|
||
delete[] lpDelete;
|
||
}
|
||
m_lstNotice.clear();
|
||
|
||
DestroyFullScreen();
|
||
delete m_lpMainButton;
|
||
}
|
||
|
||
void CCommonInterface::RenderNumber(LPDIRECT3DDEVICE8 lpD3DDevice, short sPosX, short sPosY, unsigned char cAlpha, unsigned short wMode, long lValue, float fRate)
|
||
{
|
||
if(!m_lpNumber)
|
||
{
|
||
m_lpNumber = new CTexture;
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpNumber->Load("num.dds");
|
||
}
|
||
|
||
char strNum[12];
|
||
itoa(abs(lValue), strNum, 10);
|
||
|
||
switch(wMode)
|
||
{
|
||
case 5: // Critical
|
||
case 6:
|
||
if(strcmp(strNum, ""))
|
||
{
|
||
float fRealX = 23.0f * fRate;
|
||
float fRealY = 29.0f * fRate;
|
||
|
||
int len = strlen(strNum);
|
||
float fPosX = sPosX - len * fRealX / 2.0f;
|
||
float fPosY = sPosY - ((fRealY - 29.0f) / 2.0f);
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + fRealX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + fRealY - 0.5f;
|
||
|
||
pVertices[0].tv = pVertices[2].tv = (92 + ((wMode - 5) * 29.0f)) / 256.0f + 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = (92 + ((wMode - 5) * 29.0f + 29.0f)) / 256.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpNumber->GetTexture());
|
||
|
||
for(int i = 0; i < len; i++)
|
||
{
|
||
pVertices[0].tu = pVertices[1].tu = ((strNum[i] - '0') * 23.0f) / 256.0f + 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = ((strNum[i] - '0') * 23.0f + 23.0f) / 256.0f - 0.0005f;
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
|
||
pVertices[0].v.x += fRealX;
|
||
pVertices[1].v.x += fRealX;
|
||
pVertices[2].v.x += fRealX;
|
||
pVertices[3].v.x += fRealX;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 7: // Block
|
||
case 8:
|
||
{
|
||
float fRealX = 88.0f * fRate;
|
||
float fRealY = 24.0f * fRate;
|
||
|
||
float fPosX = sPosX - fRealX / 2.0f;
|
||
float fPosY = sPosY - ((fRealY - 24.0f) / 2.0f);
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + fRealX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + fRealY - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = 88 / 256.0f - 0.0005f;
|
||
pVertices[0].tv = pVertices[2].tv = (150 + ((wMode - 7) * 24.0f)) / 256.0f - 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = (150 + ((wMode - 7) * 24.0f + 24.0f)) / 256.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpNumber->GetTexture());
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|
||
break;
|
||
|
||
case 9: // Evade
|
||
{
|
||
float fRealX = 110.0f * fRate;
|
||
float fRealY = 25.0f * fRate;
|
||
|
||
float fPosX = sPosX - fRealX / 2.0f;
|
||
float fPosY = sPosY - ((fRealY - 25.0f) / 2.0f);
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + fRealX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + fRealY - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = 110 / 256.0f - 0.0005f;
|
||
pVertices[0].tv = pVertices[2].tv = 198 / 256.0f - 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = 223 / 256.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpNumber->GetTexture());
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|
||
break;
|
||
|
||
case 10: // Resist
|
||
{
|
||
float fRealX = 105.0f * fRate;
|
||
float fRealY = 27.0f * fRate;
|
||
|
||
float fPosX = sPosX - fRealX / 2.0f;
|
||
float fPosY = sPosY - ((fRealY - 27.0f) / 2.0f);
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + fRealX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + fRealY - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = 105 / 256.0f - 0.0005f;
|
||
pVertices[0].tv = pVertices[2].tv = 223 / 256.0f - 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = 250 / 256.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpNumber->GetTexture());
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|
||
break;
|
||
|
||
default: // Normal
|
||
if(strcmp(strNum, ""))
|
||
{
|
||
float fRealX = 21.0f * fRate;
|
||
float fRealY = 23.0f * fRate;
|
||
|
||
int len = strlen(strNum);
|
||
float fPosX = sPosX - len * fRealX / 2.0f;
|
||
float fPosY = sPosY - ((fRealY - 23.0f) / 2.0f);
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + fRealX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + fRealY - 0.5f;
|
||
|
||
pVertices[0].tv = pVertices[2].tv = (wMode * 23.0f) / 256.0f + 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = (wMode * 23.0f + 23.0f) / 256.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpNumber->GetTexture());
|
||
|
||
for(int i = 0; i < len; i++)
|
||
{
|
||
pVertices[0].tu = pVertices[1].tu = ((strNum[i] - '0') * 21.0f) / 256.0f + 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = ((strNum[i] - '0') * 21.0f + 21.0f) / 256.0f - 0.0005f;
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
|
||
pVertices[0].v.x += fRealX;
|
||
pVertices[1].v.x += fRealX;
|
||
pVertices[2].v.x += fRealX;
|
||
pVertices[3].v.x += fRealX;
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::RenderStackNumber(LPDIRECT3DDEVICE8 lpD3DDevice, short sPosX, short sPosY, long lValue)
|
||
{
|
||
if(!m_lpStackNumber)
|
||
{
|
||
m_lpStackNumber = new CTexture;
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpStackNumber->Load("num_stack.dds");
|
||
}
|
||
|
||
char strNum[12];
|
||
itoa(abs(lValue), strNum, 10);
|
||
|
||
if(strcmp(strNum, ""))
|
||
{
|
||
int len = strlen(strNum);
|
||
float fPosX = sPosX - len * 9.0f / 2.0f;
|
||
float fPosY = sPosY;
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = fPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = fPosX + 9.0f - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = fPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = fPosY + 11.0f - 0.5f;
|
||
|
||
pVertices[0].tv = pVertices[2].tv = 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = 11.0f / 16.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpStackNumber->GetTexture());
|
||
|
||
for(int i = 0; i < len; i++)
|
||
{
|
||
pVertices[0].tu = pVertices[1].tu = ((strNum[i] - '0') * 9.0f) / 128.0f + 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = ((strNum[i] - '0') * 9.0f + 9.0f) / 128.0f - 0.0005f;
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
|
||
pVertices[0].v.x += 9.0f;
|
||
pVertices[1].v.x += 9.0f;
|
||
pVertices[2].v.x += 9.0f;
|
||
pVertices[3].v.x += 9.0f;
|
||
}
|
||
}
|
||
}
|
||
|
||
void CCommonInterface::TakeScreenShot(LPDIRECT3DDEVICE8 lpD3DDevice, LPCTSTR strFilename)
|
||
{
|
||
IDirect3DSurface8 *frontbuf; //this is our pointer to the memory location containing our copy of the
|
||
//front buffer
|
||
|
||
//now we create the image that our screen shot will be copied into
|
||
//NOTE: Surface format of the front buffer is D3DFMT_A8R8G8B8 when it is returned
|
||
lpD3DDevice->CreateImageSurface(BaseGraphicsLayer::m_lScreenSx, BaseGraphicsLayer::m_lScreenSy, D3DFMT_A8R8G8B8, &frontbuf);
|
||
|
||
//now we copy the front buffer into our surface
|
||
HRESULT hr = lpD3DDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &frontbuf);
|
||
|
||
//error checking
|
||
if(hr != D3D_OK)
|
||
{
|
||
//do error handling etc...
|
||
frontbuf->Release(); //release the surface so there is no memory leak
|
||
return;
|
||
}
|
||
|
||
//now write our screen shot to a bitmap file
|
||
//the last 2 params are NULL because we want the entire front buffer and no palette
|
||
D3DXSaveSurfaceToFile("c:\\a.bmp", D3DXIFF_BMP, frontbuf, NULL, NULL);
|
||
|
||
// D3DXSaveSurfaceToFile((LPCTSTR)strFilename, D3DXIFF_BMP, frontbuf, NULL, NULL);
|
||
|
||
//release the surface so there is no memory leak
|
||
frontbuf->Release();
|
||
}
|
||
|
||
BOOL CCommonInterface::EncodeJPGFile(LPTSTR lpstrFilename, LPDIRECT3DSURFACE8 lpSurface)
|
||
{
|
||
BOOL bres = TRUE;
|
||
IJLERR jerr;
|
||
// Allocate the IJL JPEG_CORE_PROPERTIES structure.
|
||
JPEG_CORE_PROPERTIES jcprops;
|
||
|
||
// Initialize the IntelR JPEG Library.
|
||
jerr = ijlInit(&jcprops);
|
||
if(IJL_OK != jerr)
|
||
{
|
||
bres = FALSE;
|
||
ijlFree(&jcprops);
|
||
return bres;
|
||
}
|
||
|
||
D3DLOCKED_RECT drRect;
|
||
D3DSURFACE_DESC ddDesc;
|
||
unsigned long *lpColors;
|
||
lpSurface->GetDesc(&ddDesc);
|
||
RECT rcRect = { 0, 0, ddDesc.Width, ddDesc.Height };
|
||
lpSurface->LockRect(&drRect, &rcRect, D3DLOCK_READONLY);
|
||
lpColors = (unsigned long *)drRect.pBits;
|
||
|
||
unsigned long dwTemp;
|
||
for(int j = 0; j < ddDesc.Height; j++)
|
||
{
|
||
for(int i = 0; i < ddDesc.Width; i++)
|
||
{
|
||
dwTemp = *lpColors;
|
||
*lpColors = ((unsigned char)(dwTemp >> 24) << 24);
|
||
*lpColors += (unsigned char)(dwTemp >> 16);
|
||
*lpColors += ((unsigned char)(dwTemp >> 8) << 8);
|
||
*lpColors += ((unsigned char)(dwTemp) << 16);
|
||
lpColors++;
|
||
}
|
||
}
|
||
|
||
// Set up information to write from the pixel buffer.
|
||
jcprops.DIBWidth = ddDesc.Width;
|
||
jcprops.DIBHeight = ddDesc.Height; // Implies a bottom-up DIB.
|
||
jcprops.DIBBytes = (unsigned char *)drRect.pBits;
|
||
jcprops.DIBPadBytes = 0;
|
||
// Note: the following are default values and thus
|
||
// do not need to be set.
|
||
jcprops.DIBChannels = 4;
|
||
jcprops.DIBColor = IJL_RGB;
|
||
|
||
jcprops.JPGFile = const_cast<LPSTR>(lpstrFilename);
|
||
// Specify JPEG file creation parameters.
|
||
jcprops.JPGWidth = ddDesc.Width;
|
||
jcprops.JPGHeight = ddDesc.Height;
|
||
// Note: the following are default values and thus
|
||
// do not need to be set.
|
||
jcprops.JPGChannels = 3;
|
||
jcprops.JPGColor = IJL_YCBCR;
|
||
jcprops.JPGSubsampling = IJL_422; // 4:2:2 subsampling.
|
||
jcprops.jquality = 75; // Select "good" image quality
|
||
// Write the actual JPEG image from the pixel buffer.
|
||
jerr = ijlWrite(&jcprops, IJL_JFILE_WRITEWHOLEIMAGE);
|
||
|
||
lpSurface->UnlockRect();
|
||
|
||
if(IJL_OK != jerr)
|
||
{
|
||
bres = FALSE;
|
||
}
|
||
|
||
ijlFree(&jcprops);
|
||
return bres;
|
||
}
|
||
|
||
void CCommonInterface::RenderCursor(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned short wPosX, unsigned short wPosY, unsigned long dwKindCursor, unsigned char cAlpha)
|
||
{
|
||
if(!m_lpCursor)
|
||
{
|
||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||
m_lpCursor = new CTexture;
|
||
m_lpCursor->Load("cursor.dds");
|
||
}
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Diffuse.a = pVertices[1].Diffuse.a = pVertices[2].Diffuse.a = pVertices[3].Diffuse.a = cAlpha;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = wPosX - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = wPosX + 32.0f - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = wPosY - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = wPosY + 32.0f - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = (dwKindCursor * 32.0f) / 256.0f + 0.0005f;
|
||
pVertices[2].tu = pVertices[3].tu = (dwKindCursor * 32.0f + 32.0f) / 256.0f - 0.0005f;
|
||
|
||
pVertices[0].tv = pVertices[2].tv = 0.0f + 0.0005f;
|
||
pVertices[1].tv = pVertices[3].tv = 1.0f - 0.0005f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->SetTexture(0, m_lpCursor->GetTexture());
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|