fixed resolution handler selecting wrong resolution, changed Polyjet entity to proper size
This commit is contained in:
		@@ -20,7 +20,7 @@ public class PolyJetEntity extends Actor {
 | 
			
		||||
	public PolyJetEntity(Polyjet core, int rate, String jet) {
 | 
			
		||||
		this.rate = rate;
 | 
			
		||||
		
 | 
			
		||||
		setSize(3, 3);
 | 
			
		||||
		setSize(1.5f, 1.5f);
 | 
			
		||||
		
 | 
			
		||||
		setPosition(Polyjet.GAME_AREA_WIDTH/2 - getWidth()/2, -4f);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ public class LoadingScreen extends ScreenAdapter {
 | 
			
		||||
		if (timer) {
 | 
			
		||||
			zero1HD.addAction(Actions.sequence(Actions.color(Color.WHITE, 1f)));
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		core.queueAssets();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	float count = 0;
 | 
			
		||||
@@ -57,7 +57,6 @@ public class LoadingScreen extends ScreenAdapter {
 | 
			
		||||
			core.defineSkinStyles();
 | 
			
		||||
			
 | 
			
		||||
			if (reInit) {
 | 
			
		||||
				core.queueAssets();
 | 
			
		||||
				((TransitionAdapter) gotoScreen).postTransition();
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx;
 | 
			
		||||
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
 | 
			
		||||
import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution;
 | 
			
		||||
import com.badlogic.gdx.files.FileHandle;
 | 
			
		||||
import com.badlogic.gdx.math.MathUtils;
 | 
			
		||||
 | 
			
		||||
public class RoundingResolutionHandler implements FileHandleResolver {
 | 
			
		||||
	private final Resolution[] descriptors;
 | 
			
		||||
@@ -22,9 +21,9 @@ public class RoundingResolutionHandler implements FileHandleResolver {
 | 
			
		||||
		
 | 
			
		||||
		int leastDifference = -1;
 | 
			
		||||
		
 | 
			
		||||
		int w = MathUtils.round(Gdx.graphics.getWidth()*Gdx.graphics.getDensity()), h = MathUtils.round(Gdx.graphics.getHeight()*Gdx.graphics.getDensity());
 | 
			
		||||
		int w = Gdx.graphics.getWidth(), h = Gdx.graphics.getHeight();
 | 
			
		||||
		
 | 
			
		||||
		if (w < h) {
 | 
			
		||||
		if (w > h) {
 | 
			
		||||
			for (int i = 0; i < descriptors.length; i++) {
 | 
			
		||||
				int currentDiff = h - descriptors[i].portraitHeight;
 | 
			
		||||
				
 | 
			
		||||
@@ -32,7 +31,7 @@ public class RoundingResolutionHandler implements FileHandleResolver {
 | 
			
		||||
					currentDiff = currentDiff*-1;
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
				if (currentDiff < leastDifference || leastDifference == -1) {
 | 
			
		||||
				if ((currentDiff < leastDifference) || leastDifference == -1) {
 | 
			
		||||
					best = descriptors[i];
 | 
			
		||||
					leastDifference = currentDiff;
 | 
			
		||||
				}
 | 
			
		||||
@@ -56,9 +55,10 @@ public class RoundingResolutionHandler implements FileHandleResolver {
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public FileHandle resolve(String fileName) {
 | 
			
		||||
		Gdx.app.debug("RResolution Handler", "Finding best match for resolution: " + Gdx.graphics.getWidth() + "x" + Gdx.graphics.getHeight() + " for file: " + fileName);
 | 
			
		||||
		Resolution bestRes = chooseRounded(descriptors);
 | 
			
		||||
		FileHandle initialHandle = new FileHandle(fileName);
 | 
			
		||||
		
 | 
			
		||||
		Gdx.app.debug("RResolution Handler", "Selected folder: " + bestRes.folder);
 | 
			
		||||
		FileHandle resSpecificFile = resolver.resolve(bestRes.folder + "/" + initialHandle.name());
 | 
			
		||||
		if (!resSpecificFile.exists()) resSpecificFile = resolver.resolve(fileName);
 | 
			
		||||
		return resSpecificFile;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user