Ejemplo n.º 1
0
CMainMenu::CMainMenu	()
{
	m_Flags.zero					();
	m_startDialog					= NULL;
	m_screenshotFrame				= u32(-1);
	g_pGamePersistent->m_pMainMenu	= this;
	if (Device.b_is_Ready)			OnDeviceCreate();  	
	ReadTextureInfo					();
	CUIXmlInit::InitColorDefs		();
	g_btnHint						= NULL;
	g_statHint						= NULL;
	m_deactivated_frame				= 0;	
	
	m_sPatchURL						= "";
	m_pGameSpyFull					= NULL;
	m_account_mngr					= NULL;
	m_login_mngr					= NULL;
	m_profile_store					= NULL;
	m_stats_submitter				= NULL;
	m_atlas_submit_queue			= NULL;

	m_sPDProgress.IsInProgress		= false;
	m_downloaded_mp_map_url._set	("");

	//-------------------------------------------

	m_NeedErrDialog					= ErrNoError;
	m_start_time					= 0;

	GetPlayerName					();
	GetCDKeyFromRegistry			();
	m_demo_info_loader				= NULL;

	if(!g_dedicated_server)
	{
		g_btnHint						= xr_new<CUIButtonHint>();
		g_statHint						= xr_new<CUIButtonHint>();
		m_pGameSpyFull					= xr_new<CGameSpy_Full>();
		
		for (u32 i=0; i<u32(ErrMax); i++)
		{
			CUIMessageBoxEx*			pNewErrDlg;
			INIT_MSGBOX					(pNewErrDlg, ErrMsgBoxTemplate[i]);
			m_pMB_ErrDlgs.push_back		(pNewErrDlg);
		}

		m_pMB_ErrDlgs[PatchDownloadSuccess]->AddCallbackStr("button_yes", MESSAGE_BOX_YES_CLICKED, CUIWndCallback::void_function(this, &CMainMenu::OnRunDownloadedPatch));
		m_pMB_ErrDlgs[PatchDownloadSuccess]->AddCallbackStr("button_yes", MESSAGE_BOX_OK_CLICKED, CUIWndCallback::void_function(this, &CMainMenu::OnConnectToMasterServerOkClicked));

		m_pMB_ErrDlgs[DownloadMPMap]->AddCallbackStr("button_copy", MESSAGE_BOX_COPY_CLICKED, CUIWndCallback::void_function(this, &CMainMenu::OnDownloadMPMap_CopyURL));
		m_pMB_ErrDlgs[DownloadMPMap]->AddCallbackStr("button_yes", MESSAGE_BOX_YES_CLICKED, CUIWndCallback::void_function(this, &CMainMenu::OnDownloadMPMap));

		m_account_mngr			= xr_new<gamespy_gp::account_manager>		(m_pGameSpyFull->GetGameSpyGP());
		m_login_mngr			= xr_new<gamespy_gp::login_manager>			(m_pGameSpyFull);
		m_profile_store			= xr_new<gamespy_profile::profile_store>	(m_pGameSpyFull);
		m_stats_submitter		= xr_new<gamespy_profile::stats_submitter>	(m_pGameSpyFull);
		m_atlas_submit_queue	= xr_new<atlas_submit_queue>				(m_stats_submitter);
	}
	
	Device.seqFrame.Add		(this,REG_PRIORITY_LOW-1000);
}
Ejemplo n.º 2
0
void clsMaterialHeader::ReadMaterialSegment(int index){
	u32 ReadBytes=0;
	u32 i=0;

	unsigned char* pnt=&MaterialSegments[index].front();
	mGroup* ThisSegment=&MaterialSegment[index];
	memcpy(&ThisSegment->groupheader,&pnt[ReadBytes],4);
	toDWORD((u32&)ThisSegment->groupheader);
	ReadBytes+=4;
	ReadBytes+=ReadTextureInfo(&ThisSegment->info,&pnt[ReadBytes]);
	if(fVersion==MP1){	
		memcpy(&ThisSegment->unknown0,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->unknown0);
		ReadBytes+=4;
		memcpy(&ThisSegment->unknown1,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->unknown1);
		ReadBytes+=4;
		/*								if ((unknown0x00 & 0xF) == 0xB)
		{

		}  leaving this segment from the bt out and just adding the sizes together to the current function
		you can implement if you want
		*/

		if ((ThisSegment->groupheader & 0x4000) != 0x0000)
			{
			
				memcpy(&ThisSegment->unknown0a[0],&pnt[ReadBytes],4);
		        toDWORD((u32&)ThisSegment->unknown1);
				ReadBytes+=4;
				memcpy(&ThisSegment->unknown0a[1],&pnt[ReadBytes],4);
		       toDWORD((u32&)ThisSegment->unknown1);
				ReadBytes+=4;
			}
		if ((ThisSegment->groupheader & 0xD00) == 0xD00)
			{
			
				memcpy(&ThisSegment->unknown1a,&pnt[ReadBytes],4);
		        toDWORD((u32&)ThisSegment->unknown1);
				ReadBytes+=4;
			}
								// unsure, this is just a hack for now
								// need to determine if this is present under any other circumstances

		if ((ThisSegment->groupheader & 0x08) != 0x00){

			memcpy(&ThisSegment->unknownCount0,&pnt[ReadBytes],4);
			toDWORD((u32&)ThisSegment->unknownCount0);
			ThisSegment->unknownData0.resize(ThisSegment->unknownCount0);
			ReadBytes+=4;
			for(i=0;i<ThisSegment->unknownCount0;i++){
				memcpy(&ThisSegment->unknownData0[i],&pnt[ReadBytes],4);
				toDWORD((u32&)ThisSegment->unknownData0[i]);
				ReadBytes+=4;
			}
		}
		for(i=0;i<3;i++){
			memcpy(&ThisSegment->unknown2[i],&pnt[ReadBytes],4);
			toDWORD((u32&)ThisSegment->unknown2[i]);
			ReadBytes+=4;

		}
		//Read Attribute info
		memcpy(&ThisSegment->AttribCount,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->AttribCount);
		ReadBytes+=4;
		ThisSegment->Attributes.resize(ThisSegment->AttribCount);
		if(ThisSegment->AttribCount<10)ThisSegment->unknown4.resize(ThisSegment->AttribCount);
		for(i=0;i<ThisSegment->AttribCount;i++){
			memcpy(&ThisSegment->Attributes[i],&pnt[ReadBytes],20);//Struct size is 20 bytes
			//u8  Unknown0;
			//u8  Blend;
			//u8  Unknown1;
			//u8  Unknown2;
			toWORD((u16&)ThisSegment->Attributes[i].BlendNumber);
			toWORD((u16&)ThisSegment->Attributes[i].BlendType);
			ReadBytes+=20;


		}
		for(i=0;i<ThisSegment->AttribCount;i++){
			memcpy(&ThisSegment->unknown4[i],&pnt[ReadBytes],4);
			ReadBytes+=4;

		}
		memcpy(&ThisSegment->LayerInfo,&pnt[ReadBytes],4);
		ReadBytes+=4;
		toDWORD((u32&)ThisSegment->LayerInfo);
		ThisSegment->LayerData.resize(ThisSegment->LayerInfo);
		for(i=0;i<ThisSegment->LayerInfo;i++){
			memcpy(&ThisSegment->LayerData[i],&pnt[ReadBytes],4);
			toDWORD((u32&)ThisSegment->LayerData[i]);
			ReadBytes+=4;


		}
		memcpy(&ThisSegment->unknownsize,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->unknownsize);
		ReadBytes+=4;
		memcpy(&ThisSegment->unknown5,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->unknown5);
		ReadBytes+=4;
		memcpy(&ThisSegment->unknown6,&pnt[ReadBytes],4);
		toDWORD((u32&)ThisSegment->unknown6);

	}
	return;
}