diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ea6d12c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gta5sync"] + path = gta5sync + url = https://github.com/Syping/gta5sync diff --git a/gta5sync b/gta5sync new file mode 160000 index 0000000..b190862 --- /dev/null +++ b/gta5sync @@ -0,0 +1 @@ +Subproject commit b19086213669e3650e141e816d0a5b25588f02f5 diff --git a/gta5view-cmd.pro b/gta5view-cmd.pro new file mode 100644 index 0000000..c411d64 --- /dev/null +++ b/gta5view-cmd.pro @@ -0,0 +1,60 @@ +#/***************************************************************************** +#* gta5view-cmd - gta5view Command Line +#* Copyright (C) 2017 Syping +#* +#* This program is free software: you can redistribute it and/or modify +#* it under the terms of the GNU General Public License as published by +#* the Free Software Foundation, either version 3 of the License, or +#* (at your option) any later version. +#* +#* This program is distributed in the hope that it will be useful, +#* but WITHOUT ANY WARRANTY; without even the implied warranty of +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#* GNU General Public License for more details. +#* +#* You should have received a copy of the GNU General Public License +#* along with this program. If not, see . +#*****************************************************************************/ + +QT += gui + +DEPLOYMENT.display_name = gta5view-cmd +TARGET = gta5view-cmd +TEMPLATE = app + +SOURCES += main.cpp \ + gta5sync/SnapmaticPicture.cpp \ + gta5sync/StringParser.cpp + +HEADERS += \ + gta5sync/SnapmaticPicture.h \ + gta5sync/StringParser.h + +INCLUDEPATH += ./gta5sync + +# WINDOWS ONLY + +win32: DEFINES += GTA5SYNC_WIN GTA5VIEW_CMD +# win32: RC_FILE += res/app.rc +win32: LIBS += -luser32 +win32: CONFIG -= embed_manifest_exe + +# QT4 ONLY STUFF + +isEqual(QT_MAJOR_VERSION, 4): INCLUDEPATH += ./gta5sync/qjson4 +isEqual(QT_MAJOR_VERSION, 4): HEADERS += gta5sync/qjson4/QJsonArray.h \ + gta5sync/qjson4/QJsonDocument.h \ + gta5sync/qjson4/QJsonObject.h \ + gta5sync/qjson4/QJsonParseError.h \ + gta5sync/qjson4/QJsonValue.h \ + gta5sync/qjson4/QJsonValueRef.h \ + gta5sync/qjson4/QJsonParser.h \ + gta5sync/qjson4/QJsonRoot.h + +isEqual(QT_MAJOR_VERSION, 4): SOURCES += gta5sync/qjson4/QJsonArray.cpp \ + gta5sync/qjson4/QJsonDocument.cpp \ + gta5sync/qjson4/QJsonObject.cpp \ + gta5sync/qjson4/QJsonParseError.cpp \ + gta5sync/qjson4/QJsonValue.cpp \ + gta5sync/qjson4/QJsonValueRef.cpp \ + gta5sync/qjson4/QJsonParser.cpp diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..e51d9f1 --- /dev/null +++ b/main.cpp @@ -0,0 +1,54 @@ +/***************************************************************************** +* gta5view-cmd - gta5view Command Line +* Copyright (C) 2017 Syping +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*****************************************************************************/ + +#include "SnapmaticPicture.h" +#include +#include +using namespace std; + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + QStringList args = a.arguments(); + + if (args.length() == 3) + { + SnapmaticPicture picture(args.at(1)); + if (picture.readingPicture(true, false, true)) + { + if (!picture.exportPicture(args.at(2), "JPG")) + { + cout << "gta5view-cmd: Exporting of " << args.at(1).toStdString().c_str() << " to " << args.at(2).toStdString().c_str() << " failed!" << endl; + return 1; + } + } + else + { + cout << "gta5view-cmd: Reading of " << args.at(1).toStdString().c_str() << " failed!" << endl; + return 1; + } + } + else + { + cout << "Usage: " << args.at(0).toStdString().c_str() << " source target" << endl; + return 255; + } + + return 0; +} +