sapmpes/tetris: fix build, broken by unsigned in interop (#1960)

This commit is contained in:
Mike Sinkovsky
2018-08-29 15:40:09 +05:00
committed by Nikolay Igotti
parent 9a87d25309
commit 38d47df3aa
2 changed files with 4 additions and 4 deletions
@@ -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) {
+1 -1
View File
@@ -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()
}