MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / project_save

Function project_save

TheForceEngine/TFE_Editor/editorProject.cpp:92–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 void project_save()
93 {
94 if (!s_curProject.active) { return; }
95
96 char projFile[TFE_MAX_PATH];
97 sprintf(projFile, "%s/%s.ini", s_curProject.path, s_curProject.name);
98 FileUtil::fixupPath(projFile);
99
100 FileStream proj;
101 if (!proj.open(projFile, Stream::MODE_WRITE))
102 {
103 return;
104 }
105
106 TFE_IniParser::writeKeyValue_String(proj, "Name", s_curProject.name);
107 TFE_IniParser::writeKeyValue_String(proj, "Path", s_curProject.path);
108 TFE_IniParser::writeKeyValue_StringBlock(proj, "Description", s_curProject.desc.c_str());
109 TFE_IniParser::writeKeyValue_StringBlock(proj, "Authors", s_curProject.authors.c_str());
110 TFE_IniParser::writeKeyValue_StringBlock(proj, "Credits", s_curProject.credits.c_str());
111
112 TFE_IniParser::writeKeyValue_String(proj, "ProjectType", c_projTypes[s_curProject.type]);
113 TFE_IniParser::writeKeyValue_String(proj, "Game", TFE_Settings::c_gameName[s_curProject.game]);
114 TFE_IniParser::writeKeyValue_String(proj, "FeatureSet", c_featureSet[s_curProject.game]);
115 TFE_IniParser::writeKeyValue_Int(proj, "Flags", (s32)s_curProject.flags);
116
117 // Save Resources.
118 resources_save(proj);
119
120 proj.close();
121
122 addToRecents(projFile);
123 }
124
125 bool project_load(const char* filepath)
126 {

Callers 2

project_editUiFunction · 0.85
resources_uiFunction · 0.85

Calls 9

writeKeyValue_StringFunction · 0.85
writeKeyValue_IntFunction · 0.85
resources_saveFunction · 0.85
addToRecentsFunction · 0.85
c_strMethod · 0.80
fixupPathFunction · 0.50
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected