Skip to content

Commit b9a7d6d

Browse files
Merge pull request #32 from danila-schelkov/fix-matrix-bank-assertion
fix(matrix bank): fix min matrix and color count in assertion
2 parents ed53c62 + f2f2083 commit b9a7d6d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/dev/donutquine/swf/ScMatrixBank.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public ScMatrixBank(int matrixCount, int colorTransformCount) {
2222

2323
public void init(int matrixCount, int colorTransformCount) {
2424
// due to "compressed" block loading there will be extra matrices up to 65535th.
25-
assert matrixCount > 0 && matrixCount <= MAX_MATRIX_CAPACITY + 1 : "Expected max %d, but got %d".formatted(ScMatrixBank.MAX_MATRIX_CAPACITY + 1, matrixCount);
26-
assert colorTransformCount > 0 && colorTransformCount <= MAX_COLOR_CAPACITY + 1 : "Expected max %d, but got %d".formatted(ScMatrixBank.MAX_COLOR_CAPACITY + 1, colorTransformCount);
25+
assert matrixCount >= 0 && matrixCount <= MAX_MATRIX_CAPACITY + 1 : "Expected max %d, but got %d".formatted(ScMatrixBank.MAX_MATRIX_CAPACITY + 1, matrixCount);
26+
assert colorTransformCount >= 0 && colorTransformCount <= MAX_COLOR_CAPACITY + 1 : "Expected max %d, but got %d".formatted(ScMatrixBank.MAX_COLOR_CAPACITY + 1, colorTransformCount);
2727

2828
this.matrices = new ArrayList<>(matrixCount);
2929
for (int i = 0; i < matrixCount; i++) {

0 commit comments

Comments
 (0)