Skip to content

Commit

Permalink
html5 compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMario committed Oct 18, 2022
1 parent fdf3501 commit aa89c2f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
1 change: 0 additions & 1 deletion assets/preload/data/introText.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pico funny--pico funny
updates each friday--on time every time
shoutouts to mason--for da homies
bonk--get in the discord call
kbhgames--steal mods
this isn't a copy of ke--*vine boom*
we do a little trolling--h
sexiest engine--in da block
Expand Down
15 changes: 11 additions & 4 deletions source/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import flixel.util.FlxSave;
import flixel.addons.transition.FlxTransitionableState;
import flixel.system.FlxAssets.FlxShader;

#if !flash
#if (!flash && sys)
import flixel.addons.display.FlxRuntimeShader;
#end

Expand Down Expand Up @@ -2869,6 +2869,7 @@ class FunkinLua {
return PlayState.instance.modchartTexts.exists(name) ? PlayState.instance.modchartTexts.get(name) : Reflect.getProperty(PlayState.instance, name);
}

#if (!flash && sys)
public function getShader(obj:String):FlxRuntimeShader
{
var killMe:Array<String> = obj.split('.');
Expand All @@ -2884,11 +2885,13 @@ class FunkinLua {
}
return null;
}
#end

function initLuaShader(name:String, ?glslVersion:Int = 120)
{
if(!ClientPrefs.shaders) return false;

#if (!flash && sys)
if(PlayState.instance.runtimeShaders.exists(name))
{
luaTrace('Shader $name was already initialized!');
Expand Down Expand Up @@ -2916,7 +2919,7 @@ class FunkinLua {
}
else frag = null;

if (FileSystem.exists(vert))
if(FileSystem.exists(vert))
{
vert = File.getContent(vert);
found = true;
Expand All @@ -2932,6 +2935,9 @@ class FunkinLua {
}
}
luaTrace('Missing shader $name .frag AND .vert files!', false, false, FlxColor.RED);
#else
luaTrace('This platform doesn\'t support Runtime Shaders!', false, false, FlxColor.RED);
#end
return false;
}

Expand Down Expand Up @@ -3143,6 +3149,7 @@ class FunkinLua {

return v;
#end
return null;
}

var lastCalledFunction:String = '';
Expand Down Expand Up @@ -3405,10 +3412,10 @@ class HScript
interp.variables.set('Character', Character);
interp.variables.set('Alphabet', Alphabet);
interp.variables.set('CustomSubstate', CustomSubstate);
#if !flash
#if (!flash && sys)
interp.variables.set('FlxRuntimeShader', FlxRuntimeShader);
interp.variables.set('ShaderFilter', openfl.filters.ShaderFilter);
#end
interp.variables.set('ShaderFilter', openfl.filters.ShaderFilter);
interp.variables.set('StringTools', StringTools);

interp.variables.set('setVar', function(name:String, value:Dynamic)
Expand Down
2 changes: 2 additions & 0 deletions source/GameplayChangersSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate
}
optionsArray.push(option);

#if !html5
var option:GameplayOption = new GameplayOption('Playback Rate', 'songspeed', 'float', 1);
option.scrollSpeed = 1;
option.minValue = 0.5;
Expand All @@ -67,6 +68,7 @@ class GameplayChangersSubstate extends MusicBeatSubstate
option.displayFormat = '%vX';
option.decimals = 2;
optionsArray.push(option);
#end

var option:GameplayOption = new GameplayOption('Health Gain Multiplier', 'healthgain', 'float', 1);
option.scrollSpeed = 2.5;
Expand Down
2 changes: 2 additions & 0 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,11 @@ class ChartingState extends MusicBeatState
voicesVolume.name = 'voices_volume';
blockPressWhileTypingOnStepper.push(voicesVolume);

#if !html5
sliderRate = new FlxUISlider(this, 'playbackSpeed', 120, 120, 0.5, 3, 150, null, 5, FlxColor.WHITE, FlxColor.BLACK);
sliderRate.name = 'Playback Rate';
tab_group_chart.add(sliderRate);
#end

tab_group_chart.add(new FlxText(metronomeStepper.x, metronomeStepper.y - 15, 0, 'BPM:'));
tab_group_chart.add(new FlxText(metronomeOffsetStepper.x, metronomeOffsetStepper.y - 15, 0, 'Offset (ms):'));
Expand Down

0 comments on commit aa89c2f

Please sign in to comment.