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