当前位置: 首页>>代码示例>>C++>>正文


C++ FitIniFile::seekBlock方法代码示例

本文整理汇总了C++中FitIniFile::seekBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ FitIniFile::seekBlock方法的具体用法?C++ FitIniFile::seekBlock怎么用?C++ FitIniFile::seekBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FitIniFile的用法示例。


在下文中一共展示了FitIniFile::seekBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

int32_t LogisticsSaveDialog::init(FitIniFile& file)
{
	if (!s_instance)
	{
		s_instance = new LogisticsSaveDialog();
		((LogisticsScreen*)s_instance)->init(file, "Static", "Text", "Rect", "Button");
		file.seekBlock("InAnim");
		s_instance->enterAnim.init(&file, "");
		file.seekBlock("OutAnim");
		s_instance->exitAnim.init(&file, "");
		s_instance->gameListBox.init(s_instance->rects[1].globalX(), s_instance->rects[1].globalY(),
			s_instance->rects[1].width(), s_instance->rects[1].height());
		s_instance->gameListBox.setTopSkip(3);
		s_instance->gameListBox.setOrange(true);
		for (size_t i = 0; i < s_instance->buttonCount; i++)
			s_instance->buttons[i].setMessageOnRelease();
		s_instance->templateItem.init(&file, "AnimText");
		s_instance->templateItem.resize(
			s_instance->gameListBox.width() - 30, s_instance->templateItem.height());
		for (i = 0; i < s_instance->editCount; i++)
		{
			s_instance->edits[i].allowWierdChars(0);
		}
	}
	s_instance->getButton(YES)->setPressFX(LOG_NEXTBACKBUTTONS);
	return 0;
}
开发者ID:mechasource,项目名称:mechcommander2,代码行数:27,代码来源:logisticsdialog.cpp

示例2: init

