@Override public FileHandleResolver newResolver (FileType fileType) { switch (fileType) { case Absolute: return new AbsoluteFileHandleResolver(); case Classpath: return new ClasspathFileHandleResolver(); case External: return new ExternalFileHandleResolver(); case Internal: return new InternalFileHandleResolver(); case Local: return new LocalFileHandleResolver(); } return null; // Should never happen }
@Override public void create () { Gdx.app.setLogLevel( Application.LOG_DEBUG ); log = new Logger( OverdriveGame.class.getCanonicalName(), Logger.DEBUG ); log.info( String.format( "%s v%s", APP_NAME, APP_VERSION ) ); log.info( String.format( "%s %s", System.getProperty("os.name"), System.getProperty("os.version") ) ); log.info( String.format( "%s, %s, %s", System.getProperty("java.vm.name"), System.getProperty("java.version"), System.getProperty("os.arch") ) ); appDir = new File( "." ); log.info( "CWD: "+ appDir.getAbsolutePath() ); String envAppPath = System.getenv( ENV_APP_PATH ); if ( envAppPath != null && envAppPath.length() > 0 ) { File envAppDir = new File( envAppPath ); if ( envAppDir.exists() ) { log.info( String.format( "Environment var (%s) changed app path: %s", ENV_APP_PATH, envAppPath ) ); appDir = envAppDir; } else { log.error( String.format( "Environment var (%s) set a non-existent app path: %s", ENV_APP_PATH, envAppPath ) ); } } resourcesDir = new File( appDir, "resources" ); java.nio.IntBuffer buf = com.badlogic.gdx.utils.BufferUtils.newIntBuffer(16); Gdx.gl.glGetIntegerv( GL10.GL_MAX_TEXTURE_SIZE, buf ); int maxTextureSize = buf.get(); log.debug( "Device Estimated Max Texture Size: "+ maxTextureSize ); log.debug( "Device GL11: "+ Gdx.graphics.isGL11Available() ); log.debug( "Device GL20: "+ Gdx.graphics.isGL20Available() ); fileHandleResolver = new URIFileHandleResolver(); fileHandleResolver.setResolver( "internal:", new InternalFileHandleResolver(), true ); fileHandleResolver.setResolver( "external:", new ExternalFileHandleResolver(), true ); fileHandleResolver.addDefaultResolver( new RelativeFileHandleResolver( resourcesDir ) ); fileHandleResolver.addDefaultResolver( new RelativeFileHandleResolver( appDir ) ); fileHandleResolver.addDefaultResolver( new InternalFileHandleResolver() ); refManager = new OVDReferenceManager(); netManager = new OVDNetManager(); assetManager = new AssetManager( fileHandleResolver ); assetManager.setLoader( BitmapFont.class, new FreeTypeFontLoader( fileHandleResolver ) ); OverdriveContext context = new OverdriveContext(); context.init( this, null, -1 ); screenManager = new OVDScreenManager( context ); screenManager.showScreen( screenManager.getInitScreenKey() ); networkTest = new com.ftloverdrive.net.NetworkTest(); //networkTest.init(); }