Removed useless deprecated function in gdjs::Exporter

This commit is contained in:
Florian Rival
2014-12-21 18:50:48 +01:00
parent 615d1d72f9
commit 2b02bcc3c8
2 changed files with 0 additions and 77 deletions

View File

@@ -128,71 +128,6 @@ std::string Exporter::ExportToJSON(gd::AbstractFileSystem & fs, const gd::Projec
return "";
}
bool Exporter::ExportMetadataFile(gd::Project & project, std::string exportDir, const std::vector<std::string> & includesFiles)
{
#if !defined(GD_NO_WX_GUI)
std::string metadata = "{";
//Fonts metadata
metadata += "\"fonts\":[";
bool first = true;
wxString file = wxFindFirstFile( exportDir + "/*" );
while ( !file.empty() )
{
if ( file.Upper().EndsWith(".TTF") )
{
wxFileName relativeFile(file);
relativeFile.MakeRelativeTo(exportDir);
if ( !first ) metadata += ", ";
metadata += "{\"ffamilyname\":\"gdjs_font_"+gd::ToString(relativeFile.GetFullPath())+"\"";
metadata += ", \"filename\":\""+gd::ToString(relativeFile.GetFullPath())+"\", \"format\":\"truetype\"}";
first = false;
}
file = wxFindNextFile();
}
//Used scripts files
metadata += "],\"scripts\":[";
for (std::vector<std::string>::const_iterator it = includesFiles.begin(); it != includesFiles.end(); ++it)
{
if ( !fs.FileExists(exportDir+"/"+*it) )
continue;
if (it != includesFiles.begin()) metadata += ", ";
wxFileName relativeFile(exportDir+"/"+*it);
relativeFile.MakeRelativeTo(exportDir);
metadata += "\""+gd::ToString(relativeFile.GetFullPath(wxPATH_UNIX))+"\"";
}
//Other metadata
metadata += "], ";
metadata += "\"windowSize\":{\"w\": "+gd::ToString(project.GetMainWindowDefaultWidth())
+", \"h\": "+gd::ToString(project.GetMainWindowDefaultHeight())+"}";
metadata += "}";
{
std::ofstream file;
file.open ( std::string(exportDir+"/gd_metadata.json").c_str() );
if ( file.is_open() ) {
file << metadata;
file.close();
}
else {
lastError = "Unable to write the metadata file.";
return false;
}
}
#else
gd::LogWarning("BAD USE: Exporter::ExportMetadataFile is not available");
#endif
return true;
}
bool Exporter::ExportStandardIndexFile(gd::Project & project, std::string exportDir, const std::vector<std::string> & includesFiles, std::string additionalSpec)
{
//Open the index.html template

View File

@@ -166,18 +166,6 @@ private:
*/
bool CompleteIndexFile(std::string & indexFileContent, std::string customCss, std::string customHtml, std::string exportDir, const std::vector<std::string> & includesFiles, std::string additionalSpec);
/**
* \brief Generate the metadata file and save it to the export directory.
* The metadata is used for the online game sharing service.
*
* The includes files must be relative to the export directory.
*
* \param project The project with layouts to be exported.
* \param exportDir The directory where the preview/export must be done.
* \param includesFiles The JS files to be included in the metadata
*/
bool ExportMetadataFile(gd::Project & project, std::string exportDir, const std::vector<std::string> & includesFiles);
gd::AbstractFileSystem & fs; ///< The abstract file system to be used for exportation.
std::string lastError; ///< The last error that occurred.
};