Skip to content

Commit d922e61

Browse files
committed
Compatibility with old glsl version shader issues
1 parent 6fb716b commit d922e61

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

source/funkin/backend/system/Flags.hx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class Flags {
275275
public static var DEFAULT_CHARACTER_GHOSTDISABLE_SOUND:String = "editors/character/ghostDisable";
276276
public static var DEFAULT_CHARACTER_GHOSTENABLE_SOUND:String = "editors/character/ghostEnable";
277277

278-
public static var DEFAULT_GLSL_VERSION:String = openfl.display.Shader.getDefaultGLVersion();
278+
@:lazy public static var DEFAULT_GLSL_VERSION:String = null;
279279
@:also(funkin.backend.utils.HttpUtil.userAgent)
280280
public static var USER_AGENT:String = 'request';
281281
// -- End of Codename's Default Flags --
@@ -310,6 +310,15 @@ class Flags {
310310
if (USE_LEGACY_TIMING == null) USE_LEGACY_TIMING = MOD_API_VERSION < 2;
311311
if (USE_LEGACY_ZOOM_FACTOR == null) USE_LEGACY_ZOOM_FACTOR = MOD_API_VERSION < 2;
312312
if (SUSTAINS_AS_ONE_NOTE == null) SUSTAINS_AS_ONE_NOTE = MOD_API_VERSION >= 2;
313+
if (DEFAULT_GLSL_VERSION == null) {
314+
if (MOD_API_VERSION < 2) {
315+
DEFAULT_GLSL_VERSION = "120";
316+
Logs.warn("Blend Mode Extensions won't work in MOD_API_VERSION below than 2");
317+
}
318+
else {
319+
DEFAULT_GLSL_VERSION = openfl.display.Shader.getDefaultGLVersion();
320+
}
321+
}
313322
}
314323

315324
public static function loadFromDatas(datas:Array<String>):Map<String, String> {

0 commit comments

Comments
 (0)