Пример #1
0
void ParticleEditor::SaveAs()
{
	char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH];
	if (SaveSystem(path, file))
	{
		strcpy(path, ETHGlobal::AppendExtensionIfNeeded(path, ".par").c_str());

		TiXmlDocument doc;
		TiXmlDeclaration *pDecl = new TiXmlDeclaration(GS_L("1.0"), GS_L(""), GS_L(""));
		doc.LinkEndChild(pDecl);

		TiXmlElement *pElement = new TiXmlElement(GS_L("Ethanon"));
		doc.LinkEndChild(pElement);

		m_system.WriteToXMLFile(doc.RootElement());
		const str_type::string filePath = utf8::c(path).wstr();
		doc.SaveFile(filePath);
		#ifdef GS2D_STR_TYPE_ANSI
		  m_provider->GetFileManager()->ConvertAnsiFileToUTF16LE(filePath);
		#endif

		SetCurrentFile(path);
		m_untitled = false;
	}
}
Пример #2
0
Bool SaveGame(char *filename)
{
	savefile = fopen(filename,"wb");
	if (savefile == NULL)
	{
		eprintf("SaveGame can't open %s to save everything!!!\n",filename);
		return False;
	}
	
	SaveClasses();
	SaveResources();
	SaveSystem();
	SaveObjects();
	SaveListNodes();
	SaveTimers(); 
	SaveUsers();
	
	fclose(savefile);
	
	return True;
}
Пример #3
0
void plSave(U32 objId)
{
    FILE *fh = NULL;

    if (plOpen(objId, PLANING_OPEN_WRITE_PLAN, &fh) == PLANING_OPEN_OK) {
	if (GamePlayMode & GP_GUARD_DESIGN) {
	    grdDo(fh, plSys, PersonsList, BurglarsNr, PersonsNr,
		  GUARDS_DO_SAVE);
	} else {
	    ubyte i;

	    SaveSystem(fh, plSys);
	    plSaveTools(fh);

	    for (i = 0; i < BurglarsNr; i++)
		SaveHandler(fh, plSys, OL_NR(GetNthNode(PersonsList, i)));
	}

	dskClose(fh);
    }
}
Пример #4
0
void ParticleEditor::SaveAs()
{
	char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH];
	if (SaveSystem(path, file))
	{
		strcpy(path, ETHGlobal::AppendExtensionIfNeeded(path, ".par").c_str());

		TiXmlDocument doc;
		TiXmlDeclaration *pDecl = new TiXmlDeclaration(GS_L("1.0"), GS_L(""), GS_L(""));
		doc.LinkEndChild(pDecl);

		TiXmlElement *pElement = new TiXmlElement(GS_L("Ethanon"));
		doc.LinkEndChild(pElement);

		m_system.WriteToXMLFile(doc.RootElement());
		const str_type::string filePath = path;
		doc.SaveFile(filePath);

		SetCurrentFile(path);
		m_untitled = false;
	}
}
bool CConfigIni::SaveConfig(LPCTSTR strIni) const
{
	SaveSystemName(m_szName);
	return SaveSystem(m_szName, m_System); 
}