Skip to content

Commit c1e2c1e

Browse files
committed
Lazy Loading Handler: Remove all replaces to fix performance issues
Those turn out to be useless, since there is no backslash in texture names besides vanilla ones.
1 parent f8a3e62 commit c1e2c1e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

LazyLoadingHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static void turnOnLazyLoadingSelectively(ILContext il) {
131131
if (orig || self.Name == null)
132132
return orig;
133133

134-
string name = self.Name.Replace("\\", "/");
134+
string name = self.Name;
135135
if (lazilyLoadedTextures.Contains(name)) {
136136
Logger.Log(LogLevel.Debug, "CollabUtils2/LazyLoadingHandler", name + " was skipped and will be lazily loaded later");
137137

@@ -204,14 +204,14 @@ private static void lazyLoadTexturesOnAccess(ILContext il) {
204204

205205
// texture is lazily loaded if it is in our list.
206206
// this will make Everest actually check if the texture is loaded, and call Reload() if it is not.
207-
string name = self.Name.Replace("\\", "/");
207+
string name = self.Name;
208208
return lazilyLoadedTextures.Contains(name);
209209
});
210210
}
211211

212212
private static void onTextureLazyLoad(On.Monocle.VirtualTexture.orig_Reload orig, VirtualTexture self) {
213213
// this is actually called on every texture load, so we need to check if this is a lazy load or not
214-
string name = self.Name.Replace("\\", "/");
214+
string name = self.Name;
215215
if (!preloadingTextures && lazilyLoadedTextures.Contains(name)) {
216216
string currentMap = (Engine.Scene as Level)?.Session?.Area.GetSID();
217217

everest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- Name: CollabUtils2
2-
Version: 1.6.3
2+
Version: 1.6.4
33
DLL: bin/Debug/net452/CollabUtils2.dll
44
Dependencies:
55
- Name: Everest

0 commit comments

Comments
 (0)