|
|
|
@ -17,9 +17,9 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
// Steps & Frames |
|
|
|
// Steps & Frames |
|
|
|
|
|
|
|
|
|
|
|
enum class FrameType(val visualOccurences: Int) { |
|
|
|
enum class FrameType(val visualOccurences: Int) { |
|
|
|
STATE(20), |
|
|
|
STATE(150), |
|
|
|
GATHER_ANIMATION(1), |
|
|
|
GATHER_ANIMATION(4), |
|
|
|
DISTRIBUTION_ANIMATION(1) |
|
|
|
DISTRIBUTION_ANIMATION(4) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
/*** |
|
|
|
@ -217,7 +217,8 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
val playerPerColumn = if (portrait) 4 else 3 |
|
|
|
val playerPerColumn = if (portrait) 4 else 3 |
|
|
|
val playerPerRow = 12 / playerPerColumn // 3 or 4 |
|
|
|
val playerPerRow = 12 / playerPerColumn // 3 or 4 |
|
|
|
|
|
|
|
|
|
|
|
this.tableHPadding = width / playerPerRow / 2 * 0.8f |
|
|
|
val padding = if (portrait) 0.8f else 0.95f |
|
|
|
|
|
|
|
this.tableHPadding = width / playerPerRow / 2 * padding |
|
|
|
this.tableVPadding = height / playerPerColumn * 0.8f |
|
|
|
this.tableVPadding = height / playerPerColumn * 0.8f |
|
|
|
|
|
|
|
|
|
|
|
this.tableRect = RectF(tableHPadding, tableVPadding, width - tableHPadding, height - tableVPadding) |
|
|
|
this.tableRect = RectF(tableHPadding, tableVPadding, width - tableHPadding, height - tableVPadding) |
|
|
|
@ -499,7 +500,7 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun frames(context: Context, frameHandler: (Bitmap) -> Unit) { |
|
|
|
fun frames(context: Context, frameHandler: (Bitmap, Int) -> Unit) { |
|
|
|
|
|
|
|
|
|
|
|
this.steps.forEach { step -> |
|
|
|
this.steps.forEach { step -> |
|
|
|
|
|
|
|
|
|
|
|
@ -508,11 +509,8 @@ class ReplayerAnimator(var handHistory: HandHistory, var export: Boolean) { |
|
|
|
val bitmap = Bitmap.createBitmap(this.width.toInt(), this.height.toInt(), Bitmap.Config.ARGB_8888) |
|
|
|
val bitmap = Bitmap.createBitmap(this.width.toInt(), this.height.toInt(), Bitmap.Config.ARGB_8888) |
|
|
|
val canvas = Canvas(bitmap) |
|
|
|
val canvas = Canvas(bitmap) |
|
|
|
TableDrawer.drawTable(this, canvas, context) |
|
|
|
TableDrawer.drawTable(this, canvas, context) |
|
|
|
(0 until this.frameType.visualOccurences).forEach { i -> |
|
|
|
|
|
|
|
Timber.d(">>> step: $currentStepIndex, currentFrame: $currentFrame, vo = $i") |
|
|
|
frameHandler(bitmap, this.frameType.visualOccurences) |
|
|
|
frameHandler(bitmap) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// bitmap.recycle() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frameDrawn() |
|
|
|
frameDrawn() |
|
|
|
} |
|
|
|
} |
|
|
|
|