1
0
Fork 0
mirror of https://gitlab.com/Syping/gta5view-cmd synced 2024-11-21 21:20:22 +01:00

added -fs mode

This commit is contained in:
Syping 2018-02-03 07:41:24 +01:00
parent 91a3726c3f
commit 9975f541c9

View file

@ -39,6 +39,7 @@ int main(int argc, char *argv[])
bool avatarMode = false; bool avatarMode = false;
bool convertToGTA = false; bool convertToGTA = false;
bool customFormat = false; bool customFormat = false;
bool formatSwitch = false;
bool keepAspectRatio = true; bool keepAspectRatio = true;
QMap<QString,QString> flags; QMap<QString,QString> flags;
@ -110,6 +111,11 @@ int main(int argc, char *argv[])
isDefault = true; isDefault = true;
keepAspectRatio = true; keepAspectRatio = true;
} }
else if (args.at(4) == "-fs")
{
convertToGTA = false;
formatSwitch = true;
}
} }
if (args.length() >= 6) if (args.length() >= 6)
{ {
@ -137,22 +143,69 @@ int main(int argc, char *argv[])
if (picture.readingPicture(true, false, true)) if (picture.readingPicture(true, false, true))
{ {
QString filePath = args.at(2); QString filePath = args.at(2);
filePath.replace("<autodef>", picture.getExportPictureFileName()); if (!formatSwitch)
filePath.replace("<autoext>", ".jpg");
if (!picture.exportPicture(filePath, SnapmaticFormat::JPEG_Format))
{ {
cout << "gta5view-cmd: Exporting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is failed!" << endl; filePath.replace("<autodef>", picture.getExportPictureFileName());
return 1; filePath.replace("<autoext>", ".jpg");
} if (!picture.exportPicture(filePath, SnapmaticFormat::JPEG_Format))
else
{
if (flags.value("output", QString()).toLower() == "exported_filename")
{ {
cout << filePath.toStdString().c_str() << endl; cout << "gta5view-cmd: Exporting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is failed!" << endl;
return 1;
} }
else else
{ {
cout << "gta5view-cmd: Exporting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is successful!" << endl; if (flags.value("output", QString()).toLower() == "exported_filename")
{
cout << filePath.toStdString().c_str() << endl;
}
else
{
cout << "gta5view-cmd: Exporting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is successful!" << endl;
}
}
}
else
{
filePath.replace("<autodef>", picture.getPictureFileName());
if (customFormat)
{
filePath.replace("<autoext>", ".g5e");
if (!picture.exportPicture(filePath, SnapmaticFormat::G5E_Format))
{
cout << "gta5view-cmd: Converting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is failed!" << endl;
return 1;
}
else
{
if (flags.value("output", QString()).toLower() == "exported_filename")
{
cout << filePath.toStdString().c_str() << endl;
}
else
{
cout << "gta5view-cmd: Converting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is successful!" << endl;
}
}
}
else
{
filePath.replace("<autoext>", "");
if (!picture.exportPicture(filePath, SnapmaticFormat::PGTA_Format))
{
cout << "gta5view-cmd: Converting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is failed!" << endl;
return 1;
}
else
{
if (flags.value("output", QString()).toLower() == "exported_filename")
{
cout << filePath.toStdString().c_str() << endl;
}
else
{
cout << "gta5view-cmd: Converting of " << args.at(1).toStdString().c_str() << " to " << filePath.toStdString().c_str() << " is successful!" << endl;
}
}
} }
} }
} }
@ -399,8 +452,10 @@ int main(int argc, char *argv[])
cout << "Convert-only: <autodef> (auto file name at convert)" << endl; cout << "Convert-only: <autodef> (auto file name at convert)" << endl;
cout << "Convert-only: <autoext> (auto file extension at convert)" << endl; cout << "Convert-only: <autoext> (auto file extension at convert)" << endl;
cout << "Formats: jpg pgta g5e" << endl; cout << "Formats: jpg pgta g5e" << endl;
cout << "Modes: a p d aiar akar piar pkar diar dkar" << endl; cout << "Snapmatic Modes: a p d aiar akar piar pkar diar dkar" << endl;
cout << "Flags: crew=int players=int[] title=string" << endl; cout << "Snapmatic Flags: crew=int players=int[] title=string" << endl;
cout << "Modes: fs" << endl;
cout << "Flags: output=string" << endl;
} }
return 255; return 255;
} }