mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
75 lines
1.4 KiB
C++
75 lines
1.4 KiB
C++
|
|
#include "main.h"
|
|
|
|
CIntArray::~CIntArray()
|
|
{
|
|
SetSize(0);
|
|
}
|
|
|
|
bool CIntArray::SetSize(unsigned int nSize)
|
|
{
|
|
if(!nSize) {
|
|
if(m_pData) {
|
|
free(m_pData);
|
|
m_pData = NULL;
|
|
}
|
|
m_nSize = 0;
|
|
return true;
|
|
}
|
|
|
|
int *pNew = (int *)realloc(m_pData, nSize * sizeof(int));
|
|
if(!pNew) return false;
|
|
|
|
m_pData = pNew;
|
|
if(m_nSize < nSize) {
|
|
for(unsigned int i = m_nSize; i != nSize; i++)
|
|
m_pData[i] = 0;
|
|
}
|
|
|
|
m_nSize = nSize;
|
|
return true;
|
|
}
|
|
|
|
CUnkClass5::CUnkClass5(IDirect3DDevice9 *pD3DDevice)
|
|
{
|
|
m_pD3DDevice = pD3DDevice;
|
|
m_pDialog = NULL;
|
|
field_30 = 0;
|
|
field_14 = 640;
|
|
field_18 = 300;
|
|
field_1C = 210;
|
|
field_20 = 30;
|
|
field_34 = 3;
|
|
|
|
strcpy(field_38, "Type");
|
|
strcpy(field_B9, "ID");
|
|
strcpy(field_13A, "Progress");
|
|
|
|
field_23C = 180;
|
|
field_240 = 220;
|
|
field_24C = 0;
|
|
field_250 = -1;
|
|
field_254 = RakNet::GetTime();
|
|
field_25C = 0;
|
|
field_258 = 0;
|
|
}
|
|
|
|
void CUnkClass5::ResetDialogControls(CDXUTDialog *pDialog)
|
|
{
|
|
m_pDialog = pDialog;
|
|
|
|
if(pDialog) {
|
|
m_pListBox = new CDXUTListBox(m_pDialog);
|
|
m_pDialog->AddControl(m_pListBox);
|
|
m_pListBox->SetLocation(2,2);
|
|
m_pListBox->SetSize(field_14-4,field_18-35);
|
|
m_pListBox->OnInit();
|
|
m_pListBox->GetElement(0)->TextureColor.Init(D3DCOLOR_ARGB( 200, 255, 255, 255 ));
|
|
m_pListBox->SetEnabled(false);
|
|
m_pListBox->SetVisible(false);
|
|
m_pListBox->field_4D = 2;
|
|
m_pListBox->field_51[0] = field_23C;
|
|
m_pListBox->field_51[1] = field_240;
|
|
}
|
|
}
|