Skip to content

Commit

Permalink
Add dispose to state
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnlm committed Nov 18, 2023
1 parent cc64e9b commit bc8a4f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/dev/lucasnlm/antimine/core/models/Area.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ data class Area(
companion object {
const val BYTE_SIZE = 20 * Int.SIZE_BYTES
}

val isOdd: Boolean =
if (posY % 2 == 0) {
posX % 2 != 0
} else {
posX % 2 == 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class GameApplicationListener(
atlas = null
}

minefieldStage.dispose()

Gdx.input.inputProcessor = null
boundMinefield = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class AreaActor(
bottomRight = field.getOrNull(bottomRightId)?.canLinkTo(area) == true,
)
}

else -> {
AREA_NO_FORM
}
Expand Down Expand Up @@ -341,12 +340,7 @@ class AreaActor(
val area = this.area ?: return

batch?.run {
val isOdd: Boolean =
if (area.posY % 2 == 0) {
area.posX % 2 != 0
} else {
area.posX % 2 == 0
}
val isOdd = area.isOdd

drawBackground(this, isOdd)

Expand Down

0 comments on commit bc8a4f0

Please sign in to comment.