From 73fc855f8e6eb8efb14e7ab7d35ff269e76287f2 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 18 Jul 2024 05:23:31 +0100 Subject: [PATCH 1/8] new stage names --- source/funkin/data/stage/StageRegistry.hx | 4 ++-- source/funkin/ui/debug/charting/ChartEditorState.hx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/data/stage/StageRegistry.hx b/source/funkin/data/stage/StageRegistry.hx index a03371296..fbb6f188e 100644 --- a/source/funkin/data/stage/StageRegistry.hx +++ b/source/funkin/data/stage/StageRegistry.hx @@ -93,8 +93,8 @@ class StageRegistry extends BaseRegistry public function listBaseGameStageIds():Array { return [ - "mainStage", "spookyMansion", "phillyTrain", "limoRide", "mallXmas", "mallEvil", "school", "schoolEvil", "tankmanBattlefield", "phillyStreets", - "phillyBlazin", + "mainStage", "spookyMansion", "phillyTrain", "phillyTrainErect", "limoRide", "mallXmas", "mallEvil", "school", "schoolEvil", "tankmanBattlefield", + "phillyStreets", "phillyBlazin", ]; } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index f72cca77f..a4e0de61e 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -5703,9 +5703,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { case 'mainStage': PlayStatePlaylist.campaignId = 'week1'; - case 'spookyMansion': + case 'spookyMansion' | 'spookyMansionErect': PlayStatePlaylist.campaignId = 'week2'; - case 'phillyTrain': + case 'phillyTrain' | 'phillyTrainErect': PlayStatePlaylist.campaignId = 'week3'; case 'limoRide': PlayStatePlaylist.campaignId = 'week4'; From ad93706b1df16f8191e839b6920da4e5e316c071 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 18 Jul 2024 05:23:37 +0100 Subject: [PATCH 2/8] adjust color shader --- .../graphics/shaders/AdjustColorShader.hx | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 source/funkin/graphics/shaders/AdjustColorShader.hx diff --git a/source/funkin/graphics/shaders/AdjustColorShader.hx b/source/funkin/graphics/shaders/AdjustColorShader.hx new file mode 100644 index 000000000..2b0970eeb --- /dev/null +++ b/source/funkin/graphics/shaders/AdjustColorShader.hx @@ -0,0 +1,55 @@ +package funkin.graphics.shaders; + +import flixel.addons.display.FlxRuntimeShader; +import funkin.Paths; +import openfl.utils.Assets; + +class AdjustColorShader extends FlxRuntimeShader +{ + public var hue(default, set):Float; + public var saturation(default, set):Float; + public var brightness(default, set):Float; + public var contrast(default, set):Float; + + public function new() + { + super(Assets.getText(Paths.frag('adjustColor'))); + // FlxG.debugger.addTrackerProfile(new TrackerProfile(HSVShader, ['hue', 'saturation', 'brightness', 'contrast'])); + hue = 0; + saturation = 0; + brightness = 0; + contrast = 0; + } + + function set_hue(value:Float):Float + { + this.setFloat('hue', value); + this.hue = value; + + return this.hue; + } + + function set_saturation(value:Float):Float + { + this.setFloat('saturation', value); + this.saturation = value; + + return this.saturation; + } + + function set_brightness(value:Float):Float + { + this.setFloat('brightness', value); + this.brightness = value; + + return this.brightness; + } + + function set_contrast(value:Float):Float + { + this.setFloat('contrast', value); + this.contrast = value; + + return this.contrast; + } +} From 4bcfbc957f82726973b4aa1428b285d1132a19e7 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 18 Jul 2024 05:24:15 +0100 Subject: [PATCH 3/8] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 005c96f85..68bf145d5 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 005c96f85f4304865acb196e7cc4d6d83f9d76d8 +Subproject commit 68bf145d5786b2c3e4539a46727da67bef1fd039 From a0ab216617b16d87ed363a590979b4cdc8879012 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 18 Jul 2024 06:04:19 +0100 Subject: [PATCH 4/8] merged rain shader stuff from 'feature/week2-erect-bg-rain' --- .../shaders/RuntimePostEffectShader.hx | 31 +++++++++++++++++++ .../graphics/shaders/RuntimeRainShader.hx | 8 +++++ 2 files changed, 39 insertions(+) diff --git a/source/funkin/graphics/shaders/RuntimePostEffectShader.hx b/source/funkin/graphics/shaders/RuntimePostEffectShader.hx index 9f49da075..d39f57efe 100644 --- a/source/funkin/graphics/shaders/RuntimePostEffectShader.hx +++ b/source/funkin/graphics/shaders/RuntimePostEffectShader.hx @@ -2,6 +2,7 @@ package funkin.graphics.shaders; import flixel.FlxCamera; import flixel.FlxG; +import flixel.graphics.frames.FlxFrame; import flixel.addons.display.FlxRuntimeShader; import lime.graphics.opengl.GLProgram; import lime.utils.Log; @@ -32,6 +33,9 @@ class RuntimePostEffectShader extends FlxRuntimeShader // equals (camera.viewLeft, camera.viewTop, camera.viewRight, camera.viewBottom) uniform vec4 uCameraBounds; + // equals (frame.left, frame.top, frame.right, frame.bottom) + uniform vec4 uFrameBounds; + // screen coord -> world coord conversion // returns world coord in px vec2 screenToWorld(vec2 screenCoord) { @@ -56,6 +60,25 @@ class RuntimePostEffectShader extends FlxRuntimeShader return (worldCoord - offset) / scale; } + // screen coord -> frame coord conversion + // returns normalized frame coord + vec2 screenToFrame(vec2 screenCoord) { + float left = uFrameBounds.x; + float top = uFrameBounds.y; + float right = uFrameBounds.z; + float bottom = uFrameBounds.w; + float width = right - left; + float height = bottom - top; + + float clampedX = clamp(screenCoord.x, left, right); + float clampedY = clamp(screenCoord.y, top, bottom); + + return vec2( + (clampedX - left) / (width), + (clampedY - top) / (height) + ); + } + // internally used to get the maximum `openfl_TextureCoordv` vec2 bitmapCoordScale() { return openfl_TextureCoordv / screenCoord; @@ -80,6 +103,8 @@ class RuntimePostEffectShader extends FlxRuntimeShader { super(fragmentSource, null, glVersion); uScreenResolution.value = [FlxG.width, FlxG.height]; + uCameraBounds.value = [0, 0, FlxG.width, FlxG.height]; + uFrameBounds.value = [0, 0, FlxG.width, FlxG.height]; } // basically `updateViewInfo(FlxG.width, FlxG.height, FlxG.camera)` is good @@ -89,6 +114,12 @@ class RuntimePostEffectShader extends FlxRuntimeShader uCameraBounds.value = [camera.viewLeft, camera.viewTop, camera.viewRight, camera.viewBottom]; } + public function updateFrameInfo(frame:FlxFrame) + { + // NOTE: uv.width is actually the right pos and uv.height is the bottom pos + uFrameBounds.value = [frame.uv.x, frame.uv.y, frame.uv.width, frame.uv.height]; + } + override function __createGLProgram(vertexSource:String, fragmentSource:String):GLProgram { try diff --git a/source/funkin/graphics/shaders/RuntimeRainShader.hx b/source/funkin/graphics/shaders/RuntimeRainShader.hx index 239276bbe..68a203179 100644 --- a/source/funkin/graphics/shaders/RuntimeRainShader.hx +++ b/source/funkin/graphics/shaders/RuntimeRainShader.hx @@ -32,6 +32,14 @@ class RuntimeRainShader extends RuntimePostEffectShader return time = value; } + public var spriteMode(default, set):Bool = false; + + function set_spriteMode(value:Bool):Bool + { + this.setBool('uSpriteMode', value); + return spriteMode = value; + } + // The scale of the rain depends on the world coordinate system, so higher resolution makes // the raindrops smaller. This parameter can be used to adjust the total scale of the scene. // The size of the raindrops is proportional to the value of this parameter. From 563905ebd42810550904a3c4c894bc24afbc4f30 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 18 Jul 2024 06:04:32 +0100 Subject: [PATCH 5/8] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 68bf145d5..cfd67caa6 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 68bf145d5786b2c3e4539a46727da67bef1fd039 +Subproject commit cfd67caa688465b4a282837434832c107b661b04 From 3b7e65679357687bd6901f45c120de06970d46f8 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Wed, 31 Jul 2024 14:36:06 +0100 Subject: [PATCH 6/8] add stage names to registry + chart editor --- source/funkin/data/stage/StageRegistry.hx | 4 ++-- source/funkin/ui/debug/charting/ChartEditorState.hx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/data/stage/StageRegistry.hx b/source/funkin/data/stage/StageRegistry.hx index fbb6f188e..1f0504247 100644 --- a/source/funkin/data/stage/StageRegistry.hx +++ b/source/funkin/data/stage/StageRegistry.hx @@ -93,8 +93,8 @@ class StageRegistry extends BaseRegistry public function listBaseGameStageIds():Array { return [ - "mainStage", "spookyMansion", "phillyTrain", "phillyTrainErect", "limoRide", "mallXmas", "mallEvil", "school", "schoolEvil", "tankmanBattlefield", - "phillyStreets", "phillyBlazin", + "mainStage", "spookyMansion", "phillyTrain", "phillyTrainErect", "limoRide", "limoRideErect", "mallXmas", "mallEvil", "school", "schoolEvil", + "tankmanBattlefield", "phillyStreets", "phillyBlazin", ]; } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index a4e0de61e..24d290abd 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -5707,7 +5707,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState PlayStatePlaylist.campaignId = 'week2'; case 'phillyTrain' | 'phillyTrainErect': PlayStatePlaylist.campaignId = 'week3'; - case 'limoRide': + case 'limoRide' | 'limoRideErect': PlayStatePlaylist.campaignId = 'week4'; case 'mallXmas' | 'mallEvil': PlayStatePlaylist.campaignId = 'week5'; From 270748d1081a947c0c84ecd718e65ccb34ba6911 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Wed, 31 Jul 2024 14:36:24 +0100 Subject: [PATCH 7/8] fuck these decimals messing up my compiling --- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- source/funkin/ui/story/LevelProp.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index dc42bd651..fa895042f 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1527,7 +1527,7 @@ class FreeplayState extends MusicBeatSubState var moveDataX = funnyMoveShit.x ?? spr.x; var moveDataY = funnyMoveShit.y ?? spr.y; var moveDataSpeed = funnyMoveShit.speed ?? 0.2; - var moveDataWait = funnyMoveShit.wait ?? 0; + var moveDataWait = funnyMoveShit.wait ?? 0.0; FlxTween.tween(spr, {x: moveDataX, y: moveDataY}, moveDataSpeed, {ease: FlxEase.expoIn}); diff --git a/source/funkin/ui/story/LevelProp.hx b/source/funkin/ui/story/LevelProp.hx index 0547404a1..4e78415e3 100644 --- a/source/funkin/ui/story/LevelProp.hx +++ b/source/funkin/ui/story/LevelProp.hx @@ -16,7 +16,7 @@ class LevelProp extends Bopper this.propData = value; this.visible = this.propData != null; - danceEvery = this.propData?.danceEvery ?? 0; + danceEvery = this.propData?.danceEvery ?? 0.0; applyData(); } From 8200a08152ceea85cd242b990518007af5d4806f Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Wed, 31 Jul 2024 14:36:34 +0100 Subject: [PATCH 8/8] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index cfd67caa6..06067d187 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit cfd67caa688465b4a282837434832c107b661b04 +Subproject commit 06067d187e7699a8eec42ab07c53d195c589a690