Пример #1
0
int main(int argc, char *argv[]){
    QCoreApplication::setOrganizationName(Constants::ORGANIZATION_NAME);
    QCoreApplication::setOrganizationDomain(Constants::ORGANIZATION_DOMAIN);
    QCoreApplication::setApplicationName(Constants::DESK_APPLICATION_NAME);

	QApplication a(argc, argv);

	QDir dir = QCoreApplication::applicationDirPath();

    #if defined(Q_OS_MAC)
        dir.cdUp();
    #endif

	QDir::setCurrent(dir.absolutePath());

    gpath_init();

    gpath_addDrivePrefix(0, "|R|");
    gpath_addDrivePrefix(0, "|r|");
    gpath_addDrivePrefix(1, "|D|");
    gpath_addDrivePrefix(1, "|d|");
    gpath_addDrivePrefix(2, "|T|");
    gpath_addDrivePrefix(2, "|t|");

    gpath_setDriveFlags(0, GPATH_RO | GPATH_REAL);
    gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL);
    gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL);

    gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL);

    gpath_setDefaultDrive(0);

    gvfs_init();

    gevent_Init();

    gapplication_init();

    ginput_init();

    ggeolocation_init();

    ghttp_Init();

    gui_init();

    gtexture_init();

    gaudio_Init();

    loadPlugins();

	int result = 0;
	{
		MainWindow w;
        w.show();
		result = a.exec();
	}

    gaudio_Cleanup();

    gtexture_cleanup();

    gui_cleanup();

    ghttp_Cleanup();

    ggeolocation_init();

    ginput_cleanup();

    gapplication_cleanup();

    gevent_Cleanup();

    gvfs_cleanup();

    gpath_cleanup();

	return result;
}
Пример #2
0
int main(int argc, char *argv[])
{
//	curl_global_init(CURL_GLOBAL_WIN32);

	QCoreApplication::setOrganizationName("GiderosMobile");
	QCoreApplication::setOrganizationDomain("giderosmobile.com");
	QCoreApplication::setApplicationName("GiderosPlayer");

	QSettings::setDefaultFormat(QSettings::IniFormat);

	QApplication a(argc, argv);

	QDir dir = QCoreApplication::applicationDirPath();
#if defined(Q_OS_MAC)
	dir.cdUp();
#endif
	QDir::setCurrent(dir.absolutePath());

    gpath_init();

    gpath_addDrivePrefix(0, "|R|");
    gpath_addDrivePrefix(0, "|r|");
    gpath_addDrivePrefix(1, "|D|");
    gpath_addDrivePrefix(1, "|d|");
    gpath_addDrivePrefix(2, "|T|");
    gpath_addDrivePrefix(2, "|t|");

    gpath_setDriveFlags(0, GPATH_RO | GPATH_REAL);
    gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL);
    gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL);

    gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL);

    gpath_setDefaultDrive(0);

    gvfs_init();

    gevent_Init();

    gapplication_init();

    ginput_init();

    ggeolocation_init();

    ghttp_Init();

    gui_init();

    gtexture_init();

    gaudio_Init();

    loadPlugins();

/*	if (argc > 1)
        setZipFile(argv[1]); */

	int result = 0;
	{
		MainWindow w;
		w.show();
		result = a.exec();
	}

    gaudio_Cleanup();

    gtexture_cleanup();

    gui_cleanup();

    ghttp_Cleanup();

    ggeolocation_init();

    ginput_cleanup();

    gapplication_cleanup();

    gevent_Cleanup();

    gvfs_cleanup();

    gpath_cleanup();

//	curl_global_cleanup();

	return result;
}
Пример #3
0
ApplicationManager::ApplicationManager(bool player,const char *appname,const char *urlpath) {
	player_ = player;
	appName=appname;
	appPath=urlpath;

	// gpath & gvfs
	gpath_init();
	gpath_addDrivePrefix(0, "|R|");
	gpath_addDrivePrefix(0, "|r|");
	gpath_addDrivePrefix(1, "|D|");
	gpath_addDrivePrefix(1, "|d|");
	gpath_addDrivePrefix(2, "|T|");
	gpath_addDrivePrefix(2, "|t|");

	gpath_setDriveFlags(0, GPATH_RO);
	gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL);
	gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL);

	gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL);

	gpath_setDefaultDrive(0);

	gvfs_init();
	//gvfs_setPlayerModeEnabled(player ? 1 : 0);
	gvfs_setCodeKey(codeKey_ + 32);
	gvfs_setAssetsKey(assetsKey_ + 32);

	// event
	gevent_Init();

	// application
	gapplication_init();

	// input
	ginput_init();

	// geolocation
	//ggeolocation_init();

	// http
	//ghttp_Init();

	// ui
	//gui_init();

	// texture
	gtexture_init();
	gtexture_setCachingEnabled(1);

	// audio
	gaudio_Init();

	// application
	application_ = new LuaApplication;
	application_->setPlayerMode(player_);
	if (player_)
		application_->setPrintFunc(NetworkManager::printToServer_s,
				networkManager_);
        else
		application_->setPrintFunc(printJS,NULL);
        
	application_->enableExceptions();

	Binder::disableTypeChecking();

	init_ = false;
	running_ = false;

	width_ = 0;
	height_ = 0;

	//splashScreen_ = NULL;

	nframe_ = 0;

	applicationStarted_ = false;

	skipFirstEnterFrame_ = false;
}
Пример #4
0
ApplicationManager::ApplicationManager(JNIEnv *env, bool player)
{
	JavaVM* vm;
	env->GetJavaVM(&vm);
	jnb_setJavaVM(vm);

	player_ = player;
	
	// gpath & gvfs
	gpath_init();
    gpath_addDrivePrefix(0, "|R|");
    gpath_addDrivePrefix(0, "|r|");
    gpath_addDrivePrefix(1, "|D|");
    gpath_addDrivePrefix(1, "|d|");
    gpath_addDrivePrefix(2, "|T|");
    gpath_addDrivePrefix(2, "|t|");

    gpath_setDriveFlags(0, GPATH_RO);
    gpath_setDriveFlags(1, GPATH_RW | GPATH_REAL);
    gpath_setDriveFlags(2, GPATH_RW | GPATH_REAL);
	
	gpath_setAbsolutePathFlags(GPATH_RW | GPATH_REAL);

    gpath_setDefaultDrive(0);
	
	gvfs_init();
	gvfs_setPlayerModeEnabled(player ? 1 : 0);
	gvfs_setCodeKey(codeKey_ + 32);
	gvfs_setAssetsKey(assetsKey_ + 32);

	// event
	gevent_Init();
	
	// application
	gapplication_init();
	
	// input
	ginput_init();
	
	// geolocation
	ggeolocation_init();
	
	// http
	ghttp_Init();
	
	// ui
	gui_init();

	// texture
    gtexture_init();
    gtexture_setCachingEnabled(1);
	
	// audio
	gaudio_Init();
	
	// network
	if (player_)
		networkManager_ = new NetworkManager(this);
	else
		networkManager_ = NULL;

		// application
	application_ = new LuaApplication;
	application_->setPlayerMode(player_);
	if (player_)
		application_->setPrintFunc(NetworkManager::printToServer_s, networkManager_);
	application_->enableExceptions();

	Binder::disableTypeChecking();
		
	init_ = false;
	running_ = false;
	
	width_ = 0;
	height_ = 0;
	
	splashScreen_ = NULL;
	
	nframe_ = 0;
	
	applicationStarted_ = false;
	
	skipFirstEnterFrame_ = false;
}