downsampling sorta works, ONLY WHEN (width or height % 4) is 0 or 1

This commit is contained in:
minjaesong
2017-07-05 16:03:50 +09:00
parent e54822a7e4
commit 2d5761d66c
16 changed files with 114 additions and 95 deletions

View File

@@ -47,7 +47,7 @@ object FeaturesDrawer {
* usually targeted for the environmental temperature (desert/winterland), hence the name.
*/
fun drawEnvOverlay(batch: SpriteBatch) {
val onscreen_tiles_max = FastMath.ceil(Gdx.graphics.height * Gdx.graphics.width / FastMath.sqr (TILE_SIZE.toFloat())) * 2
val onscreen_tiles_max = FastMath.ceil(TerrarumGDX.HEIGHT * TerrarumGDX.WIDTH / FastMath.sqr (TILE_SIZE.toFloat())) * 2
val onscreen_tiles_cap = onscreen_tiles_max / 4f
val onscreen_cold_tiles = BlockStats.getCount(*TILES_COLD).toFloat()
val onscreen_warm_tiles = BlockStats.getCount(*TILES_WARM).toFloat()
@@ -62,8 +62,8 @@ object FeaturesDrawer {
batch.color = ColourTemp(colTemp)
batch.fillRect(WorldCamera.x * zoom,
WorldCamera.y * zoom,
Gdx.graphics.width * if (zoom < 1) 1f / zoom else zoom,
Gdx.graphics.height * if (zoom < 1) 1f / zoom else zoom
TerrarumGDX.WIDTH * if (zoom < 1) 1f / zoom else zoom,
TerrarumGDX.HEIGHT * if (zoom < 1) 1f / zoom else zoom
)
}