circular array is fixed and tested

This commit is contained in:
minjaesong
2019-01-09 05:43:56 +09:00
parent adf45b1f68
commit 808797760d
7 changed files with 102 additions and 27 deletions

View File

@@ -53,7 +53,7 @@ public class AppLoader implements ApplicationListener {
/**
* when FALSE, some assertion and print code will not execute
*/
public static final boolean IS_DEVELOPMENT_BUILD = true;
public static boolean IS_DEVELOPMENT_BUILD = false;
/**
@@ -169,6 +169,10 @@ public class AppLoader implements ApplicationListener {
appConfig.title = GAME_NAME;
appConfig.forceExit = false;
if (args.length == 1 && args[0].equals("isdev=true")) {
IS_DEVELOPMENT_BUILD = true;
}
new LwjglApplication(new AppLoader(appConfig), appConfig);
}

View File

@@ -621,8 +621,8 @@ fun gdxClearAndSetBlend(r: Float, g: Float, b: Float, a: Float) {
// this assumens premultiplied alpha?
//Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA)
// alpha must not be premultiplied
// alpha must not be premultiplied
Gdx.gl.glBlendFuncSeparate(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA, GL20.GL_SRC_ALPHA, GL20.GL_ONE)
Gdx.gl.glBlendEquation(GL20.GL_FUNC_ADD)
}

View File

@@ -0,0 +1,7 @@
package net.torvald.terrarum.debuggerapp;
/**
* Created by minjaesong on 2019-01-09.
*/
public class TraversingCircularArray {
}

View File

@@ -0,0 +1,47 @@
import net.torvald.dataclass.CircularArray
/**
* Created by minjaesong on 2019-01-09.
*/
class CircularArrayTest {
operator fun invoke() {
val testSet = CircularArray<Int?>(5)
val testSet2 = CircularArray<Int?>(5)
for (i in 1..5) {
testSet.add(i)
}
println("Metadata:")
println(testSet)
println("forEach():")
testSet.forEach { print("$it ") }
println("\nfold(0, sum):")
println(testSet.fold(0) { acc, v -> acc + (v ?: 0) })
println("Raw:")
testSet.buffer.forEach { print("$it ") }
println()
println()
for (i in 1..6) {
testSet2.add(i)
}
println("Metadata:")
println(testSet2)
println("forEach():")
testSet2.forEach { print("$it ") }
println("\nfold(0, sum):")
println(testSet2.fold(0) { acc, v -> acc + (v ?: 0) })
println("Raw:")
testSet2.buffer.forEach { print("$it ") }
println()
}
}
fun main(args: Array<String>) {
CircularArrayTest().invoke()
}

View File

@@ -1,4 +1,3 @@
package net.torvald.terrarum.audio.surroundpanner
import com.badlogic.gdx.Game
import com.badlogic.gdx.Gdx
@@ -7,7 +6,9 @@ import com.badlogic.gdx.backends.lwjgl.LwjglApplication
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration
import com.badlogic.gdx.files.FileHandle
import java.awt.BorderLayout
import javax.swing.*
import javax.swing.JFrame
import javax.swing.JPanel
import javax.swing.JSlider
/**
* Created by minjaesong on 2018-05-18.