00001
00002
00003
00004
00005
00006
00007
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef __MACH__
00018 #include <unistd.h>
00019 #include <string>
00020 #endif
00021
00022 #include "editor.h"
00023
00024 using namespace std;
00025 using namespace hoa_editor;
00026
00027 int main(int argc, char **argv)
00028 {
00029 #ifndef _WIN32
00030 #ifndef __MACH__
00031
00032
00033 if (ifstream("./dat/config/settings.lua") == NULL)
00034 chdir(DATADIR);
00035 #endif
00036 #endif
00037
00038 #ifdef __MACH__
00039 string path;
00040 path = argv[0];
00041
00042 path.erase(path.find_last_of('/'));
00043
00044 path.erase(path.find_last_of('/'));
00045
00046 path.append ( "/Resources/" );
00047 chdir ( path.c_str() );
00048 #endif
00049
00050 QApplication app(argc, argv);
00051 Editor* editor = new Editor();
00052 editor->setCaption("Hero of Allacrost Level Editor");
00053 hoa_script::ScriptManager = hoa_script::GameScript::SingletonCreate();
00054 hoa_script::ScriptManager->SingletonInitialize();
00055 app.setMainWidget(editor);
00056 editor->show();
00057 return app.exec();
00058 }