fixed resolution handler selecting wrong resolution, changed Polyjet entity to proper size

This commit is contained in:
Harrison Deng 2017-05-25 11:36:01 -05:00
parent 98f08fb060
commit 7e2839eb55
3 changed files with 7 additions and 8 deletions

View File

@ -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);

View File

@ -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();
}

View File

@ -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;