summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-12 14:57:44 +0200
committerTreeki <treeki@gmail.com>2012-09-12 14:57:44 +0200
commit3189ca5efc5826405bf2e9c7d9949ad5ea9a8a10 (patch)
treed10e8cd4e462db28dd3c2f995905c4df57a20fed /main.cpp
parentbe8b56a7f0a8f6ba5456a099b61d032fd8aa2f61 (diff)
downloadLayoutStudio-3189ca5efc5826405bf2e9c7d9949ad5ea9a8a10.tar.gz
LayoutStudio-3189ca5efc5826405bf2e9c7d9949ad5ea9a8a10.zip
initial un-exporter version
Diffstat (limited to '')
-rw-r--r--main.cpp93
1 files changed, 40 insertions, 53 deletions
diff --git a/main.cpp b/main.cpp
index e2fb2f7..a8ae533 100644
--- a/main.cpp
+++ b/main.cpp
@@ -15,9 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
-#include <QtGui/QApplication>
-#include "lsmainwindow.h"
-#include "lsglobals.h"
+#include <QCoreApplication>
#include "lyt/directorypackage.h"
#include "lyt/archivepackage.h"
@@ -27,60 +25,49 @@
#include "wii/archiveu8.h"
-#include "layoutgl/widget.h"
+#include <QDir>
-int main(int argc, char *argv[]) {
- QApplication a(argc, argv);
-
- LSGlobals::setup();
-
- LSMainWindow w;
- w.show();
-
- return a.exec();
-
- /*QFile file("H:\\ISOs\\NSMBWii\\Extracted\\Layout\\continue\\continue.arc");
- file.open(QFile::ReadOnly);
- QByteArray arc = file.readAll();
- file.close();*/
+#include "lsrlytexporter.h"
+#include <QFile>
+#include <QStringList>
+#include <cstdio>
- //LYTArchivePackage package("H:\\ISOs\\NSMBWii\\Extracted\\Layout\\continue\\continue.arc");
- QString blah1 = "preGame";
- //QString blah = "preGame/preGame.arc";
- QString blah = QString("%1/%1.arc").arg(blah1);
- QString cpath;
- if (QFile::exists("/home/me/Games/Newer/ISO/files/Layout/" + blah)) {
- cpath = "/home/me/Games/Newer/ISO/files/Layout/" + blah;
+#include "lyt/animation.h"
+int main(int argc, char *argv[]) {
+ QCoreApplication a(argc, argv);
+
+ QStringList args = a.arguments();
+ if (args.count() == 4 && args.at(1) == "export") {
+ LYTArchivePackage eArc(args.at(2));
+ LSExportPackage(&eArc, args.at(3));
+ } else if (args.count() == 4 && args.at(1) == "export-dir") {
+ QDir dir(args.at(2));
+ QDir outDir(args.at(3));
+ QStringList filters("*.arc");
+ QStringList things = dir.entryList(filters);
+ foreach (const QString &thing, things) {
+ LYTArchivePackage eArc(dir.filePath(thing));
+ QString niceName = thing;
+ niceName.replace(".arc", "");
+ LSExportPackage(&eArc, outDir.filePath("exp_"+niceName));
+ }
+ } else if (args.count() == 4 && args.at(1) == "export-nsmb") {
+ QDir dir(args.at(2));
+ QDir outDir(args.at(3));
+ QStringList filters("*.arc");
+ QStringList things = dir.entryList(filters);
+ foreach (const QString &thing, things) {
+ QString niceName = thing;
+ niceName.replace(".arc", "");
+ QDir inDir = dir;
+ inDir.cd(niceName);
+ LYTArchivePackage eArc(inDir.filePath(thing));
+ LSExportPackage(&eArc, outDir.filePath("exp_"+niceName));
+ }
} else {
- cpath = "Z:\\stuff\\Games\\Newer\\ISO\\files\\Layout\\" + blah;
+ std::printf("LayoutStudio command-line un-exporter");
}
- LYTArchivePackage package(cpath);
- LYTLayout layout(package, package.listLayouts().first());
- //LYTLayout layout(package, "continue_05.brlyt");
- //QByteArray brlyt = layout.pack();
- //QFile file("H:\\ISOs\\NSMBWii\\Extracted\\Layout\\continue\\continue\\arc\\blyt\\continue_05_repack.brlyt");
- //file.open(QFile::WriteOnly);
- //file.write(brlyt);
- //file.close();
- //package.writeLayout("continue_05.brlyt", brlyt);
- //package.savePackage();
-
-
- //LYTDirectoryPackage package("H:\\ISOs\\NSMBWii\\Extracted\\Layout\\continue\\continue\\arc");
- //LYTLayout layout(package, "continue_05.brlyt");
- //LYTDirectoryPackage package("H:\\ISOs\\TP\\banner\\arc_extr");
- //LYTDirectoryPackage package("/mnt/h/ISOs/TP/banner/arc_extr");
- //LYTDirectoryPackage package("/mnt/h/ISOs/hbm/InetChannelNew/0001000148414450/00000000_app_OUT/meta/banner_bin_OUT/arc");
- //LYTDirectoryPackage package("/mnt/h/ISOs/CSWii/BannerTools/0001000157435645/00000000_app_OUT/meta/banner_bin_OUT/arc");
- //LYTLayout layout(package, "banner.brlyt");
-
- //LSMainWindow w;
- w.show();
-
- LGLWidget w2;
- w2.setLayout(&layout);
- w2.show();
- return a.exec();
+ return 0;
}