[orx-filters] Set shader parameter to null in Filter constructors
This commit is contained in:
@@ -24,7 +24,7 @@ private var filterQuadFormat = vertexFormat {
|
||||
/**
|
||||
* Filter base class. Renders "full-screen" quads.
|
||||
*/
|
||||
open class CubemapFilter(private val shader: Shader? = null, private val watcher: ShaderWatcher? = null) {
|
||||
open class CubemapFilter(private val shader: Shader? = null) {
|
||||
|
||||
/**
|
||||
* parameter map
|
||||
@@ -79,7 +79,9 @@ open class CubemapFilter(private val shader: Shader? = null, private val watcher
|
||||
}
|
||||
|
||||
fun apply(source: Array<Cubemap>, target: RenderTarget) {
|
||||
val shader = if (this.watcher != null) watcher.shader!! else this.shader!!
|
||||
if (shader == null) {
|
||||
return
|
||||
}
|
||||
target.bind()
|
||||
|
||||
if (filterQuad == null) {
|
||||
|
||||
@@ -66,7 +66,7 @@ class PoissonBlender(val width: Int, val height: Int, type: ColorType = ColorTyp
|
||||
|
||||
}
|
||||
|
||||
class PoissonBlend: Filter2to1() {
|
||||
class PoissonBlend: Filter2to1(null) {
|
||||
private var blender: PoissonBlender? = null
|
||||
|
||||
val alphaToBitmap = AlphaToBitmap()
|
||||
|
||||
@@ -40,7 +40,7 @@ class PoissonFiller(val width: Int, val height: Int, type: ColorType = ColorType
|
||||
/**
|
||||
* Poison filling as a filter
|
||||
*/
|
||||
class PoissonFill : Filter1to1() {
|
||||
class PoissonFill : Filter1to1(null) {
|
||||
private var filler: PoissonFiller? = null
|
||||
override fun apply(source: Array<ColorBuffer>, target: Array<ColorBuffer>, clip: Rectangle?) {
|
||||
require(clip == null)
|
||||
|
||||
Reference in New Issue
Block a user