mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
trying to fix the '720p' bug but faild :/
This commit is contained in:
@@ -211,7 +211,7 @@ public class AppLoader implements ApplicationListener {
|
||||
public static final int defaultW = 1116;
|
||||
public static final int defaultH = 744;
|
||||
public static final int minimumW = 1080;
|
||||
public static final int minimumH = 720;
|
||||
public static final int minimumH = 722;
|
||||
|
||||
public static final String FONT_DIR = "assets/graphics/fonts/terrarum-sans-bitmap";
|
||||
|
||||
@@ -318,10 +318,12 @@ public class AppLoader implements ApplicationListener {
|
||||
appConfig.useGL30 = true; // utilising some GL trickeries, need this to be TRUE
|
||||
appConfig.vSyncEnabled = getConfigBoolean("usevsync");
|
||||
appConfig.resizable = false;//true;
|
||||
//appConfig.width = 1110; // photographic ratio (1.5:1)
|
||||
//appConfig.height = 740; // photographic ratio (1.5:1)
|
||||
appConfig.width = getConfigInt("screenwidth");
|
||||
if (appConfig.width % 2 == 1) appConfig.width -= 1;
|
||||
if (appConfig.width < minimumW) appConfig.width = minimumW;
|
||||
appConfig.height = getConfigInt("screenheight");
|
||||
if (appConfig.height % 2 == 1) appConfig.height -= 1;
|
||||
if (appConfig.height < minimumH) appConfig.height = minimumH;
|
||||
appConfig.backgroundFPS = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfps"));
|
||||
appConfig.foregroundFPS = Math.min(GLOBAL_FRAMERATE_LIMIT, getConfigInt("displayfps"));
|
||||
appConfig.title = GAME_NAME;
|
||||
@@ -654,9 +656,6 @@ public class AppLoader implements ApplicationListener {
|
||||
screenW = width;
|
||||
screenH = height;
|
||||
|
||||
if (screenW % 2 == 1) screenW -= 1;
|
||||
if (screenH % 2 == 1) screenH -= 1;
|
||||
|
||||
if (currenScreen != null) currenScreen.resize(screenW, screenH);
|
||||
|
||||
|
||||
@@ -790,7 +789,7 @@ public class AppLoader implements ApplicationListener {
|
||||
currenScreen = screen;
|
||||
|
||||
currenScreen.show();
|
||||
currenScreen.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||
currenScreen.resize(appConfig.width, appConfig.height);
|
||||
|
||||
|
||||
System.gc();
|
||||
|
||||
@@ -13,6 +13,7 @@ class GdxColorMap {
|
||||
|
||||
constructor(imageFile: FileHandle) {
|
||||
AppLoader.printdbg(this, "Loading colormap from ${imageFile.name()}")
|
||||
printStackTrace(this)
|
||||
|
||||
val pixmap = Pixmap(imageFile)
|
||||
width = pixmap.width
|
||||
|
||||
@@ -292,6 +292,8 @@ class TitleScreen(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
override fun resize(width: Int, height: Int) {
|
||||
printdbg(this, "resize() called")
|
||||
printdbg(this, "called by:")
|
||||
printStackTrace(this)
|
||||
|
||||
// Set up viewport when window is resized
|
||||
initViewPort(AppLoader.screenW, AppLoader.screenH)
|
||||
|
||||
@@ -16,6 +16,8 @@ import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
|
||||
import net.torvald.terrarum.modulebasegame.gameworld.WorldTime
|
||||
import net.torvald.terrarum.modulebasegame.ui.Notification
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIBuildingMakerBlockChooser
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIBuildingMakerPenMenu
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIPaletteSelector
|
||||
import net.torvald.terrarum.modulebasegame.weather.WeatherMixer
|
||||
import net.torvald.terrarum.realestate.LandUtil
|
||||
@@ -27,7 +29,6 @@ import net.torvald.terrarum.serialise.toLittleShort
|
||||
import net.torvald.terrarum.serialise.toULittle48
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UINSMenu
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas.TILE_SIZE
|
||||
import net.torvald.terrarum.worlddrawer.WorldCamera
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
|
||||
@@ -30,7 +30,7 @@ class WorldgenLoadScreen(screenToBeLoaded: IngameInstance, private val worldwidt
|
||||
|
||||
companion object {
|
||||
private const val WIDTH_RATIO = 0.7
|
||||
private const val PREVIEW_UPDATE_RATE = 1 / 5f
|
||||
private const val PREVIEW_UPDATE_RATE = AppLoader.UPDATE_RATE
|
||||
|
||||
private val COL_TERR = Color.WHITE
|
||||
private val COL_WALLED = Color(.5f, .5f, .5f, 1f)
|
||||
|
||||
@@ -437,14 +437,12 @@ object WorldSimulator {
|
||||
}
|
||||
|
||||
// simple euclidean norm, squared
|
||||
private val actorDistanceCalculator = object : DistanceCalculator<ActorWithBody> {
|
||||
override fun distanceTo(t: ActorWithBody, p: PointND): Double {
|
||||
val dist1 = (p.getOrd(0) - t.hitbox.centeredX).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
// ROUNDWORLD implementation
|
||||
val dist2 = (p.getOrd(0) - (t.hitbox.centeredX - world.width * TILE_SIZE)).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
val dist3 = (p.getOrd(0) - (t.hitbox.centeredX + world.width * TILE_SIZE)).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
private val actorDistanceCalculator = DistanceCalculator<ActorWithBody> { t: ActorWithBody, p: PointND ->
|
||||
val dist1 = (p.getOrd(0) - t.hitbox.centeredX).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
// ROUNDWORLD implementation
|
||||
val dist2 = (p.getOrd(0) - (t.hitbox.centeredX - world.width * TILE_SIZE)).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
val dist3 = (p.getOrd(0) - (t.hitbox.centeredX + world.width * TILE_SIZE)).sqr() + (p.getOrd(1) - t.hitbox.centeredY).sqr()
|
||||
|
||||
return minOf(dist1, minOf(dist2, dist3))
|
||||
}
|
||||
minOf(dist1, minOf(dist2, dist3))
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.torvald.terrarum.modulebasegame
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
@@ -8,6 +8,7 @@ import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.fillRect
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_WHITE
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemImageButton
|
||||
@@ -28,8 +29,8 @@ class UIBuildingMakerBlockChooser(val parent: BuildingMaker): UICanvas() {
|
||||
const val MENUBAR_SIZE = 72
|
||||
const val SCROLLBAR_SIZE = 24
|
||||
|
||||
const val WIDTH = TILES_X*TILESREGION_SIZE + SCROLLBAR_SIZE + MENUBAR_SIZE
|
||||
const val HEIGHT = TILES_Y*TILESREGION_SIZE
|
||||
const val WIDTH = TILES_X * TILESREGION_SIZE + SCROLLBAR_SIZE + MENUBAR_SIZE
|
||||
const val HEIGHT = TILES_Y * TILESREGION_SIZE
|
||||
}
|
||||
|
||||
override var width = WIDTH
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.torvald.terrarum.modulebasegame
|
||||
package net.torvald.terrarum.modulebasegame.ui
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.Input
|
||||
@@ -7,7 +7,7 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
||||
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory
|
||||
import net.torvald.terrarum.modulebasegame.BuildingMaker
|
||||
import net.torvald.terrarum.ui.UICanvas
|
||||
import net.torvald.terrarum.ui.UIItemImageButton
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
@@ -17,7 +17,7 @@ open class UIItemTransitionContainer(
|
||||
val uis: Array<out UICanvas>
|
||||
) : UIItem(parent, initialX, initialY) {
|
||||
|
||||
val debugvals = true
|
||||
val debugvals = false
|
||||
|
||||
private var transitionRequested = false
|
||||
private var transitionOngoing = false
|
||||
|
||||
Reference in New Issue
Block a user