mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-11-25 13:45:49 +00:00
Merge branch 'rewrite/master' into bugfix/web-fixes
This commit is contained in:
commit
9891dc7309
3
.github/actions/setup-haxe/action.yml
vendored
3
.github/actions/setup-haxe/action.yml
vendored
|
|
@ -82,7 +82,8 @@ runs:
|
||||||
with:
|
with:
|
||||||
run: |
|
run: |
|
||||||
git config --global --name-only --get-regexp 'url\.https\:\/\/x-access-token:.+@github\.com\/\.insteadOf' \
|
git config --global --name-only --get-regexp 'url\.https\:\/\/x-access-token:.+@github\.com\/\.insteadOf' \
|
||||||
| xargs git config --global --unset
|
| xargs -I {} git config --global --unset {}
|
||||||
|
|
||||||
git config -l --show-scope --show-origin
|
git config -l --show-scope --show-origin
|
||||||
git config --global 'url.https://x-access-token:${{ inputs.gh-token }}@github.com/.insteadOf' https://github.com/
|
git config --global 'url.https://x-access-token:${{ inputs.gh-token }}@github.com/.insteadOf' https://github.com/
|
||||||
post: git config --global --unset 'url.https://x-access-token:${{ inputs.gh-token }}@github.com/.insteadOf'
|
post: git config --global --unset 'url.https://x-access-token:${{ inputs.gh-token }}@github.com/.insteadOf'
|
||||||
|
|
|
||||||
2
assets
2
assets
|
|
@ -1 +1 @@
|
||||||
Subproject commit ebbe6a0d9a4f47786f858c2505ca27bf0760dd2e
|
Subproject commit cf5f2e03d6075ce078777a6338d319d0a19f7f7d
|
||||||
|
|
@ -66,6 +66,18 @@ class Main extends Sprite
|
||||||
|
|
||||||
function init(?event:Event):Void
|
function init(?event:Event):Void
|
||||||
{
|
{
|
||||||
|
#if web
|
||||||
|
untyped js.Syntax.code("
|
||||||
|
window.requestAnimationFrame = function(callback, element) {
|
||||||
|
var currTime = new Date().getTime();
|
||||||
|
var timeToCall = 0;
|
||||||
|
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||||
|
timeToCall);
|
||||||
|
lastTime = currTime + timeToCall;
|
||||||
|
return id;
|
||||||
|
}");
|
||||||
|
#end
|
||||||
|
|
||||||
if (hasEventListener(Event.ADDED_TO_STAGE))
|
if (hasEventListener(Event.ADDED_TO_STAGE))
|
||||||
{
|
{
|
||||||
removeEventListener(Event.ADDED_TO_STAGE, init);
|
removeEventListener(Event.ADDED_TO_STAGE, init);
|
||||||
|
|
|
||||||
48
source/funkin/graphics/shaders/TextureSwap.hx
Normal file
48
source/funkin/graphics/shaders/TextureSwap.hx
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
package funkin.graphics.shaders;
|
||||||
|
|
||||||
|
import flixel.system.FlxAssets.FlxShader;
|
||||||
|
import flixel.util.FlxColor;
|
||||||
|
import openfl.display.BitmapData;
|
||||||
|
|
||||||
|
class TextureSwap extends FlxShader
|
||||||
|
{
|
||||||
|
public var swappedImage(default, set):BitmapData;
|
||||||
|
public var amount(default, set):Float;
|
||||||
|
|
||||||
|
function set_swappedImage(_bitmapData:BitmapData):BitmapData
|
||||||
|
{
|
||||||
|
image.input = _bitmapData;
|
||||||
|
|
||||||
|
return _bitmapData;
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_amount(val:Float):Float
|
||||||
|
{
|
||||||
|
fadeAmount.value = [val];
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
@:glFragmentSource('
|
||||||
|
#pragma header
|
||||||
|
|
||||||
|
uniform sampler2D image;
|
||||||
|
uniform float fadeAmount;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 tex = flixel_texture2D(bitmap, openfl_TextureCoordv);
|
||||||
|
vec4 tex2 = flixel_texture2D(image, openfl_TextureCoordv);
|
||||||
|
|
||||||
|
vec4 finalColor = mix(tex, vec4(tex2.rgb, tex.a), fadeAmount);
|
||||||
|
|
||||||
|
gl_FragColor = finalColor;
|
||||||
|
}
|
||||||
|
')
|
||||||
|
public function new()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.amount = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
source/funkin/util/FlxColorUtil.hx
Normal file
22
source/funkin/util/FlxColorUtil.hx
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
package funkin.util;
|
||||||
|
|
||||||
|
import flixel.util.FlxColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Non inline FlxColor functions for use in hscript files
|
||||||
|
*/
|
||||||
|
class FlxColorUtil
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get an interpolated color based on two different colors.
|
||||||
|
*
|
||||||
|
* @param Color1 The first color
|
||||||
|
* @param Color2 The second color
|
||||||
|
* @param Factor Value from 0 to 1 representing how much to shift Color1 toward Color2
|
||||||
|
* @return The interpolated color
|
||||||
|
*/
|
||||||
|
public static function interpolate(Color1:FlxColor, Color2:FlxColor, Factor:Float = 0.5):FlxColor
|
||||||
|
{
|
||||||
|
return FlxColor.interpolate(Color1, Color2, Factor);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue