예제 #1
0
void SrSaveLvlListInfo (CSrLvlListInfoArray& InfoArray, CSrLvspRecord& Record)
{
	CSrSubrecord* pSubrecord;

	Record.DeleteSubrecords(SR_NAME_LLCT);
	Record.DeleteSubrecords(SR_NAME_LVLO);
	Record.DeleteSubrecords(SR_NAME_COED);

	Record.AddInitNewSubrecord(SR_NAME_LLCT);

	for (dword i = 0; i < InfoArray.GetSize(); ++i)
	{
		srlvllistinfo_t& Info = *InfoArray[i];
		if (Info.pLvlo == NULL) continue;

		pSubrecord = Record.AddInitNewSubrecord(SR_NAME_LVLO);
		pSubrecord->Copy(Info.pLvlo);

		if (Info.pCoed != NULL)
		{
			pSubrecord = Record.AddInitNewSubrecord(SR_NAME_COED);
			pSubrecord->Copy(Info.pCoed);
		}
	}

	Record.UpdateListCount();
}
예제 #2
0
void CSrScrlView::GetControlData (void)
{
	CSrSubrecord* pNewEffect;
	CSrSubrecord* pNewEffectData;
	CSrSubrecord* pNewCondition;
	
	CSrRecordDialog::GetControlData();
	GetCurrentEffect();

	CSrScrlRecord* pScroll = SrCastClassNull(CSrScrlRecord, GetOutputRecord());
	if (pScroll == NULL) return;

	pScroll->DeleteSubrecords(SR_NAME_EFID);
	pScroll->DeleteSubrecords(SR_NAME_EFIT);
	pScroll->DeleteSubrecords(SR_NAME_CTDA);	
	pScroll->DeleteSubrecords(SR_NAME_CIS1);
	pScroll->DeleteSubrecords(SR_NAME_CIS2);

	for (dword i = 0; i < m_Effects.GetSize(); ++i)
	{
		srscrl_effectdata_t* pEffect = m_Effects[i];
		if (pEffect == NULL || pEffect->pEffect == NULL || pEffect->pEffectData == NULL) continue;
				
		pNewEffect = pScroll->AddNewSubrecord(SR_NAME_EFID);
		if (pNewEffect) pNewEffect->Copy(pEffect->pEffect);

		pNewEffectData = pScroll->AddNewSubrecord(SR_NAME_EFIT);
		if (pNewEffectData) pNewEffectData->Copy(pEffect->pEffectData);

		for (dword j = 0; j < pEffect->Conditions.GetSize(); ++j)
		{
			srconditioninfo_t* pCondInfo = pEffect->Conditions[j];
			CSrCtdaSubrecord* pCondition = &pCondInfo->Condition;
			if (pCondition == NULL) continue;

			pNewCondition = pScroll->AddNewSubrecord(SR_NAME_CTDA);
			if (pNewCondition) pNewCondition->Copy(pCondition);

			if (pCondInfo->pParam1)
			{
				CSrSubrecord* pNewParam = pScroll->AddNewSubrecord(SR_NAME_CIS1);
				if (pNewParam) pNewParam->Copy(pCondInfo->pParam1);
			}

			if (pCondInfo->pParam2)
			{
				CSrSubrecord* pNewParam = pScroll->AddNewSubrecord(SR_NAME_CIS2);
				if (pNewParam) pNewParam->Copy(pCondInfo->pParam2);
			}
		}

	}
}