use of com.b3dgs.lionengine.Resolution in project lionengine by b3dgs.
the class LoaderTest method testFilterHq3x.
/**
* Test with a hq3x filter.
*/
@Test
void testFilterHq3x() {
final Resolution output = new Resolution(960, 720, 60);
final Config config = new Config(output, 16, false);
Loader.start(config, SequenceFilterMock.class, new FilterHq3x()).await();
}
use of com.b3dgs.lionengine.Resolution in project lionengine by b3dgs.
the class LoaderTest method testScaled.
/**
* Test with screen scaled.
*/
@Test
void testScaled() {
final Resolution output = new Resolution(640, 480, 0);
final Config config = new Config(output, 16, true);
Loader.start(config, SequenceSingleMock.class).await();
}
use of com.b3dgs.lionengine.Resolution in project lionengine by b3dgs.
the class DrawableTest method testMissingDpi.
/**
* Test success cases with missing DPI.
*/
@Test
void testMissingDpi() {
Drawable.setDpi(new Resolution(320, 240, 60), new Config(new Resolution(1920, 1200, 16), 60, false));
assertNotNull(Drawable.loadImage(Graphics.createImageBuffer(16, 32)));
assertNotNull(Drawable.loadImage(media));
assertNotNull(Drawable.loadSprite(Graphics.createImageBuffer(16, 32)));
assertNotNull(Drawable.loadSprite(media));
assertNotNull(Drawable.loadSpriteAnimated(Graphics.createImageBuffer(16, 32), 1, 1));
assertNotNull(Drawable.loadSpriteAnimated(media, 1, 1));
assertNotNull(Drawable.loadSpriteTiled(Graphics.createImageBuffer(16, 32), 1, 1));
assertNotNull(Drawable.loadSpriteTiled(media, 1, 1));
assertNotNull(Drawable.loadSpriteFont(media, font, 1, 1));
assertNotNull(Drawable.loadSpriteParallaxed(media, 1, 1, 1));
assertNotNull(Drawable.loadSpriteDigit(Graphics.createImageBuffer(16, 32), 1, 1, 1));
assertNotNull(Drawable.loadSpriteDigit(media, 1, 1, 1));
Drawable.setDpi(null);
}
use of com.b3dgs.lionengine.Resolution in project lionengine by b3dgs.
the class DpiTypeTest method testFrom.
/**
* Test the from function.
*/
@Test
void testFrom() {
final Resolution baseline = new Resolution(640, 480, 60);
assertEquals(DpiType.LDPI, DpiType.from(baseline, get(baseline, 0.75)));
assertEquals(DpiType.MDPI, DpiType.from(baseline, get(baseline, 1.0)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, get(baseline, 1.5)));
assertEquals(DpiType.XHDPI, DpiType.from(baseline, get(baseline, 2.0)));
assertEquals(DpiType.XXHDPI, DpiType.from(baseline, get(baseline, 3.0)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(320, 200, 60)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(320, 240, 60)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(200, 320, 60)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(240, 320, 60)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(400, 640, 60)));
assertEquals(DpiType.LDPI, DpiType.from(baseline, new Resolution(480, 640, 60)));
assertEquals(DpiType.MDPI, DpiType.from(baseline, baseline));
assertEquals(DpiType.MDPI, DpiType.from(baseline, new Resolution(800, 600, 60)));
assertEquals(DpiType.MDPI, DpiType.from(baseline, new Resolution(720, 1280, 60)));
assertEquals(DpiType.MDPI, DpiType.from(baseline, new Resolution(800, 1280, 60)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, new Resolution(1280, 720, 60)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, new Resolution(1280, 800, 60)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, new Resolution(960, 1280, 60)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, new Resolution(1080, 1920, 60)));
assertEquals(DpiType.HDPI, DpiType.from(baseline, new Resolution(1200, 1920, 60)));
assertEquals(DpiType.XHDPI, DpiType.from(baseline, new Resolution(1280, 960, 60)));
assertEquals(DpiType.XHDPI, DpiType.from(baseline, new Resolution(1600, 2560, 60)));
assertEquals(DpiType.XHDPI, DpiType.from(baseline, new Resolution(1920, 1080, 60)));
assertEquals(DpiType.XHDPI, DpiType.from(baseline, new Resolution(1920, 1200, 60)));
assertEquals(DpiType.XXHDPI, DpiType.from(baseline, new Resolution(2560, 1600, 60)));
assertEquals(DpiType.XXHDPI, DpiType.from(baseline, new Resolution(2560, 1920, 60)));
assertEquals(DpiType.XXHDPI, DpiType.from(baseline, new Resolution(1920, 2560, 60)));
}
use of com.b3dgs.lionengine.Resolution in project lionengine by b3dgs.
the class LauncherModelTest method prepare.
/**
* Clean test.
*/
@BeforeEach
public void prepare() {
services.add(new SourceResolutionDelegate(new Resolution(320, 240, 60)));
launcher = UtilLaunchable.createLauncher(services, setup, featurable);
}
Aggregations