int LogisticsVariantDialog::init( FitIniFile& file )
{
	LogisticsScreen::init( file, "Static", "Text", "Rect", "Button", "Edit");

		file.seekBlock( "InAnim" );
		enterAnim.init( &file, "" );
		file.seekBlock( "OutAnim" );
		exitAnim.init( &file, "" );

		gameListBox.init( rects[1].globalX(), 
			rects[1].globalY(), 
			rects[1].width(),
			rects[1].height() );

		gameListBox.setOrange(true);

		for ( int i = 0; i < buttonCount; i++ )
			buttons[i].setMessageOnRelease();

	edits[0].limitEntry( 14 );

	templateItem.init( file, "AnimText" );

	for ( i = 0; i < editCount; i++ )
	{
		edits[i].allowWierdChars( 0 );
	}
	return 0;		
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:29,代码来源:LogisticsDialog.cpp

示例3: Read

bool CCampaignData::Read(CString pathName) {
	FitIniFile fitFile;
	int result = fitFile.open(pathName.GetBuffer(0));
	if (NO_ERR != result) { assert(false); return false; }

	result = fitFile.seekBlock("Campaign");
	if (NO_ERR != result) { assert(false); }
	result = sReadIdString(fitFile, "CampaignName", m_Name);
	if (NO_ERR == result) { m_NameUseResourceString = false; }
	result = sReadIdInteger(fitFile, "NameID", m_NameResourceStringID);
	if (NO_ERR == result) { m_NameUseResourceString = true; }
	result = sReadIdBoolean(fitFile, "NameUseResourceString", m_NameUseResourceString);
	result = sReadIdInteger(fitFile, "CBills", m_CBills);
	result = sReadIdString(fitFile, "FinalVideo", m_FinalVideo);
	int groupCount = 0;
	result = sReadIdInteger(fitFile, "GroupCount", groupCount);
	if (NO_ERR != result) { return false; }

	int index;
	for (index = 0; groupCount > index; index+=1) {
		ECharString blockName;
		blockName.Format("Group%d", index);
		result = fitFile.seekBlock(blockName.Data());
		if (NO_ERR != result) { assert(false); continue; }
		CGroupData groupData;
		bool bresult = groupData.Read(fitFile, blockName.Data());
		if (true != bresult) { assert(false); continue; }
		m_GroupList.Append(groupData);
	}

	fitFile.close();
	return true;
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例4: OnMiPurchaseFileBrowseButton

void CMissionDialog::OnMiPurchaseFileBrowseButton() {
	UpdateData(TRUE);
	while (true) {
		CFileDialog selectFileDialog(TRUE,_T("FIT"),_T("*.FIT"),
						 OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_NOCHANGEDIR,
						 _T("FIT File (*.FIT)|*.FIT|"));
		selectFileDialog.m_ofn.lpstrInitialDir = missionPath;
		if( selectFileDialog.DoModal()==IDOK ) {
			CString purchasePath = selectFileDialog.GetPathName();
			FitIniFile file;
			long result = 0;
			result = file.open( (char*)(const char*)purchasePath );
			if (NO_ERR != result) {
				AfxMessageBox(IDS_COULDNT_OPEN_PURCHASE_FILE);
			} else {
				long result = 0;
				result = file.seekBlock("Mechs");
				if (NO_ERR != result)
				{
					AfxMessageBox(IDS_NOT_A_VALID_PURCHASE_FILE);
				}
				file.close();
			}
			m_PurchaseFileEdit = selectFileDialog.GetFileTitle();
			break;
		} else {
			break;
		}
	}
	UpdateData(FALSE);
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:31,代码来源:missiondialog.cpp

示例5: init

void aAnimButton::init( FitIniFile& file, const char* headerName, HGOSFONT3D font )
{
	if ( NO_ERR != file.seekBlock( headerName ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't find block %s in file %s", headerName, file.getFilename() );
		Assert( 0, 0, errorStr );
		animateBmp = 0;
		animateText = 0;
		return;
	}
	aButton::init( file, headerName, font );
	normalData.init( &file, "Normal" );
	pressedData.init( &file, "Pressed" );
	highlightData.init( &file, "Highlight" );
	disabledData.init( &file, "Disabled" );
	normalData.begin();

	if ( NO_ERR != file.readIdBoolean( "AnimateBmp", animateBmp ) )
		animateBmp = 1;
	if ( NO_ERR != file.readIdBoolean( "AnimateText", animateText ) )
		animateText = 1;

	bool bTmp = 0;
	if ( NO_ERR == file.readIdBoolean( "AnimateChildren", bTmp  ) )
	{
		bAnimateChildren = bTmp;
	}
	
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例6: isCorrectVersionSaveGame

bool LogisticsSaveDialog::isCorrectVersionSaveGame( char* fileName )
{
	FullPathFileName path;
	path.init( savePath, fileName, ".fit" );

	FitIniFile file;

	if ( NO_ERR != file.open( (char*)(const char*)path ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't open file %s", path );
		STOP((errorStr));
	}

	
	long result = file.seekBlock( "Version" );
	if (result != NO_ERR)
		return false;

	long testVersionNum = 0;
	result = file.readIdLong( "VersionNumber", testVersionNum );
	if ( (result == NO_ERR) && (testVersionNum == SaveGameVersionNumber))
		return true;

	return false;
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:26,代码来源:LogisticsDialog.cpp

示例7: init

long LightType::init (FilePtr objFile, unsigned long fileSize) {

	long result = 0;
	
	FitIniFile explFile;
	result = explFile.open(objFile,fileSize);
	if (result != NO_ERR)
		return(result);

	result = explFile.seekBlock("LightData");
	if (result != NO_ERR)
		return result;

	result = explFile.readIdBoolean("OneShotFlag",oneShotFlag);
	if (result != NO_ERR)
		return result;

	result = explFile.readIdFloat("AltitudeOffset",altitudeOffset);
	if (result != NO_ERR)
		return result;

	//------------------------------------------------------------------
	// Initialize the base object Type from the current file.
	result = ObjectType::init(&explFile);
	return(result);
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:26,代码来源:light.cpp

示例8: updateCampaignMissionInfo

void LogisticsSaveDialog::updateCampaignMissionInfo()
{

	FitIniFile file;
	FullPathFileName path;
	path.init( campaignPath, selectedName, ".fit" );
	if ( NO_ERR != file.open( path ) )
	{
		Assert( 0, 0, "coudln't find the campaign file\n" );
	}

	char fileName[256];

	if ( NO_ERR == file.seekBlock( "Group0Mission0" ) )
	{
		if ( NO_ERR != file.readIdString( "FileName", fileName, 1023 ) )
		{				
			setMission( "" );
		}		
		else
		{
			setMission( fileName );
		}
	}	
	else
		setMission( "" );

}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:28,代码来源:LogisticsDialog.cpp

示例9: readCampaignNameFromFile

void LogisticsSaveDialog::readCampaignNameFromFile( char* fileName, char* resultName, long len )
{
	FullPathFileName path;
	path.init( campaignPath, fileName, ".fit" );

	FitIniFile file;

	if ( NO_ERR != file.open( (char*)(const char*)path ) )
	{
		char errorStr[256];
		sprintf( errorStr, "couldn't open file %s", path );
		Assert( 0, 0, errorStr );
	}

	
	long result = file.seekBlock( "Campaign" );
	Assert( result == NO_ERR, 0, "Coudln't find the mission settings block in the mission file" );

	resultName[0] = 0;
	long lName = 0;

	result = file.readIdLong( "NameID", lName );
	if ( result == NO_ERR )
	{
		cLoadString( lName, resultName, len );
	}
	else
	{
		result = file.readIdString( "CampaignName", resultName, len );
		Assert( result == NO_ERR, 0, "couldn't find the missionName" );
	}
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:32,代码来源:LogisticsDialog.cpp

示例10: initColorTables

//----------------------------------------------------------------------------------
void initColorTables (void)
{
	FullPathFileName colorPath;
	colorPath.init(cameraPath,"colors",".fit");

	FitIniFile colorFile;
	long result = colorFile.open(colorPath);
	gosASSERT(result == NO_ERR);

	result = colorFile.seekBlock("Main");
	gosASSERT(result == NO_ERR);

	result = colorFile.readIdLong("NumTables",numColorRGBTables);
	gosASSERT(result == NO_ERR);

	colorRGBLookup = (DWORD **)systemHeap->Malloc(sizeof(DWORD *) * numColorRGBTables);
	gosASSERT(colorRGBLookup != NULL);

	memset(colorRGBLookup,0,sizeof(DWORD *) * numColorRGBTables);

	for (long i=0;i<numColorRGBTables;i++)
	{
		char tableBlock[256];
		sprintf(tableBlock,"Table%d",i);

		result = colorFile.seekBlock(tableBlock);
		gosASSERT(result == NO_ERR);

		colorRGBLookup[i] = (DWORD *)systemHeap->Malloc(sizeof(DWORD) * MAX_COLOR_ENTRIES);
		gosASSERT(colorRGBLookup[i] != NULL);

		DWORD *table = colorRGBLookup[i];

		for (long j=0;j<MAX_COLOR_ENTRIES;j++)
		{
			char colorBlock[256];
			sprintf(colorBlock,"Color%d",j);

			result = colorFile.readIdULong(colorBlock,table[j]);
			gosASSERT(result == NO_ERR);
		}
	}

	colorFile.close();
}	
开发者ID:,项目名称:,代码行数:46,代码来源:

示例11: init

void MechListBoxItem::init( FitIniFile& file )
{
	if ( !s_templateItem )
	{
		s_templateItem = new MechListBoxItem( NULL, 0 );
		file.seekBlock( "MainBox" );

		long width, height;

		file.readIdLong( "Width", width );
		file.readIdLong( "Height", height );

		((aObject*)s_templateItem)->init( 0, 0, width, height );

		memset( s_templateItem->animationIDs, 0, sizeof(long) * 9  );

		// rects
		s_templateItem->line.init( &file, "Rect1" );
		s_templateItem->outline.init( &file, "Rect0" );

		long curAnim = 0;
		// statics
		s_templateItem->weightIcon.init( &file, "Static0" );
		assignAnimation( file, curAnim );
	
		s_templateItem->mechIcon.init( &file, "Static1" );
		assignAnimation( file, curAnim );
		s_templateItem->costIcon.init( &file, "Static2" );
		assignAnimation( file, curAnim );

		// texts
		s_templateItem->chassisName.init( &file, "Text0" );
		assignAnimation( file, curAnim );
		s_templateItem->weightText.init( &file, "Text1" );
		assignAnimation( file, curAnim );
		s_templateItem->countText.init( &file, "Text2" );
		assignAnimation( file, curAnim );
		s_templateItem->variantName.init( &file, "Text3" );
		assignAnimation( file, curAnim );
		s_templateItem->costText.init( &file, "Text4" );
		assignAnimation( file, curAnim );

		char blockName[64];
		for ( int i = 0; i < 4; i++ )
		{
			sprintf( blockName, "OrangeAnimation%ld", i );
			s_templateItem->animations[1][i].init( &file, blockName );
			sprintf( blockName, "Animation%ld", i );
			s_templateItem->animations[0][i].init( &file, blockName );
		}
		
	}

}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:54,代码来源:MechListBox.cpp

示例12: init

void MPGameBrowser::init(FitIniFile* file)
{
	LogisticsScreen::init( *file, "Static", "Text", "Rect", "Button" );

	if ( buttonCount )
	{
		for ( int i = 0; i < buttonCount; i++ )
		{
			buttons[i].setMessageOnRelease();
			if (buttons[i].getID() == 0)
			{
				buttons[i].setID(FIRST_BUTTON_ID + i);
				buttons[i].setPressFX( LOG_VIDEOBUTTONS );
				buttons[i].setHighlightFX( LOG_DIGITALHIGHLIGHT );
				buttons[i].setDisabledFX( LOG_WRONGBUTTON );
			}
		}
	}


	{
		char path[256];
		strcpy( path, artPath );
		strcat( path, "mcl_mp_lanbrowsercombobox0.fit" );
		
		FitIniFile PNfile;
		if ( NO_ERR != PNfile.open( path ) )
		{
			char error[256];
			sprintf( error, "couldn't open file %s", path );
			Assert( 0, 0, error );
			return;
		}
		
		PNfile.seekBlock("GameList"); /*for some reason aListBox::init(...) doesn't do the seekBlock itself*/
		gameList.init(&PNfile, "GameList");

		gameList.SelectItem(0);
		gameList.init( rects[0].left(), rects[0].top(), rects[0].width(), rects[0].height() );
		gameList.setOrange( true );

		templateItem.init(&PNfile, "GameListItem");

		for ( int i = 0; i < 256; i++ )
		{
			items[i] = templateItem;
		}

	}


	hostDlg.init();
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:53,代码来源:MPGameBrowser.cpp

示例13: setMission

void LogisticsSaveDialog::setMission( const char* fileName)
{
	if ( strlen( fileName ) )
	{

		long textureHandle = MissionBriefingScreen::getMissionTGA( fileName );

		statics[MAP_STATIC].setTexture( textureHandle );
		statics[MAP_STATIC].setUVs( 0, 127, 127, 0);
		statics[MAP_STATIC].setColor( 0xffffffff );

		FullPathFileName path;
		FitIniFile file;

		path.init( missionPath, fileName, ".fit" );

		if ( NO_ERR == file.open( path ) )
		{
			char missionName[256];
			missionName[0] = 0;
			bool bRes = 0;

			file.seekBlock( "MissionSettings" );
			file.readIdBoolean( "MissionNameUseResourceString", bRes );
			if ( bRes )
			{
				unsigned long lRes;
				file.readIdULong( "MissionNameResourceStringID", lRes );
				cLoadString(lRes, missionName, 255);
			}
			else
			{
				file.readIdString("MissionName", missionName, 255);
			}

			textObjects[2].setText(missionName);

		}
		else
		{
			textObjects[2].setText( "" );
		}

	}
	else
	{
		statics[MAP_STATIC].setColor( 0 );
		textObjects[2].setText( "" );

	}

}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:52,代码来源:LogisticsDialog.cpp

示例14: init

void LogisticsVehicle::init(FitIniFile& file)
{
	componentCount = 0;
	file.seekBlock("ObjectType");
	char tmp[256];
	file.readIdString("AppearanceName", tmp, 255);
	fileName = tmp;
	file.seekBlock("General");
	file.readIdLong("DescIndex", chassisNameID);
	file.readIdFloat("CurTonnage", maxWeight);
	char tmpWeightClass[256];
	cLoadString(IDS_VEHICLE_CLASS, tmpWeightClass, 256);
	mechClass = tmpWeightClass;
	if(NO_ERROR != file.readIdLong("HouseID", houseID))
	{
		houseID = -1;
	}
	if(NO_ERROR != file.readIdLong("EncyclopediaID", encyclopediaID))
	{
		encyclopediaID = IDS_VEHICLE_DESCRIPTION_0;
	}
	file.seekBlock("VehicleDynamics");
	file.readIdFloat("MaxVelocity", speed);
	PSTR parts[5] = { "Front", "Left", "Right", "Rear", "Turret" };
	baseArmor = 0;
	uint8_t pts;
	int32_t i;
	for(i = 0; i < 5; i++)
	{
		file.seekBlock(parts[i]);
		file.readIdUChar("MaxArmorPoints", pts);
		baseArmor += pts;
		file.readIdUChar("CurInternalStructure", pts);
		baseArmor += pts;
	}
	file.seekBlock("InventoryInfo");
	file.readIdUChar("NumWeapons", pts);
	char blockName[256];
	for(i = 4; i < 4 + pts; i++)
	{
		sprintf(blockName, "Item:%ld", i);
		if(NO_ERROR == file.seekBlock(blockName))
		{
			uint8_t fitID;
			file.readIdUChar("MasterID", fitID);
			LogisticsComponent* pComponent = LogisticsData::instance->getComponent(fitID);
			if(pComponent)
			{
				components[componentCount].component = pComponent;
				components[componentCount].xCoord = 0;
				components[componentCount].yCoord = 0;
				componentCount++;
			}
		}
	}
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:56,代码来源:logisticsvariant.cpp

示例15: init

void PilotPromotionArea::init( FitIniFile& file )
{


	areaLeft.init( file, "PromoteGadgetLeftStatic", "PromoteGadgetLeftText",
		"PromoteGadgetLeftRect", NULL );

	areaRight.init( file, "PromoteGadgetRightStatic", "PromoteGadgetRightText",
		"PromoteGadgetRightRect", "PromoteGadgetRightButton" );

	file.seekBlock( "PromoteGadgetLeftEnterAnimation" );
	leftInfo.init( &file, "" );
	file.seekBlock( "PromoteGadgetRightEnterAnimation" );
	rightInfo.init( &file, "" );

	file.seekBlock( "PromoteGadgetLeftExitAnimation");
	leftExitInfo.init( &file, "" );
	file.seekBlock( "PromoteGadgetRightExitAnimation" );
	rightExitInfo.init( &file, "" );

	SpecialtyListItem::init( &file );

	char buffer[32];
	for ( int i = 0; i < 4; i++ )
	{
		sprintf( buffer, "PromoteGadgetLeftSkillMeter%ld", i );
		attributeMeters[i].init( &file, buffer );
		attributeMeters[i].setAddedColorMax( 0xffffffff );
		attributeMeters[i].setAddedColorMin( 0xffffffff );
	}

	file.seekBlock( "SkillSelectionAnimation" );
	selSkillAnim.init(&file, "" );

	pilot = NULL;
}
开发者ID:Echelon9,项目名称:mechcommander2-open,代码行数:36,代码来源:PilotReviewArea.cpp


注:本文中的FitIniFile::seekBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。