replacing min/max usage with kotlin's

This commit is contained in:
minjaesong
2023-07-11 01:54:46 +09:00
parent d96b7d1b84
commit 79f19120f2
66 changed files with 308 additions and 345 deletions

View File

@@ -55,14 +55,14 @@ class ChunkLoadingLoadScreen(screenToBeLoaded: IngameInstance, private val world
App.batch.inUse { val it = it as FlippingSpriteBatch
it.color = Color.WHITE
val previewX = (drawWidth - previewWidth).div(2f).round()
val previewY = (App.scr.height - previewHeight.times(1.5f)).div(2f).round()
val previewX = (drawWidth - previewWidth).div(2f).roundToFloat()
val previewY = (App.scr.height - previewHeight.times(1.5f)).div(2f).roundToFloat()
Toolkit.drawBoxBorder(it, previewX.toInt() - 1, previewY.toInt() - 1, previewWidth + 2, previewHeight + 2)
it.drawFlipped(previewTexture, previewX, previewY)
val text = messages.getHeadElem() ?: ""
App.fontGame.draw(it,
text,
(drawWidth - App.fontGame.getWidth(text)).div(2f).round(),
(drawWidth - App.fontGame.getWidth(text)).div(2f).roundToFloat(),
previewY + previewHeight + 98 - App.fontGame.lineHeight
)
}