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;
}
Exemple #2
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;
}