| 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 | { |
no test coverage detected