Skip to content

Commit 491e5df

Browse files
committed
Temporary commit
1 parent 0d9bf82 commit 491e5df

4 files changed

Lines changed: 29 additions & 4 deletions

File tree

assets/shaders/engine/editorWaveforms.frag

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma header
2-
3-
// Used in charter by waveforms
2+
#version 120 // this shader doesnt require expensive calculations
43

54
const vec3 gradient1 = vec3(114.0/255.0, 81.0/255.0, 135.0/255.0);
65
const vec3 gradient2 = vec3(144.0/255.0, 80.0/255.0, 186.0/255.0);
@@ -18,6 +17,21 @@ uniform vec2 waveformSize;
1817

1918
uniform bool lowDetail;
2019

20+
float catmullRom(
21+
float p0, float p1, float p2, float p3,
22+
float t
23+
) {
24+
float t2 = t * t;
25+
float t3 = t2 * t;
26+
27+
return 0.5 * (
28+
(2.0 * p1) +
29+
(-p0 + p2) * t +
30+
(2.0*p0 - 5.0*p1 + 4.0*p2 - p3) * t2 +
31+
(-p0 + 3.0*p1 - 3.0*p2 + p3) * t3
32+
);
33+
}
34+
2135
float getAmplitude(vec2 pixel) {
2236
float pixelID = floor((pixel.y+pixelOffset)/3.0);
2337

project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
title="Friday Night Funkin' - Codename Engine"
8383
file="CodenameEngine" packageName="com.yoshman29.codenameengine"
8484
package="com.yoshman29.codenameengine"
85-
version="1.0.1" company="Yoshman29"/>
85+
version="1.0.2" company="Yoshman29"/>
8686

8787
<!--Switch Export with Unique ApplicationID and Icon-->
8888
<set name="APP_ID" value="0x0100f6c013bbc000"/>

source/funkin/backend/assets/AssetsLibraryList.hx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class AssetsLibraryList extends AssetLibrary {
1919
public var transLib:TranslatedAssetLibrary;
2020
#end
2121

22+
private var cachePaths:Map<String, AssetLibrary> = [];
23+
2224
public function removeLibrary(lib:AssetLibrary) {
2325
if (lib != null) {
2426
libraries.remove(lib);
@@ -42,9 +44,17 @@ class AssetsLibraryList extends AssetLibrary {
4244
public function existsSpecific(id:String, type:String, source:AssetSource = BOTH) {
4345
if (!id.startsWith("assets/") && existsSpecific('assets/$id', type, source))
4446
return true;
47+
48+
// There's a mod that heavily relies on addons and that can causes lags just to get a path.
49+
if (cachePaths.exists(id)) {
50+
if (cachePaths.get(id).exists(id, type)) return true;
51+
else cachePaths.remove(id);
52+
}
53+
4554
for(k=>l in libraries) {
4655
if (shouldSkipLib(l, source)) continue;
4756
if (l.exists(id, type)) {
57+
cachePaths.set(id, l);
4858
return true;
4959
}
5060
}
@@ -186,6 +196,7 @@ class AssetsLibraryList extends AssetLibrary {
186196
public function reset() {
187197
unloadLibraries();
188198

199+
cachePaths.clear();
189200
libraries = [];
190201

191202
// adds default libraries in again

source/funkin/backend/assets/Paths.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class Paths
194194
return FlxAtlasFrames.fromAseprite('$key.${ext != null ? ext : Flags.IMAGE_EXT}', '$key.json');
195195

196196
inline static public function getAssetsRoot():String
197-
return ModsFolder.currentModFolder != null ? '${ModsFolder.modsPath}${ModsFolder.currentModFolder}' : #if (sys && TEST_BUILD) './${Main.pathBack}assets/' #else './assets' #end;
197+
return ModsFolder.currentModFolder != null ? '${ModsFolder.modsPath}${ModsFolder.currentModFolder}' : #if (sys && TEST_BUILD) './${Main.pathBack}assets/' #else './assets' #end;
198198

199199
/**
200200
* Gets frames at specified path.

0 commit comments

Comments
 (0)