Funkin/source/funkin/graphics/shaders/RuntimeCustomBlendShader.hx

32 lines
806 B
Haxe
Raw Normal View History

2023-12-18 20:49:01 -05:00
package funkin.graphics.shaders;
2023-12-11 12:23:33 -05:00
import openfl.display.BitmapData;
import openfl.display.BlendMode;
import openfl.utils.Assets;
class RuntimeCustomBlendShader extends RuntimePostEffectShader
{
2024-02-13 03:32:20 -05:00
// only different name purely for hashlink fix
public var sourceSwag(default, set):BitmapData;
2023-12-11 12:23:33 -05:00
2024-02-13 03:32:20 -05:00
function set_sourceSwag(value:BitmapData):BitmapData
2023-12-18 20:49:01 -05:00
{
2024-02-13 03:32:20 -05:00
this.setBitmapData("sourceSwag", value);
return sourceSwag = value;
2023-12-18 20:49:01 -05:00
}
2023-12-11 12:23:33 -05:00
2024-02-13 03:32:20 -05:00
// name change make sure it's not the same variable name as whatever is in the shader file
public var blendSwag(default, set):BlendMode;
2023-12-11 12:23:33 -05:00
2024-02-13 03:32:20 -05:00
function set_blendSwag(value:BlendMode):BlendMode
2023-12-18 20:49:01 -05:00
{
this.setInt("blendMode", cast value);
2024-02-13 03:32:20 -05:00
return blendSwag = value;
2023-12-18 20:49:01 -05:00
}
2023-12-11 12:23:33 -05:00
2023-12-18 20:49:01 -05:00
public function new()
{
super(Assets.getText("assets/shaders/customBlend.frag"));
}
2023-12-11 12:23:33 -05:00
}