-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix heavy assets failing to download on slow connections #6024
Conversation
- Use a pool to limit concurrent downloads to 20. - Avoid 3D models used in different scenes to be downloaded several times
GDJS/Runtime/Model3DManager.ts
Outdated
@@ -114,6 +114,9 @@ namespace gdjs { | |||
if (!loader) { | |||
return; | |||
} | |||
if (this._loadedThreeModels.getFromName(resource.name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this conflict with hot-reloading? The comment of the function says the contrary of what this line does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the comment is wrong, hot-reload doesn't handle resources refresh and we'd likely clear cache to handle it.
e7bd47d
to
9937986
Compare
GDJS/Runtime/ResourceLoader.ts
Outdated
const task = this._prioritizeScene(sceneName); | ||
return new Promise<void>((resolve, reject) => { | ||
if (!task) { | ||
resolve(); | ||
return; | ||
} | ||
task.registerCallback(() => { | ||
this._isLoadingInBackground = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if !task
is true?
Changes