diff --git a/samples/tetris/src/main/kotlin/SDL_Visualizer.kt b/samples/tetris/src/main/kotlin/SDL_Visualizer.kt index 44e311f5e46..cdc3b568afc 100644 --- a/samples/tetris/src/main/kotlin/SDL_Visualizer.kt +++ b/samples/tetris/src/main/kotlin/SDL_Visualizer.kt @@ -23,7 +23,7 @@ import sdl.* fun get_SDL_Error() = SDL_GetError()!!.toKString() fun sleep(millis: Int) { - SDL_Delay(millis) + SDL_Delay(millis.toUInt()) } class SDL_Visualizer(val width: Int, val height: Int): GameFieldVisualizer, UserInput { @@ -396,13 +396,13 @@ class SDL_Visualizer(val width: Int, val height: Int): GameFieldVisualizer, User private fun drawGamePad() { if (gamePadButtons == null) return - SDL_SetRenderDrawColor(renderer, 127, 127, 127, SDL_ALPHA_OPAQUE.toByte()) + SDL_SetRenderDrawColor(renderer, 127, 127, 127, SDL_ALPHA_OPAQUE.toUByte()) fillRect(gamePadButtons.leftRect) fillRect(gamePadButtons.downRect) fillRect(gamePadButtons.dropRect) fillRect(gamePadButtons.rightRect) fillRect(gamePadButtons.rotateRect) - SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE.toByte()) + SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE.toUByte()) } private fun fillRect(rect: SDL_Rect) { diff --git a/samples/tetris/src/main/kotlin/Tetris.kt b/samples/tetris/src/main/kotlin/Tetris.kt index 10abbc51adf..2c4c2dcb47a 100644 --- a/samples/tetris/src/main/kotlin/Tetris.kt +++ b/samples/tetris/src/main/kotlin/Tetris.kt @@ -272,7 +272,7 @@ class GameField(val width: Int, val height: Int, val visualizer: GameFieldVisual for (i in 0..height - 1) for (j in 0..width - 1) field[i + MARGIN][j + MARGIN] = 0 - srand(time(null).toInt()) + srand(time(null).toUInt()) nextPiece = getNextPiece(false) switchCurrentPiece() }